Sotaro KARASAWA пре 9 година
родитељ
комит
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;
 };