2021-06-17 13:41:06 +03:00
|
|
|
const configUrlHelpers = require('./lib/config-url-helpers');
|
|
|
|
|
2021-06-17 14:04:20 +03:00
|
|
|
/**
|
|
|
|
* @typedef {Object} BoundHelpers
|
|
|
|
* @property {configUrlHelpers.getSubdirFn} getSubdir
|
|
|
|
* @property {configUrlHelpers.getSiteUrlFn} getSiteUrl
|
|
|
|
* @property {configUrlHelpers.getAdminUrlFn} getAdminUrl
|
|
|
|
*
|
|
|
|
* @param {*} nconf
|
|
|
|
*/
|
2021-06-17 13:41:06 +03:00
|
|
|
module.exports.bindAll = (nconf) => {
|
|
|
|
Object.keys(configUrlHelpers).forEach((helper) => {
|
|
|
|
nconf[helper] = configUrlHelpers[helper].bind(nconf);
|
|
|
|
});
|
|
|
|
};
|