@digicms/cms
Version:
An open source headless CMS solution to create and manage your own API. It provides a powerful dashboard and features to make your life easier. Databases supported: MySQL, MariaDB, PostgreSQL, SQLite
27 lines (22 loc) • 472 B
JavaScript
;
const _ = require('lodash');
const sanitizersRegistry = () => {
const sanitizers = {};
return {
get(path) {
return _.get(sanitizers, path, []);
},
add(path, sanitizer) {
this.get(path).push(sanitizer);
return this;
},
set(path, value = []) {
_.set(sanitizers, path, value);
return this;
},
has(path) {
return _.has(sanitizers, path);
},
};
};
module.exports = sanitizersRegistry;