Просмотр исходного кода

fix nested RegExp construction

Yuki Takei 1 год назад
Родитель
Сommit
63640b6e77
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      apps/app/src/server/service/page/index.ts

+ 1 - 1
apps/app/src/server/service/page/index.ts

@@ -4391,7 +4391,7 @@ class PageService implements IPageService {
     const Page = mongoose.model('Page') as unknown as PageModel;
 
     const ancestorPaths = isTopPage(path) ? ['/'] : collectAncestorPaths(path); // root path is necessary for rendering
-    const regexps = ancestorPaths.map(path => new RegExp(generateChildrenRegExp(path))); // cannot use re2
+    const regexps = ancestorPaths.map(path => generateChildrenRegExp(path)); // cannot use re2
 
     // get pages at once
     const queryBuilder = new PageQueryBuilder(Page.find({ path: { $in: regexps } }), true);