@progress/kendo-angular-schematics
Version:
Kendo UI Schematics for Angular
31 lines • 1.32 kB
JavaScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseComplexOptions = void 0;
function parseComplexOptions(props, options) {
return props.reduce((acc, option) => {
if (options[option]) {
try {
const rawValue = `${options[option]}`;
if (rawValue) {
const parsed = JSON.parse(rawValue);
acc[option] = parsed;
// console.log(`Parsing ${option}, raw: '${rawValue}', json: '${JSON.stringify(parsed, null, " ")}'`);
}
else {
acc[option] = null;
}
}
catch (e) {
e.message = `Failed parsing '${option}' input. ${e.message}.`;
throw e;
}
}
return acc;
}, {});
}
exports.parseComplexOptions = parseComplexOptions;
//# sourceMappingURL=parse-complex-options.js.map