1.0.1 • Published 7 years ago
ore-fol-helpers v1.0.1
ore-fol-helpers
Helper functions for ore-fol.com
Installation
$ npm install ore-fol-helpers --save
Usage
'use strict'
{
const { isAdmin } = require('ore-fol-helpers')
if (isAdmin({ /** ... */ })) {
/** ... **/
}
}
Functions
Available functions
Signature | Description |
---|---|
asDbHook(promise) -> Promise | |
extFromContentType() -> string | Extension string from content type |
hasValue(obj, value) -> Boolean | Check having value |
isAdmin(user) -> boolean | Detect an user is admin or not |
mergeQueryString(url, query) -> string | Merge query string into url |
pm2Call(cmd, cmdArgs, options, options.NODE_ENV) -> Promise | Call pm2 command |
prefixedStyle(prefix, style) -> Object | |
resolveLink(url, params) -> string | Resolve link url |
saveBase64Image() -> Promise | Save base 64 image into file |
uniqueEntities(entities) -> Array | Create unique entities |
viewPathname(stackName, viewName, params) -> string | Pathname for a view |
License
This software is released under the MIT License.