Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const rootStoreReducers = options.minimal ? `{}` : `reducers`;
const rootStoreConfig = options.minimal
? `{ ${runtimeChecks} }`
: `{
metaReducers, ${runtimeChecks} }`;
const storeNgModuleImport = addImportToModule(
source,
modulePath,
options.root
? `StoreModule.forRoot(${rootStoreReducers}, ${rootStoreConfig})`
: `StoreModule.forFeature(from${stringUtils.classify(
options.name
)}.${stringUtils.camelize(
options.name
)}FeatureKey, from${stringUtils.classify(
options.name
)}.reducers, { metaReducers: from${stringUtils.classify(
options.name
)}.metaReducers })`,
relativePath
).shift();
let commonImports = [
insertImport(source, modulePath, 'StoreModule', '@ngrx/store'),
storeNgModuleImport,
];
if (options.root && !options.minimal) {
commonImports = commonImports.concat([