confinode
Version:
Node application configuration reader
34 lines • 1.04 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Create a full result based on a sub-result.
*
* @param realResult - The real result.
* @param files - The files in which results where found.
* @returns The full result.
*/
function buildResult(realResult, files) {
Object.freeze(files);
return new Proxy({}, {
get: (_, property) => {
if (property === 'files') {
return files;
}
else {
return realResult[property];
}
},
set: () => {
throw new TypeError('Configuration result is immutable');
},
deleteProperty: () => {
throw new TypeError('Configuration result is immutable');
},
defineProperty: () => {
throw new TypeError('Configuration result is immutable');
},
getPrototypeOf: () => Object.getPrototypeOf(realResult),
});
}
exports.buildResult = buildResult;
//# sourceMappingURL=ConfinodeResult.js.map