How to use the @ngrx/data/schematics-core.parseName function in @ngrx/data

To help you get started, we’ve selected a few @ngrx/data examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ngrx / platform / modules / data / schematics / ng-add / index.ts View on Github external
return (host: Tree, context: SchematicContext) => {
    (options as any).name = '';
    options.path = getProjectPath(host, options);
    options.effects = options.effects === undefined ? true : options.effects;
    options.module = options.module
      ? findModuleFromOptions(host, options as any)
      : options.module;

    const parsedPath = parseName(options.path, '');
    options.path = parsedPath.path;

    return chain([
      options && options.skipPackageJson ? noop() : addNgRxDataToPackageJson(),
      options.migrateNgrxData
        ? chain([
            removeAngularNgRxDataFromPackageJson(),
            renameNgrxDataModule(),
          ])
        : addEntityDataToNgModule(options),
      options.entityConfig
        ? createEntityConfigFile(options, parsedPath.path)
        : noop(),
    ])(host, context);
  };
}