Sotaro KARASAWA 9 лет назад
Родитель
Сommit
40a1d9f7bd
1 измененных файлов с 12 добавлено и 0 удалено
  1. 12 0
      lib/crowi/index.js

+ 12 - 0
lib/crowi/index.js

@@ -96,6 +96,18 @@ Crowi.prototype.init = function() {
   });
 }
 
+Crowi.prototype.isPageId = function(pageId) {
+  if (!pageId) {
+    return false;
+  }
+
+  if (typeof pageId === 'string' && pageId.match(/^[\da-f]{24}$/)) {
+    return true;
+  }
+
+  return false;
+};
+
 Crowi.prototype.setConfig = function(config) {
   this.config = config;
 };