|
@@ -1,9 +1,8 @@
|
|
|
import nodePath from 'path';
|
|
import nodePath from 'path';
|
|
|
|
|
|
|
|
-import ObjectId from 'bson-objectid';
|
|
|
|
|
import escapeStringRegexp from 'escape-string-regexp';
|
|
import escapeStringRegexp from 'escape-string-regexp';
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+import { isValidObjectId } from './objectid-utils';
|
|
|
import { addTrailingSlash } from './path-utils';
|
|
import { addTrailingSlash } from './path-utils';
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -28,7 +27,7 @@ export const isUsersTopPage = (path: string): boolean => {
|
|
|
*/
|
|
*/
|
|
|
export const isPermalink = (path: string): boolean => {
|
|
export const isPermalink = (path: string): boolean => {
|
|
|
const pageIdStr = path.substring(1);
|
|
const pageIdStr = path.substring(1);
|
|
|
- return ObjectId.isValid(pageIdStr);
|
|
|
|
|
|
|
+ return isValidObjectId(pageIdStr);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
/**
|