Ghost/core/server/api/shared/utils/options.js
kirrg001 a31ed7c71d Added comments for Ghost API
no issue

- jsdoc
- added more information & context
2019-05-06 14:49:25 +02:00

24 lines
475 B
JavaScript

const _ = require('lodash');
/**
* @description Helper function to prepare params for internal usages.
*
* e.g. "a,B,c" -> ["a", "b", "c"]
*
* @param {String} params
* @return {Array}
*/
const trimAndLowerCase = (params) => {
params = params || '';
if (_.isString(params)) {
params = params.split(',');
}
return params.map((item) => {
return item.trim().toLowerCase();
});
};
module.exports.trimAndLowerCase = trimAndLowerCase;