Commit 1439ec5c authored by Kevin Weis's avatar Kevin Weis

fix reference to fs.constants

parent 6f27a1fb
......@@ -12,7 +12,7 @@ class Helper {
* @static
* @param {boolean} reverseOrder
* @param {boolean} [includeUnpublished = false]
* @returns {string[] | Object[]} string[] if includeUnpublished = false else Object[] => { id, isPublished }
* @returns {string[] | any[]} string[] if includeUnpublished = false else Object[] => { id, isPublished }
* @memberOf Helper
*/
static getAllPostIds(reverseOrder, includeUnpublished = false) {
......@@ -63,7 +63,7 @@ class Helper {
/**
* @public
* @static
* @param {bool} reverseOrder
* @param {boolean} reverseOrder
* @param {boolean} [includeUnpublished = false]
* @returns
* @memberOf Helper
......@@ -171,7 +171,7 @@ class Helper {
}
try {
fs.accessSync(`${config.post.DirectoryPosts}${this.GetFsDelimiter()}${id}.json`, fs.R_OK);
fs.accessSync(`${config.post.DirectoryPosts}${this.GetFsDelimiter()}${id}.json`, fs.constants.R_OK);
} catch (error) {
return false;
}
......@@ -183,7 +183,7 @@ class Helper {
* @public
* @static
* @param {string} id
* @returns {boolean|string} false if invalid or does not exists else return post object
* @returns {boolean|any} false if invalid or does not exists else return post object
* @memberOf Helper
*/
static getPostIfIsValid(id) {
......@@ -214,7 +214,7 @@ class Helper {
* @public
* @static
* @param {string} id
* @returns {null|string}
* @returns {null|any}
* @memberOf Helper
*/
static getPost(id) {
......@@ -253,7 +253,7 @@ class Helper {
* @memberOf Helper
*/
static replaceAll(find, replace, str) {
return str.replace(new RegExp(find.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), "g"), replace);
return str.replace(new RegExp(find.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), "g"), replace);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment