@nstudio/angular
Version:
Angular Plugin for xplat
24 lines (23 loc) • 819 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const angular_1 = require("@nstudio/angular");
function default_1(options) {
if (options.module && !options.feature) {
// parse feature from module path
const parts = options.module.split('features/');
if (parts.length > 1) {
// user is targeting a feature module
const featurePath = parts[1];
const featureParts = featurePath.split('/');
if (featureParts.length > 1) {
// get the feature name
options.feature = featureParts[0];
}
}
else {
// no feature determined so it will fallback to core
}
}
return (0, angular_1.generate)('state', options);
}
;