Futa Arai 10 miesięcy temu
rodzic
commit
2ccb104f9d

+ 6 - 3
packages/remark-lsx/src/client/utils/page-node.ts

@@ -5,9 +5,12 @@ import { removeTrailingSlash } from '@growi/core/dist/utils/path-utils';
 import type { PageNode } from '../../interfaces/page-node';
 import { getDepthOfPath } from '../../utils/depth-utils';
 
-// url.resolve is legacy, use WHATWG URL API instead
-// c.f) https://nodejs.org/api/url.html#url_url_resolve_from_to
-function resolve(from, to) {
+/**
+ * Method to replace url.resolve.
+ * url.resolve is legacy, use WHATWG URL API instead.
+ * c.f) https://nodejs.org/api/url.html#url_url_resolve_from_to
+ */
+function resolve(from: string, to: string) {
   const resolvedUrl = new URL(to, new URL(from, 'resolve://'));
   if (resolvedUrl.protocol === 'resolve:') {
     // `from` is a relative URL.