@ngxs/store
Version:
26 lines • 1.06 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.normalizeBaseOptions = normalizeBaseOptions;
exports.normalizePath = normalizePath;
exports.normalizeOptionalBoolean = normalizeOptionalBoolean;
const core_1 = require("@angular-devkit/core");
const project_1 = require("./project");
function normalizeBaseOptions(host, options) {
const name = core_1.strings.dasherize(options.name);
const data = (0, project_1.getProjectData)(host, options);
if (!data) {
throw new Error('Could not resolve project path and name');
}
return Object.assign(Object.assign({}, options), { name, path: data.path, project: data.project });
}
function normalizePath(path) {
return path !== undefined ? (0, core_1.normalize)(path) : '';
}
/** Returns `value` if it's "true" | "false" and default value otherwise */
function normalizeOptionalBoolean(value, defaultValue) {
if (value === true || value === false) {
return value;
}
return defaultValue;
}
//# sourceMappingURL=normalize-options.js.map