@ngrx/data 20.0.1 → 21.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/fesm2022/ngrx-data.mjs +87 -87
  2. package/fesm2022/ngrx-data.mjs.map +1 -1
  3. package/package.json +8 -8
  4. package/schematics/ng-add/index.js +39 -42
  5. package/schematics/ng-add/index.js.map +1 -1
  6. package/schematics/ng-add/schema.js +0 -2
  7. package/schematics-core/index.js +24 -75
  8. package/schematics-core/index.js.map +1 -1
  9. package/schematics-core/utility/ast-utils.js +28 -44
  10. package/schematics-core/utility/ast-utils.js.map +1 -1
  11. package/schematics-core/utility/change.js +8 -15
  12. package/schematics-core/utility/change.js.map +1 -1
  13. package/schematics-core/utility/config.js +4 -8
  14. package/schematics-core/utility/config.js.map +1 -1
  15. package/schematics-core/utility/find-component.js +17 -22
  16. package/schematics-core/utility/find-component.js.map +1 -1
  17. package/schematics-core/utility/find-module.js +19 -24
  18. package/schematics-core/utility/find-module.js.map +1 -1
  19. package/schematics-core/utility/json-utilts.js +1 -4
  20. package/schematics-core/utility/json-utilts.js.map +1 -1
  21. package/schematics-core/utility/libs-version.js +1 -4
  22. package/schematics-core/utility/libs-version.js.map +1 -1
  23. package/schematics-core/utility/ngrx-utils.js +28 -36
  24. package/schematics-core/utility/ngrx-utils.js.map +1 -1
  25. package/schematics-core/utility/package.js +1 -4
  26. package/schematics-core/utility/package.js.map +1 -1
  27. package/schematics-core/utility/parse-name.js +5 -8
  28. package/schematics-core/utility/parse-name.js.map +1 -1
  29. package/schematics-core/utility/project.js +9 -15
  30. package/schematics-core/utility/project.js.map +1 -1
  31. package/schematics-core/utility/standalone.js +13 -18
  32. package/schematics-core/utility/standalone.js.map +1 -1
  33. package/schematics-core/utility/strings.js +9 -20
  34. package/schematics-core/utility/strings.js.map +1 -1
  35. package/schematics-core/utility/update.js +4 -7
  36. package/schematics-core/utility/update.js.map +1 -1
  37. package/schematics-core/utility/visitors.js +16 -30
  38. package/schematics-core/utility/visitors.js.map +1 -1
  39. package/types/ngrx-data.d.ts +3465 -0
  40. package/index.d.ts +0 -6
  41. package/public_api.d.ts +0 -1
  42. package/src/actions/entity-action-factory.d.ts +0 -38
  43. package/src/actions/entity-action-guard.d.ts +0 -33
  44. package/src/actions/entity-action-operators.d.ts +0 -30
  45. package/src/actions/entity-action.d.ts +0 -37
  46. package/src/actions/entity-cache-action.d.ts +0 -147
  47. package/src/actions/entity-cache-change-set.d.ts +0 -66
  48. package/src/actions/entity-op.d.ts +0 -70
  49. package/src/actions/merge-strategy.d.ts +0 -20
  50. package/src/actions/update-response-data.d.ts +0 -20
  51. package/src/dataservices/data-service-error.d.ts +0 -18
  52. package/src/dataservices/default-data-service-config.d.ts +0 -27
  53. package/src/dataservices/default-data.service.d.ts +0 -57
  54. package/src/dataservices/entity-cache-data.service.d.ts +0 -58
  55. package/src/dataservices/entity-data.service.d.ts +0 -48
  56. package/src/dataservices/http-url-generator.d.ts +0 -94
  57. package/src/dataservices/interfaces.d.ts +0 -61
  58. package/src/dataservices/persistence-result-handler.service.d.ts +0 -30
  59. package/src/dispatchers/entity-cache-dispatcher.d.ts +0 -114
  60. package/src/dispatchers/entity-commands.d.ts +0 -217
  61. package/src/dispatchers/entity-dispatcher-base.d.ts +0 -269
  62. package/src/dispatchers/entity-dispatcher-default-options.d.ts +0 -23
  63. package/src/dispatchers/entity-dispatcher-factory.d.ts +0 -46
  64. package/src/dispatchers/entity-dispatcher.d.ts +0 -58
  65. package/src/effects/entity-cache-effects.d.ts +0 -46
  66. package/src/effects/entity-effects-scheduler.d.ts +0 -4
  67. package/src/effects/entity-effects.d.ts +0 -55
  68. package/src/entity-data-config.d.ts +0 -15
  69. package/src/entity-data-without-effects.module.d.ts +0 -15
  70. package/src/entity-data.module.d.ts +0 -15
  71. package/src/entity-metadata/entity-definition.d.ts +0 -16
  72. package/src/entity-metadata/entity-definition.service.d.ts +0 -62
  73. package/src/entity-metadata/entity-filters.d.ts +0 -12
  74. package/src/entity-metadata/entity-metadata.d.ts +0 -19
  75. package/src/entity-services/entity-collection-service-base.d.ts +0 -299
  76. package/src/entity-services/entity-collection-service-elements-factory.d.ts +0 -28
  77. package/src/entity-services/entity-collection-service-factory.d.ts +0 -22
  78. package/src/entity-services/entity-collection-service.d.ts +0 -37
  79. package/src/entity-services/entity-services-base.d.ts +0 -79
  80. package/src/entity-services/entity-services-elements.d.ts +0 -41
  81. package/src/entity-services/entity-services.d.ts +0 -50
  82. package/src/index.d.ts +0 -65
  83. package/src/provide-entity-data.d.ts +0 -78
  84. package/src/reducers/constants.d.ts +0 -8
  85. package/src/reducers/entity-cache-reducer.d.ts +0 -50
  86. package/src/reducers/entity-cache.d.ts +0 -4
  87. package/src/reducers/entity-change-tracker-base.d.ts +0 -181
  88. package/src/reducers/entity-change-tracker.d.ts +0 -169
  89. package/src/reducers/entity-collection-creator.d.ts +0 -15
  90. package/src/reducers/entity-collection-reducer-methods.d.ts +0 -365
  91. package/src/reducers/entity-collection-reducer-registry.d.ts +0 -47
  92. package/src/reducers/entity-collection-reducer.d.ts +0 -14
  93. package/src/reducers/entity-collection.d.ts +0 -41
  94. package/src/selectors/entity-cache-selector.d.ts +0 -7
  95. package/src/selectors/entity-selectors$.d.ts +0 -63
  96. package/src/selectors/entity-selectors.d.ts +0 -117
  97. package/src/utils/correlation-id-generator.d.ts +0 -20
  98. package/src/utils/default-logger.d.ts +0 -9
  99. package/src/utils/default-pluralizer.d.ts +0 -18
  100. package/src/utils/guid-fns.d.ts +0 -24
  101. package/src/utils/interfaces.d.ts +0 -16
  102. package/src/utils/utilities.d.ts +0 -26
@@ -1 +1 @@
1
- {"version":3,"file":"package.js","sourceRoot":"","sources":["../../../../../modules/data/schematics-core/utility/package.ts"],"names":[],"mappings":";;AAKA,0DAqBC;AAxBD;;GAEG;AACH,SAAgB,uBAAuB,CACrC,IAAU,EACV,IAAY,EACZ,GAAW,EACX,OAAe;;IAEf,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC;QAChC,IAAM,UAAU,GAAG,MAAA,MAAA,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,0CAAE,QAAQ,CAAC,OAAO,CAAC,mCAAI,IAAI,CAAC;QACxE,IAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACpC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAChB,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;QAClB,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;YACrB,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC;QAC5B,CAAC;QAED,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAChE,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import { Tree } from '@angular-devkit/schematics';\n\n/**\n * Adds a package to the package.json\n */\nexport function addPackageToPackageJson(\n host: Tree,\n type: string,\n pkg: string,\n version: string\n): Tree {\n if (host.exists('package.json')) {\n const sourceText = host.read('package.json')?.toString('utf-8') ?? '{}';\n const json = JSON.parse(sourceText);\n if (!json[type]) {\n json[type] = {};\n }\n\n if (!json[type][pkg]) {\n json[type][pkg] = version;\n }\n\n host.overwrite('package.json', JSON.stringify(json, null, 2));\n }\n\n return host;\n}\n"]}
1
+ {"version":3,"file":"package.js","sourceRoot":"","sources":["../../../../../modules/data/schematics-core/utility/package.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,uBAAuB,CACrC,IAAU,EACV,IAAY,EACZ,GAAW,EACX,OAAe;;IAEf,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC;QAChC,IAAM,UAAU,GAAG,MAAA,MAAA,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,0CAAE,QAAQ,CAAC,OAAO,CAAC,mCAAI,IAAI,CAAC;QACxE,IAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACpC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAChB,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;QAClB,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;YACrB,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC;QAC5B,CAAC;QAED,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAChE,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import { Tree } from '@angular-devkit/schematics';\n\n/**\n * Adds a package to the package.json\n */\nexport function addPackageToPackageJson(\n host: Tree,\n type: string,\n pkg: string,\n version: string\n): Tree {\n if (host.exists('package.json')) {\n const sourceText = host.read('package.json')?.toString('utf-8') ?? '{}';\n const json = JSON.parse(sourceText);\n if (!json[type]) {\n json[type] = {};\n }\n\n if (!json[type][pkg]) {\n json[type][pkg] = version;\n }\n\n host.overwrite('package.json', JSON.stringify(json, null, 2));\n }\n\n return host;\n}\n"]}
@@ -1,13 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseName = parseName;
4
- var core_1 = require("@angular-devkit/core");
5
- function parseName(path, name) {
6
- var nameWithoutPath = (0, core_1.basename)(name);
7
- var namePath = (0, core_1.dirname)((path + '/' + name));
1
+ import { basename, dirname, normalize } from '@angular-devkit/core';
2
+ export function parseName(path, name) {
3
+ var nameWithoutPath = basename(name);
4
+ var namePath = dirname((path + '/' + name));
8
5
  return {
9
6
  name: nameWithoutPath,
10
- path: (0, core_1.normalize)('/' + namePath),
7
+ path: normalize('/' + namePath),
11
8
  };
12
9
  }
13
10
  //# sourceMappingURL=parse-name.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"parse-name.js","sourceRoot":"","sources":["../../../../../modules/data/schematics-core/utility/parse-name.ts"],"names":[],"mappings":";;AAOA,8BAQC;AAfD,6CAA0E;AAO1E,SAAgB,SAAS,CAAC,IAAY,EAAE,IAAY;IAClD,IAAM,eAAe,GAAG,IAAA,eAAQ,EAAC,IAAY,CAAC,CAAC;IAC/C,IAAM,QAAQ,GAAG,IAAA,cAAO,EAAC,CAAC,IAAI,GAAG,GAAG,GAAG,IAAI,CAAS,CAAC,CAAC;IAEtD,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,IAAA,gBAAS,EAAC,GAAG,GAAG,QAAQ,CAAC;KAChC,CAAC;AACJ,CAAC","sourcesContent":["import { Path, basename, dirname, normalize } from '@angular-devkit/core';\n\nexport interface Location {\n name: string;\n path: Path;\n}\n\nexport function parseName(path: string, name: string): Location {\n const nameWithoutPath = basename(name as Path);\n const namePath = dirname((path + '/' + name) as Path);\n\n return {\n name: nameWithoutPath,\n path: normalize('/' + namePath),\n };\n}\n"]}
1
+ {"version":3,"file":"parse-name.js","sourceRoot":"","sources":["../../../../../modules/data/schematics-core/utility/parse-name.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAO1E,MAAM,UAAU,SAAS,CAAC,IAAY,EAAE,IAAY;IAClD,IAAM,eAAe,GAAG,QAAQ,CAAC,IAAY,CAAC,CAAC;IAC/C,IAAM,QAAQ,GAAG,OAAO,CAAC,CAAC,IAAI,GAAG,GAAG,GAAG,IAAI,CAAS,CAAC,CAAC;IAEtD,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,SAAS,CAAC,GAAG,GAAG,QAAQ,CAAC;KAChC,CAAC;AACJ,CAAC","sourcesContent":["import { Path, basename, dirname, normalize } from '@angular-devkit/core';\n\nexport interface Location {\n name: string;\n path: Path;\n}\n\nexport function parseName(path: string, name: string): Location {\n const nameWithoutPath = basename(name as Path);\n const namePath = dirname((path + '/' + name) as Path);\n\n return {\n name: nameWithoutPath,\n path: normalize('/' + namePath),\n };\n}\n"]}
@@ -1,13 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getProject = getProject;
4
- exports.getProjectPath = getProjectPath;
5
- exports.isLib = isLib;
6
- exports.getProjectMainFile = getProjectMainFile;
7
- var config_1 = require("./config");
8
- var schematics_1 = require("@angular-devkit/schematics");
9
- function getProject(host, options) {
10
- var workspace = (0, config_1.getWorkspace)(host);
1
+ import { getWorkspace } from './config';
2
+ import { SchematicsException } from '@angular-devkit/schematics';
3
+ export function getProject(host, options) {
4
+ var workspace = getWorkspace(host);
11
5
  if (!options.project) {
12
6
  var defaultProject = workspace
13
7
  .defaultProject;
@@ -18,7 +12,7 @@ function getProject(host, options) {
18
12
  }
19
13
  return workspace.projects[options.project];
20
14
  }
21
- function getProjectPath(host, options) {
15
+ export function getProjectPath(host, options) {
22
16
  var project = getProject(host, options);
23
17
  if (project.root.slice(-1) === '/') {
24
18
  project.root = project.root.substring(0, project.root.length - 1);
@@ -29,18 +23,18 @@ function getProjectPath(host, options) {
29
23
  }
30
24
  return options.path;
31
25
  }
32
- function isLib(host, options) {
26
+ export function isLib(host, options) {
33
27
  var project = getProject(host, options);
34
28
  return project.projectType === 'library';
35
29
  }
36
- function getProjectMainFile(host, options) {
30
+ export function getProjectMainFile(host, options) {
37
31
  if (isLib(host, options)) {
38
- throw new schematics_1.SchematicsException("Invalid project type");
32
+ throw new SchematicsException("Invalid project type");
39
33
  }
40
34
  var project = getProject(host, options);
41
35
  var projectOptions = project.architect['build'].options;
42
36
  if (!(projectOptions === null || projectOptions === void 0 ? void 0 : projectOptions.main) && !(projectOptions === null || projectOptions === void 0 ? void 0 : projectOptions.browser)) {
43
- throw new schematics_1.SchematicsException("Could not find the main file ".concat(project));
37
+ throw new SchematicsException("Could not find the main file ".concat(project));
44
38
  }
45
39
  return (projectOptions.browser || projectOptions.main);
46
40
  }
@@ -1 +1 @@
1
- {"version":3,"file":"project.js","sourceRoot":"","sources":["../../../../../modules/data/schematics-core/utility/project.ts"],"names":[],"mappings":";;AAYA,gCAgBC;AAED,wCAkBC;AAED,sBAOC;AAED,gDAeC;AAzED,mCAAwC;AACxC,yDAAuE;AAUvE,SAAgB,UAAU,CACxB,IAAU,EACV,OAAoE;IAEpE,IAAM,SAAS,GAAG,IAAA,qBAAY,EAAC,IAAI,CAAC,CAAC;IAErC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QACrB,IAAM,cAAc,GAAI,SAAyC;aAC9D,cAAc,CAAC;QAClB,OAAO,CAAC,OAAO;YACb,cAAc,KAAK,SAAS;gBAC1B,CAAC,CAAC,cAAc;gBAChB,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AAC7C,CAAC;AAED,SAAgB,cAAc,CAC5B,IAAU,EACV,OAAoE;IAEpE,IAAM,OAAO,GAAG,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAE1C,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;QACnC,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACpE,CAAC;IAED,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC/B,IAAM,cAAc,GAClB,OAAO,CAAC,WAAW,KAAK,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;QAExD,OAAO,UAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,WAAI,OAAO,CAAC,IAAI,CAAE,CAAC,CAAC,CAAC,EAAE,kBAAQ,cAAc,CAAE,CAAC;IAC3E,CAAC;IAED,OAAO,OAAO,CAAC,IAAI,CAAC;AACtB,CAAC;AAED,SAAgB,KAAK,CACnB,IAAU,EACV,OAAoE;IAEpE,IAAM,OAAO,GAAG,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAE1C,OAAO,OAAO,CAAC,WAAW,KAAK,SAAS,CAAC;AAC3C,CAAC;AAED,SAAgB,kBAAkB,CAChC,IAAU,EACV,OAAoE;IAEpE,IAAI,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,gCAAmB,CAAC,sBAAsB,CAAC,CAAC;IACxD,CAAC;IACD,IAAM,OAAO,GAAG,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC1C,IAAM,cAAc,GAAG,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC;IAE1D,IAAI,CAAC,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,IAAI,CAAA,IAAI,CAAC,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,OAAO,CAAA,EAAE,CAAC;QACtD,MAAM,IAAI,gCAAmB,CAAC,uCAAgC,OAAO,CAAE,CAAC,CAAC;IAC3E,CAAC;IAED,OAAO,CAAC,cAAc,CAAC,OAAO,IAAI,cAAc,CAAC,IAAI,CAAW,CAAC;AACnE,CAAC","sourcesContent":["import { TargetDefinition } from '@angular-devkit/core/src/workspace';\nimport { getWorkspace } from './config';\nimport { SchematicsException, Tree } from '@angular-devkit/schematics';\n\nexport interface WorkspaceProject {\n root: string;\n projectType: string;\n architect: {\n [key: string]: TargetDefinition;\n };\n}\n\nexport function getProject(\n host: Tree,\n options: { project?: string | undefined; path?: string | undefined }\n): WorkspaceProject {\n const workspace = getWorkspace(host);\n\n if (!options.project) {\n const defaultProject = (workspace as { defaultProject?: string })\n .defaultProject;\n options.project =\n defaultProject !== undefined\n ? defaultProject\n : Object.keys(workspace.projects)[0];\n }\n\n return workspace.projects[options.project];\n}\n\nexport function getProjectPath(\n host: Tree,\n options: { project?: string | undefined; path?: string | undefined }\n) {\n const project = getProject(host, options);\n\n if (project.root.slice(-1) === '/') {\n project.root = project.root.substring(0, project.root.length - 1);\n }\n\n if (options.path === undefined) {\n const projectDirName =\n project.projectType === 'application' ? 'app' : 'lib';\n\n return `${project.root ? `/${project.root}` : ''}/src/${projectDirName}`;\n }\n\n return options.path;\n}\n\nexport function isLib(\n host: Tree,\n options: { project?: string | undefined; path?: string | undefined }\n) {\n const project = getProject(host, options);\n\n return project.projectType === 'library';\n}\n\nexport function getProjectMainFile(\n host: Tree,\n options: { project?: string | undefined; path?: string | undefined }\n) {\n if (isLib(host, options)) {\n throw new SchematicsException(`Invalid project type`);\n }\n const project = getProject(host, options);\n const projectOptions = project.architect['build'].options;\n\n if (!projectOptions?.main && !projectOptions?.browser) {\n throw new SchematicsException(`Could not find the main file ${project}`);\n }\n\n return (projectOptions.browser || projectOptions.main) as string;\n}\n"]}
1
+ {"version":3,"file":"project.js","sourceRoot":"","sources":["../../../../../modules/data/schematics-core/utility/project.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAQ,MAAM,4BAA4B,CAAC;AAUvE,MAAM,UAAU,UAAU,CACxB,IAAU,EACV,OAAoE;IAEpE,IAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAErC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QACrB,IAAM,cAAc,GAAI,SAAyC;aAC9D,cAAc,CAAC;QAClB,OAAO,CAAC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CAAC;QACzB,MAAM,IAAI,mBAAmB,CAAC,sBAAsB,CAAC,CAAC;IACxD,CAAC;IACD,IAAM,OAAO,GAAG,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC1C,IAAM,cAAc,GAAG,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC;IAE1D,IAAI,CAAC,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,IAAI,CAAA,IAAI,CAAC,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,OAAO,CAAA,EAAE,CAAC;QACtD,MAAM,IAAI,mBAAmB,CAAC,uCAAgC,OAAO,CAAE,CAAC,CAAC;IAC3E,CAAC;IAED,OAAO,CAAC,cAAc,CAAC,OAAO,IAAI,cAAc,CAAC,IAAI,CAAW,CAAC;AACnE,CAAC","sourcesContent":["import { workspaces } from '@angular-devkit/core';\nimport { getWorkspace } from './config';\nimport { SchematicsException, Tree } from '@angular-devkit/schematics';\n\nexport interface WorkspaceProject {\n root: string;\n projectType: string;\n architect: {\n [key: string]: workspaces.TargetDefinition;\n };\n}\n\nexport function getProject(\n host: Tree,\n options: { project?: string | undefined; path?: string | undefined }\n): WorkspaceProject {\n const workspace = getWorkspace(host);\n\n if (!options.project) {\n const defaultProject = (workspace as { defaultProject?: string })\n .defaultProject;\n options.project =\n defaultProject !== undefined\n ? defaultProject\n : Object.keys(workspace.projects)[0];\n }\n\n return workspace.projects[options.project];\n}\n\nexport function getProjectPath(\n host: Tree,\n options: { project?: string | undefined; path?: string | undefined }\n) {\n const project = getProject(host, options);\n\n if (project.root.slice(-1) === '/') {\n project.root = project.root.substring(0, project.root.length - 1);\n }\n\n if (options.path === undefined) {\n const projectDirName =\n project.projectType === 'application' ? 'app' : 'lib';\n\n return `${project.root ? `/${project.root}` : ''}/src/${projectDirName}`;\n }\n\n return options.path;\n}\n\nexport function isLib(\n host: Tree,\n options: { project?: string | undefined; path?: string | undefined }\n) {\n const project = getProject(host, options);\n\n return project.projectType === 'library';\n}\n\nexport function getProjectMainFile(\n host: Tree,\n options: { project?: string | undefined; path?: string | undefined }\n) {\n if (isLib(host, options)) {\n throw new SchematicsException(`Invalid project type`);\n }\n const project = getProject(host, options);\n const projectOptions = project.architect['build'].options;\n\n if (!projectOptions?.main && !projectOptions?.browser) {\n throw new SchematicsException(`Could not find the main file ${project}`);\n }\n\n return (projectOptions.browser || projectOptions.main) as string;\n}\n"]}
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __values = (this && this.__values) || function(o) {
3
2
  var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
4
3
  if (m) return m.call(o);
@@ -35,16 +34,12 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
35
34
  }
36
35
  return to.concat(ar || Array.prototype.slice.call(from));
37
36
  };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.callsProvidersFunction = callsProvidersFunction;
40
- exports.addFunctionalProvidersToStandaloneBootstrap = addFunctionalProvidersToStandaloneBootstrap;
41
- exports.findBootstrapApplicationCall = findBootstrapApplicationCall;
42
37
  // copied from https://github.com/angular/angular-cli/blob/17.3.x/packages/schematics/angular/private/standalone.ts
43
- var schematics_1 = require("@angular-devkit/schematics");
44
- var path_1 = require("path");
45
- var ast_utils_1 = require("./ast-utils");
46
- var change_1 = require("./change");
47
- var ts = require("typescript");
38
+ import { SchematicsException, } from '@angular-devkit/schematics';
39
+ import { dirname, join } from 'path';
40
+ import { insertImport } from './ast-utils';
41
+ import { InsertChange } from './change';
42
+ import * as ts from 'typescript';
48
43
  /**
49
44
  * Checks whether a providers function is being called in a `bootstrapApplication` call.
50
45
  * @param tree File tree of the project.
@@ -53,7 +48,7 @@ var ts = require("typescript");
53
48
  * @deprecated Private utility that will be removed. Use `addRootImport` or `addRootProvider` from
54
49
  * `@schematics/angular/utility` instead.
55
50
  */
56
- function callsProvidersFunction(tree, filePath, functionName) {
51
+ export function callsProvidersFunction(tree, filePath, functionName) {
57
52
  var sourceFile = createSourceFile(tree, filePath);
58
53
  var bootstrapCall = findBootstrapApplicationCall(sourceFile);
59
54
  var appConfig = bootstrapCall
@@ -79,18 +74,18 @@ function callsProvidersFunction(tree, filePath, functionName) {
79
74
  * @deprecated Private utility that will be removed. Use `addRootImport` or `addRootProvider` from
80
75
  * `@schematics/angular/utility` instead.
81
76
  */
82
- function addFunctionalProvidersToStandaloneBootstrap(tree, filePath, functionName, importPath, args) {
77
+ export function addFunctionalProvidersToStandaloneBootstrap(tree, filePath, functionName, importPath, args) {
83
78
  if (args === void 0) { args = []; }
84
79
  var sourceFile = createSourceFile(tree, filePath);
85
80
  var bootstrapCall = findBootstrapApplicationCall(sourceFile);
86
81
  var addImports = function (file, recorder) {
87
- var change = (0, ast_utils_1.insertImport)(file, file.getText(), functionName, importPath);
88
- if (change instanceof change_1.InsertChange) {
82
+ var change = insertImport(file, file.getText(), functionName, importPath);
83
+ if (change instanceof InsertChange) {
89
84
  recorder.insertLeft(change.pos, change.toAdd);
90
85
  }
91
86
  };
92
87
  if (!bootstrapCall) {
93
- throw new schematics_1.SchematicsException("Could not find bootstrapApplication call in ".concat(filePath));
88
+ throw new SchematicsException("Could not find bootstrapApplication call in ".concat(filePath));
94
89
  }
95
90
  var providersCall = ts.factory.createCallExpression(ts.factory.createIdentifier(functionName), undefined, args);
96
91
  // If there's only one argument, we have to create a new object literal.
@@ -112,7 +107,7 @@ function addFunctionalProvidersToStandaloneBootstrap(tree, filePath, functionNam
112
107
  // Otherwise attempt to merge into the current config.
113
108
  var appConfig = findAppConfig(bootstrapCall, tree, filePath);
114
109
  if (!appConfig) {
115
- throw new schematics_1.SchematicsException("Could not statically analyze config in bootstrapApplication call in ".concat(filePath));
110
+ throw new SchematicsException("Could not statically analyze config in bootstrapApplication call in ".concat(filePath));
116
111
  }
117
112
  var configFilePath = appConfig.filePath, config = appConfig.node;
118
113
  var recorder = tree.beginUpdate(configFilePath);
@@ -134,7 +129,7 @@ function addFunctionalProvidersToStandaloneBootstrap(tree, filePath, functionNam
134
129
  * @deprecated Private utility that will be removed. Use `addRootImport` or `addRootProvider` from
135
130
  * `@schematics/angular/utility` instead.
136
131
  */
137
- function findBootstrapApplicationCall(sourceFile) {
132
+ export function findBootstrapApplicationCall(sourceFile) {
138
133
  var localName = findImportLocalName(sourceFile, 'bootstrapApplication', '@angular/platform-browser');
139
134
  if (!localName) {
140
135
  return null;
@@ -225,7 +220,7 @@ function resolveAppConfigFromIdentifier(identifier, tree, bootstapFilePath) {
225
220
  // Look for a variable with the imported name in the file. Note that ideally we would use
226
221
  // the type checker to resolve this, but we can't because these utilities are set up to
227
222
  // operate on individual files, not the entire program.
228
- var filePath = (0, path_1.join)((0, path_1.dirname)(bootstapFilePath), node.moduleSpecifier.text + '.ts');
223
+ var filePath = join(dirname(bootstapFilePath), node.moduleSpecifier.text + '.ts');
229
224
  var importedSourceFile = createSourceFile(tree, filePath);
230
225
  var resolvedVariable = findAppConfigFromVariableName(importedSourceFile, (specifier.propertyName || specifier.name).text);
231
226
  if (resolvedVariable) {
@@ -1 +1 @@
1
- {"version":3,"file":"standalone.js","sourceRoot":"","sources":["../../../../../modules/data/schematics-core/utility/standalone.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,wDAoBC;AAaD,kGA2EC;AAOD,oEA8BC;AA7KD,mHAAmH;AACnH,yDAIoC;AACpC,6BAAqC;AACrC,yCAA2C;AAC3C,mCAAwC;AACxC,+BAAiC;AAWjC;;;;;;;GAOG;AACH,SAAgB,sBAAsB,CACpC,IAAU,EACV,QAAgB,EAChB,YAAoB;IAEpB,IAAM,UAAU,GAAG,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACpD,IAAM,aAAa,GAAG,4BAA4B,CAAC,UAAU,CAAC,CAAC;IAC/D,IAAM,SAAS,GAAG,aAAa;QAC7B,CAAC,CAAC,aAAa,CAAC,aAAa,EAAE,IAAI,EAAE,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AAQ,CAAC,WAAW,EACvB,iBAAiB,EACjB,IAAI,CAAC,aAAa,EAAE,CACrB,CACJ,CAAC;AACJ,CAAC;AAED,mEAAmE;AACnE,SAAS,oBAAoB,CAAC,IAAa;IACzC,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAM,SAAS,GAAG,mBAAmB,CACnC,IAAI,CAAC,aAAa,EAAE,EACpB,wBAAwB,EACxB,eAAe,CAChB,CAAC;IAEF,OAAO,CACL,CAAC,CAAC,SAAS;QACX,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC;QAChC,IAAI,CAAC,UAAU,CAAC,IAAI,KAAK,SAAS,CACnC,CAAC;AACJ,CAAC","sourcesContent":["// copied from https://github.com/angular/angular-cli/blob/17.3.x/packages/schematics/angular/private/standalone.ts\nimport {\n SchematicsException,\n Tree,\n UpdateRecorder,\n} from '@angular-devkit/schematics';\nimport { dirname, join } from 'path';\nimport { insertImport } from './ast-utils';\nimport { InsertChange } from './change';\nimport * as ts from 'typescript';\n\n/** App config that was resolved to its source node. */\ninterface ResolvedAppConfig {\n /** Tree-relative path of the file containing the app config. */\n filePath: string;\n\n /** Node defining the app config. */\n node: ts.ObjectLiteralExpression;\n}\n\n/**\n * Checks whether a providers function is being called in a `bootstrapApplication` call.\n * @param tree File tree of the project.\n * @param filePath Path of the file in which to check.\n * @param functionName Name of the function to search for.\n * @deprecated Private utility that will be removed. Use `addRootImport` or `addRootProvider` from\n * `@schematics/angular/utility` instead.\n */\nexport function callsProvidersFunction(\n tree: Tree,\n filePath: string,\n functionName: string\n): boolean {\n const sourceFile = createSourceFile(tree, filePath);\n const bootstrapCall = findBootstrapApplicationCall(sourceFile);\n const appConfig = bootstrapCall\n ? findAppConfig(bootstrapCall, tree, filePath)\n : null;\n const providersLiteral = appConfig\n ? findProvidersLiteral(appConfig.node)\n : null;\n\n return !!providersLiteral?.elements.some(\n (el) =>\n ts.isCallExpression(el) &&\n ts.isIdentifier(el.expression) &&\n el.expression.text === functionName\n );\n}\n\n/**\n * Adds a providers function call to the `bootstrapApplication` call.\n * @param tree File tree of the project.\n * @param filePath Path to the file that should be updated.\n * @param functionName Name of the function that should be called.\n * @param importPath Path from which to import the function.\n * @param args Arguments to use when calling the function.\n * @return The file path that the provider was added to.\n * @deprecated Private utility that will be removed. Use `addRootImport` or `addRootProvider` from\n * `@schematics/angular/utility` instead.\n */\nexport function addFunctionalProvidersToStandaloneBootstrap(\n tree: Tree,\n filePath: string,\n functionName: string,\n importPath: string,\n args: ts.Expression[] = []\n): string {\n const sourceFile = createSourceFile(tree, filePath);\n const bootstrapCall = findBootstrapApplicationCall(sourceFile);\n const addImports = (file: ts.SourceFile, recorder: UpdateRecorder) => {\n const change = insertImport(file, file.getText(), functionName, importPath);\n\n if (change instanceof InsertChange) {\n recorder.insertLeft(change.pos, change.toAdd);\n }\n };\n\n if (!bootstrapCall) {\n throw new SchematicsException(\n `Could not find bootstrapApplication call in ${filePath}`\n );\n }\n\n const providersCall = ts.factory.createCallExpression(\n ts.factory.createIdentifier(functionName),\n undefined,\n args\n );\n\n // If there's only one argument, we have to create a new object literal.\n if (bootstrapCall.arguments.length === 1) {\n const recorder = tree.beginUpdate(filePath);\n addNewAppConfigToCall(bootstrapCall, providersCall, recorder);\n addImports(sourceFile, recorder);\n tree.commitUpdate(recorder);\n\n return filePath;\n }\n\n // If the config is a `mergeApplicationProviders` call, add another config to it.\n if (isMergeAppConfigCall(bootstrapCall.arguments[1])) {\n const recorder = tree.beginUpdate(filePath);\n addNewAppConfigToCall(bootstrapCall.arguments[1], providersCall, recorder);\n addImports(sourceFile, recorder);\n tree.commitUpdate(recorder);\n\n return filePath;\n }\n\n // Otherwise attempt to merge into the current config.\n const appConfig = findAppConfig(bootstrapCall, tree, filePath);\n\n if (!appConfig) {\n throw new SchematicsException(\n `Could not statically analyze config in bootstrapApplication call in ${filePath}`\n );\n }\n\n const { filePath: configFilePath, node: config } = appConfig;\n const recorder = tree.beginUpdate(configFilePath);\n const providersLiteral = findProvidersLiteral(config);\n\n addImports(config.getSourceFile(), recorder);\n\n if (providersLiteral) {\n // If there's a `providers` array, add the import to it.\n addElementToArray(providersLiteral, providersCall, recorder);\n } else {\n // Otherwise add a `providers` array to the existing object literal.\n addProvidersToObjectLiteral(config, providersCall, recorder);\n }\n\n tree.commitUpdate(recorder);\n\n return configFilePath;\n}\n\n/**\n * Finds the call to `bootstrapApplication` within a file.\n * @deprecated Private utility that will be removed. Use `addRootImport` or `addRootProvider` from\n * `@schematics/angular/utility` instead.\n */\nexport function findBootstrapApplicationCall(\n sourceFile: ts.SourceFile\n): ts.CallExpression | null {\n const localName = findImportLocalName(\n sourceFile,\n 'bootstrapApplication',\n '@angular/platform-browser'\n );\n\n if (!localName) {\n return null;\n }\n\n let result: ts.CallExpression | null = null;\n\n sourceFile.forEachChild(function walk(node) {\n if (\n ts.isCallExpression(node) &&\n ts.isIdentifier(node.expression) &&\n node.expression.text === localName\n ) {\n result = node;\n }\n\n if (!result) {\n node.forEachChild(walk);\n }\n });\n\n return result;\n}\n\n/** Finds the `providers` array literal within an application config. */\nfunction findProvidersLiteral(\n config: ts.ObjectLiteralExpression\n): ts.ArrayLiteralExpression | null {\n for (const prop of config.properties) {\n if (\n ts.isPropertyAssignment(prop) &&\n ts.isIdentifier(prop.name) &&\n prop.name.text === 'providers' &&\n ts.isArrayLiteralExpression(prop.initializer)\n ) {\n return prop.initializer;\n }\n }\n\n return null;\n}\n\n/**\n * Resolves the node that defines the app config from a bootstrap call.\n * @param bootstrapCall Call for which to resolve the config.\n * @param tree File tree of the project.\n * @param filePath File path of the bootstrap call.\n */\nfunction findAppConfig(\n bootstrapCall: ts.CallExpression,\n tree: Tree,\n filePath: string\n): ResolvedAppConfig | null {\n if (bootstrapCall.arguments.length > 1) {\n const config = bootstrapCall.arguments[1];\n\n if (ts.isObjectLiteralExpression(config)) {\n return { filePath, node: config };\n }\n\n if (ts.isIdentifier(config)) {\n return resolveAppConfigFromIdentifier(config, tree, filePath);\n }\n }\n\n return null;\n}\n\n/**\n * Resolves the app config from an identifier referring to it.\n * @param identifier Identifier referring to the app config.\n * @param tree File tree of the project.\n * @param bootstapFilePath Path of the bootstrap call.\n */\nfunction resolveAppConfigFromIdentifier(\n identifier: ts.Identifier,\n tree: Tree,\n bootstapFilePath: string\n): ResolvedAppConfig | null {\n const sourceFile = identifier.getSourceFile();\n\n for (const node of sourceFile.statements) {\n // Only look at relative imports. This will break if the app uses a path\n // mapping to refer to the import, but in order to resolve those, we would\n // need knowledge about the entire program.\n if (\n !ts.isImportDeclaration(node) ||\n !node.importClause?.namedBindings ||\n !ts.isNamedImports(node.importClause.namedBindings) ||\n !ts.isStringLiteralLike(node.moduleSpecifier) ||\n !node.moduleSpecifier.text.startsWith('.')\n ) {\n continue;\n }\n\n for (const specifier of node.importClause.namedBindings.elements) {\n if (specifier.name.text !== identifier.text) {\n continue;\n }\n\n // Look for a variable with the imported name in the file. Note that ideally we would use\n // the type checker to resolve this, but we can't because these utilities are set up to\n // operate on individual files, not the entire program.\n const filePath = join(\n dirname(bootstapFilePath),\n node.moduleSpecifier.text + '.ts'\n );\n const importedSourceFile = createSourceFile(tree, filePath);\n const resolvedVariable = findAppConfigFromVariableName(\n importedSourceFile,\n (specifier.propertyName || specifier.name).text\n );\n\n if (resolvedVariable) {\n return { filePath, node: resolvedVariable };\n }\n }\n }\n\n const variableInSameFile = findAppConfigFromVariableName(\n sourceFile,\n identifier.text\n );\n\n return variableInSameFile\n ? { filePath: bootstapFilePath, node: variableInSameFile }\n : null;\n}\n\n/**\n * Finds an app config within the top-level variables of a file.\n * @param sourceFile File in which to search for the config.\n * @param variableName Name of the variable containing the config.\n */\nfunction findAppConfigFromVariableName(\n sourceFile: ts.SourceFile,\n variableName: string\n): ts.ObjectLiteralExpression | null {\n for (const node of sourceFile.statements) {\n if (ts.isVariableStatement(node)) {\n for (const decl of node.declarationList.declarations) {\n if (\n ts.isIdentifier(decl.name) &&\n decl.name.text === variableName &&\n decl.initializer &&\n ts.isObjectLiteralExpression(decl.initializer)\n ) {\n return decl.initializer;\n }\n }\n }\n }\n\n return null;\n}\n\n/**\n * Finds the local name of an imported symbol. Could be the symbol name itself or its alias.\n * @param sourceFile File within which to search for the import.\n * @param name Actual name of the import, not its local alias.\n * @param moduleName Name of the module from which the symbol is imported.\n */\nfunction findImportLocalName(\n sourceFile: ts.SourceFile,\n name: string,\n moduleName: string\n): string | null {\n for (const node of sourceFile.statements) {\n // Only look for top-level imports.\n if (\n !ts.isImportDeclaration(node) ||\n !ts.isStringLiteral(node.moduleSpecifier) ||\n node.moduleSpecifier.text !== moduleName\n ) {\n continue;\n }\n\n // Filter out imports that don't have the right shape.\n if (\n !node.importClause ||\n !node.importClause.namedBindings ||\n !ts.isNamedImports(node.importClause.namedBindings)\n ) {\n continue;\n }\n\n // Look through the elements of the declaration for the specific import.\n for (const element of node.importClause.namedBindings.elements) {\n if ((element.propertyName || element.name).text === name) {\n // The local name is always in `name`.\n return element.name.text;\n }\n }\n }\n\n return null;\n}\n\n/** Creates a source file from a file path within a project. */\nfunction createSourceFile(tree: Tree, filePath: string): ts.SourceFile {\n return ts.createSourceFile(\n filePath,\n tree.readText(filePath),\n ts.ScriptTarget.Latest,\n true\n );\n}\n\n/**\n * Creates a new app config object literal and adds it to a call expression as an argument.\n * @param call Call to which to add the config.\n * @param expression Expression that should inserted into the new config.\n * @param recorder Recorder to which to log the change.\n */\nfunction addNewAppConfigToCall(\n call: ts.CallExpression,\n expression: ts.Expression,\n recorder: UpdateRecorder\n): void {\n const newCall = ts.factory.updateCallExpression(\n call,\n call.expression,\n call.typeArguments,\n [\n ...call.arguments,\n ts.factory.createObjectLiteralExpression(\n [\n ts.factory.createPropertyAssignment(\n 'providers',\n ts.factory.createArrayLiteralExpression([expression])\n ),\n ],\n true\n ),\n ]\n );\n\n recorder.remove(call.getStart(), call.getWidth());\n recorder.insertRight(\n call.getStart(),\n ts\n .createPrinter()\n .printNode(ts.EmitHint.Unspecified, newCall, call.getSourceFile())\n );\n}\n\n/**\n * Adds an element to an array literal expression.\n * @param node Array to which to add the element.\n * @param element Element to be added.\n * @param recorder Recorder to which to log the change.\n */\nfunction addElementToArray(\n node: ts.ArrayLiteralExpression,\n element: ts.Expression,\n recorder: UpdateRecorder\n): void {\n const newLiteral = ts.factory.updateArrayLiteralExpression(node, [\n ...node.elements,\n element,\n ]);\n recorder.remove(node.getStart(), node.getWidth());\n recorder.insertRight(\n node.getStart(),\n ts\n .createPrinter()\n .printNode(ts.EmitHint.Unspecified, newLiteral, node.getSourceFile())\n );\n}\n\n/**\n * Adds a `providers` property to an object literal.\n * @param node Literal to which to add the `providers`.\n * @param expression Provider that should be part of the generated `providers` array.\n * @param recorder Recorder to which to log the change.\n */\nfunction addProvidersToObjectLiteral(\n node: ts.ObjectLiteralExpression,\n expression: ts.Expression,\n recorder: UpdateRecorder\n) {\n const newOptionsLiteral = ts.factory.updateObjectLiteralExpression(node, [\n ...node.properties,\n ts.factory.createPropertyAssignment(\n 'providers',\n ts.factory.createArrayLiteralExpression([expression])\n ),\n ]);\n recorder.remove(node.getStart(), node.getWidth());\n recorder.insertRight(\n node.getStart(),\n ts\n .createPrinter()\n .printNode(\n ts.EmitHint.Unspecified,\n newOptionsLiteral,\n node.getSourceFile()\n )\n );\n}\n\n/** Checks whether a node is a call to `mergeApplicationConfig`. */\nfunction isMergeAppConfigCall(node: ts.Node): node is ts.CallExpression {\n if (!ts.isCallExpression(node)) {\n return false;\n }\n\n const localName = findImportLocalName(\n node.getSourceFile(),\n 'mergeApplicationConfig',\n '@angular/core'\n );\n\n return (\n !!localName &&\n ts.isIdentifier(node.expression) &&\n node.expression.text === localName\n );\n}\n"]}
1
+ {"version":3,"file":"standalone.js","sourceRoot":"","sources":["../../../../../modules/data/schematics-core/utility/standalone.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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aAAa,EAAE,CAAC,CACxE,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAS,2BAA2B,CAClC,IAAgC,EAChC,UAAyB,EACzB,QAAwB;IAExB,IAAM,iBAAiB,GAAG,EAAE,CAAC,OAAO,CAAC,6BAA6B,CAAC,IAAI,yCAClE,IAAI,CAAC,UAAU;QAClB,EAAE,CAAC,OAAO,CAAC,wBAAwB,CACjC,WAAW,EACX,EAAE,CAAC,OAAO,CAAC,4BAA4B,CAAC,CAAC,UAAU,CAAC,CAAC,CACtD;cACD,CAAC;IACH,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IAClD,QAAQ,CAAC,WAAW,CAClB,IAAI,CAAC,QAAQ,EAAE,EACf,EAAE;SACC,aAAa,EAAE;SACf,SAAS,CACR,EAAE,CAAC,QAAQ,CAAC,WAAW,EACvB,iBAAiB,EACjB,IAAI,CAAC,aAAa,EAAE,CACrB,CACJ,CAAC;AACJ,CAAC;AAED,mEAAmE;AACnE,SAAS,oBAAoB,CAAC,IAAa;IACzC,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAM,SAAS,GAAG,mBAAmB,CACnC,IAAI,CAAC,aAAa,EAAE,EACpB,wBAAwB,EACxB,eAAe,CAChB,CAAC;IAEF,OAAO,CACL,CAAC,CAAC,SAAS;QACX,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC;QAChC,IAAI,CAAC,UAAU,CAAC,IAAI,KAAK,SAAS,CACnC,CAAC;AACJ,CAAC","sourcesContent":["// copied from https://github.com/angular/angular-cli/blob/17.3.x/packages/schematics/angular/private/standalone.ts\nimport {\n SchematicsException,\n Tree,\n UpdateRecorder,\n} from '@angular-devkit/schematics';\nimport { dirname, join } from 'path';\nimport { insertImport } from './ast-utils';\nimport { InsertChange } from './change';\nimport * as ts from 'typescript';\n\n/** App config that was resolved to its source node. */\ninterface ResolvedAppConfig {\n /** Tree-relative path of the file containing the app config. */\n filePath: string;\n\n /** Node defining the app config. */\n node: ts.ObjectLiteralExpression;\n}\n\n/**\n * Checks whether a providers function is being called in a `bootstrapApplication` call.\n * @param tree File tree of the project.\n * @param filePath Path of the file in which to check.\n * @param functionName Name of the function to search for.\n * @deprecated Private utility that will be removed. Use `addRootImport` or `addRootProvider` from\n * `@schematics/angular/utility` instead.\n */\nexport function callsProvidersFunction(\n tree: Tree,\n filePath: string,\n functionName: string\n): boolean {\n const sourceFile = createSourceFile(tree, filePath);\n const bootstrapCall = findBootstrapApplicationCall(sourceFile);\n const appConfig = bootstrapCall\n ? findAppConfig(bootstrapCall, tree, filePath)\n : null;\n const providersLiteral = appConfig\n ? findProvidersLiteral(appConfig.node)\n : null;\n\n return !!providersLiteral?.elements.some(\n (el) =>\n ts.isCallExpression(el) &&\n ts.isIdentifier(el.expression) &&\n el.expression.text === functionName\n );\n}\n\n/**\n * Adds a providers function call to the `bootstrapApplication` call.\n * @param tree File tree of the project.\n * @param filePath Path to the file that should be updated.\n * @param functionName Name of the function that should be called.\n * @param importPath Path from which to import the function.\n * @param args Arguments to use when calling the function.\n * @return The file path that the provider was added to.\n * @deprecated Private utility that will be removed. Use `addRootImport` or `addRootProvider` from\n * `@schematics/angular/utility` instead.\n */\nexport function addFunctionalProvidersToStandaloneBootstrap(\n tree: Tree,\n filePath: string,\n functionName: string,\n importPath: string,\n args: ts.Expression[] = []\n): string {\n const sourceFile = createSourceFile(tree, filePath);\n const bootstrapCall = findBootstrapApplicationCall(sourceFile);\n const addImports = (file: ts.SourceFile, recorder: UpdateRecorder) => {\n const change = insertImport(file, file.getText(), functionName, importPath);\n\n if (change instanceof InsertChange) {\n recorder.insertLeft(change.pos, change.toAdd);\n }\n };\n\n if (!bootstrapCall) {\n throw new SchematicsException(\n `Could not find bootstrapApplication call in ${filePath}`\n );\n }\n\n const providersCall = ts.factory.createCallExpression(\n ts.factory.createIdentifier(functionName),\n undefined,\n args\n );\n\n // If there's only one argument, we have to create a new object literal.\n if (bootstrapCall.arguments.length === 1) {\n const recorder = tree.beginUpdate(filePath);\n addNewAppConfigToCall(bootstrapCall, providersCall, recorder);\n addImports(sourceFile, recorder);\n tree.commitUpdate(recorder);\n\n return filePath;\n }\n\n // If the config is a `mergeApplicationProviders` call, add another config to it.\n if (isMergeAppConfigCall(bootstrapCall.arguments[1])) {\n const recorder = tree.beginUpdate(filePath);\n addNewAppConfigToCall(bootstrapCall.arguments[1], providersCall, recorder);\n addImports(sourceFile, recorder);\n tree.commitUpdate(recorder);\n\n return filePath;\n }\n\n // Otherwise attempt to merge into the current config.\n const appConfig = findAppConfig(bootstrapCall, tree, filePath);\n\n if (!appConfig) {\n throw new SchematicsException(\n `Could not statically analyze config in bootstrapApplication call in ${filePath}`\n );\n }\n\n const { filePath: configFilePath, node: config } = appConfig;\n const recorder = tree.beginUpdate(configFilePath);\n const providersLiteral = findProvidersLiteral(config);\n\n addImports(config.getSourceFile(), recorder);\n\n if (providersLiteral) {\n // If there's a `providers` array, add the import to it.\n addElementToArray(providersLiteral, providersCall, recorder);\n } else {\n // Otherwise add a `providers` array to the existing object literal.\n addProvidersToObjectLiteral(config, providersCall, recorder);\n }\n\n tree.commitUpdate(recorder);\n\n return configFilePath;\n}\n\n/**\n * Finds the call to `bootstrapApplication` within a file.\n * @deprecated Private utility that will be removed. Use `addRootImport` or `addRootProvider` from\n * `@schematics/angular/utility` instead.\n */\nexport function findBootstrapApplicationCall(\n sourceFile: ts.SourceFile\n): ts.CallExpression | null {\n const localName = findImportLocalName(\n sourceFile,\n 'bootstrapApplication',\n '@angular/platform-browser'\n );\n\n if (!localName) {\n return null;\n }\n\n let result: ts.CallExpression | null = null;\n\n sourceFile.forEachChild(function walk(node) {\n if (\n ts.isCallExpression(node) &&\n ts.isIdentifier(node.expression) &&\n node.expression.text === localName\n ) {\n result = node;\n }\n\n if (!result) {\n node.forEachChild(walk);\n }\n });\n\n return result;\n}\n\n/** Finds the `providers` array literal within an application config. */\nfunction findProvidersLiteral(\n config: ts.ObjectLiteralExpression\n): ts.ArrayLiteralExpression | null {\n for (const prop of config.properties) {\n if (\n ts.isPropertyAssignment(prop) &&\n ts.isIdentifier(prop.name) &&\n prop.name.text === 'providers' &&\n ts.isArrayLiteralExpression(prop.initializer)\n ) {\n return prop.initializer;\n }\n }\n\n return null;\n}\n\n/**\n * Resolves the node that defines the app config from a bootstrap call.\n * @param bootstrapCall Call for which to resolve the config.\n * @param tree File tree of the project.\n * @param filePath File path of the bootstrap call.\n */\nfunction findAppConfig(\n bootstrapCall: ts.CallExpression,\n tree: Tree,\n filePath: string\n): ResolvedAppConfig | null {\n if (bootstrapCall.arguments.length > 1) {\n const config = bootstrapCall.arguments[1];\n\n if (ts.isObjectLiteralExpression(config)) {\n return { filePath, node: config };\n }\n\n if (ts.isIdentifier(config)) {\n return resolveAppConfigFromIdentifier(config, tree, filePath);\n }\n }\n\n return null;\n}\n\n/**\n * Resolves the app config from an identifier referring to it.\n * @param identifier Identifier referring to the app config.\n * @param tree File tree of the project.\n * @param bootstapFilePath Path of the bootstrap call.\n */\nfunction resolveAppConfigFromIdentifier(\n identifier: ts.Identifier,\n tree: Tree,\n bootstapFilePath: string\n): ResolvedAppConfig | null {\n const sourceFile = identifier.getSourceFile();\n\n for (const node of sourceFile.statements) {\n // Only look at relative imports. This will break if the app uses a path\n // mapping to refer to the import, but in order to resolve those, we would\n // need knowledge about the entire program.\n if (\n !ts.isImportDeclaration(node) ||\n !node.importClause?.namedBindings ||\n !ts.isNamedImports(node.importClause.namedBindings) ||\n !ts.isStringLiteralLike(node.moduleSpecifier) ||\n !node.moduleSpecifier.text.startsWith('.')\n ) {\n continue;\n }\n\n for (const specifier of node.importClause.namedBindings.elements) {\n if (specifier.name.text !== identifier.text) {\n continue;\n }\n\n // Look for a variable with the imported name in the file. Note that ideally we would use\n // the type checker to resolve this, but we can't because these utilities are set up to\n // operate on individual files, not the entire program.\n const filePath = join(\n dirname(bootstapFilePath),\n node.moduleSpecifier.text + '.ts'\n );\n const importedSourceFile = createSourceFile(tree, filePath);\n const resolvedVariable = findAppConfigFromVariableName(\n importedSourceFile,\n (specifier.propertyName || specifier.name).text\n );\n\n if (resolvedVariable) {\n return { filePath, node: resolvedVariable };\n }\n }\n }\n\n const variableInSameFile = findAppConfigFromVariableName(\n sourceFile,\n identifier.text\n );\n\n return variableInSameFile\n ? { filePath: bootstapFilePath, node: variableInSameFile }\n : null;\n}\n\n/**\n * Finds an app config within the top-level variables of a file.\n * @param sourceFile File in which to search for the config.\n * @param variableName Name of the variable containing the config.\n */\nfunction findAppConfigFromVariableName(\n sourceFile: ts.SourceFile,\n variableName: string\n): ts.ObjectLiteralExpression | null {\n for (const node of sourceFile.statements) {\n if (ts.isVariableStatement(node)) {\n for (const decl of node.declarationList.declarations) {\n if (\n ts.isIdentifier(decl.name) &&\n decl.name.text === variableName &&\n decl.initializer &&\n ts.isObjectLiteralExpression(decl.initializer)\n ) {\n return decl.initializer;\n }\n }\n }\n }\n\n return null;\n}\n\n/**\n * Finds the local name of an imported symbol. Could be the symbol name itself or its alias.\n * @param sourceFile File within which to search for the import.\n * @param name Actual name of the import, not its local alias.\n * @param moduleName Name of the module from which the symbol is imported.\n */\nfunction findImportLocalName(\n sourceFile: ts.SourceFile,\n name: string,\n moduleName: string\n): string | null {\n for (const node of sourceFile.statements) {\n // Only look for top-level imports.\n if (\n !ts.isImportDeclaration(node) ||\n !ts.isStringLiteral(node.moduleSpecifier) ||\n node.moduleSpecifier.text !== moduleName\n ) {\n continue;\n }\n\n // Filter out imports that don't have the right shape.\n if (\n !node.importClause ||\n !node.importClause.namedBindings ||\n !ts.isNamedImports(node.importClause.namedBindings)\n ) {\n continue;\n }\n\n // Look through the elements of the declaration for the specific import.\n for (const element of node.importClause.namedBindings.elements) {\n if ((element.propertyName || element.name).text === name) {\n // The local name is always in `name`.\n return element.name.text;\n }\n }\n }\n\n return null;\n}\n\n/** Creates a source file from a file path within a project. */\nfunction createSourceFile(tree: Tree, filePath: string): ts.SourceFile {\n return ts.createSourceFile(\n filePath,\n tree.readText(filePath),\n ts.ScriptTarget.Latest,\n true\n );\n}\n\n/**\n * Creates a new app config object literal and adds it to a call expression as an argument.\n * @param call Call to which to add the config.\n * @param expression Expression that should inserted into the new config.\n * @param recorder Recorder to which to log the change.\n */\nfunction addNewAppConfigToCall(\n call: ts.CallExpression,\n expression: ts.Expression,\n recorder: UpdateRecorder\n): void {\n const newCall = ts.factory.updateCallExpression(\n call,\n call.expression,\n call.typeArguments,\n [\n ...call.arguments,\n ts.factory.createObjectLiteralExpression(\n [\n ts.factory.createPropertyAssignment(\n 'providers',\n ts.factory.createArrayLiteralExpression([expression])\n ),\n ],\n true\n ),\n ]\n );\n\n recorder.remove(call.getStart(), call.getWidth());\n recorder.insertRight(\n call.getStart(),\n ts\n .createPrinter()\n .printNode(ts.EmitHint.Unspecified, newCall, call.getSourceFile())\n );\n}\n\n/**\n * Adds an element to an array literal expression.\n * @param node Array to which to add the element.\n * @param element Element to be added.\n * @param recorder Recorder to which to log the change.\n */\nfunction addElementToArray(\n node: ts.ArrayLiteralExpression,\n element: ts.Expression,\n recorder: UpdateRecorder\n): void {\n const newLiteral = ts.factory.updateArrayLiteralExpression(node, [\n ...node.elements,\n element,\n ]);\n recorder.remove(node.getStart(), node.getWidth());\n recorder.insertRight(\n node.getStart(),\n ts\n .createPrinter()\n .printNode(ts.EmitHint.Unspecified, newLiteral, node.getSourceFile())\n );\n}\n\n/**\n * Adds a `providers` property to an object literal.\n * @param node Literal to which to add the `providers`.\n * @param expression Provider that should be part of the generated `providers` array.\n * @param recorder Recorder to which to log the change.\n */\nfunction addProvidersToObjectLiteral(\n node: ts.ObjectLiteralExpression,\n expression: ts.Expression,\n recorder: UpdateRecorder\n) {\n const newOptionsLiteral = ts.factory.updateObjectLiteralExpression(node, [\n ...node.properties,\n ts.factory.createPropertyAssignment(\n 'providers',\n ts.factory.createArrayLiteralExpression([expression])\n ),\n ]);\n recorder.remove(node.getStart(), node.getWidth());\n recorder.insertRight(\n node.getStart(),\n ts\n .createPrinter()\n .printNode(\n ts.EmitHint.Unspecified,\n newOptionsLiteral,\n node.getSourceFile()\n )\n );\n}\n\n/** Checks whether a node is a call to `mergeApplicationConfig`. */\nfunction isMergeAppConfigCall(node: ts.Node): node is ts.CallExpression {\n if (!ts.isCallExpression(node)) {\n return false;\n }\n\n const localName = findImportLocalName(\n node.getSourceFile(),\n 'mergeApplicationConfig',\n '@angular/core'\n );\n\n return (\n !!localName &&\n ts.isIdentifier(node.expression) &&\n node.expression.text === localName\n );\n}\n"]}
@@ -1,14 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.decamelize = decamelize;
4
- exports.dasherize = dasherize;
5
- exports.camelize = camelize;
6
- exports.classify = classify;
7
- exports.underscore = underscore;
8
- exports.capitalize = capitalize;
9
- exports.pluralize = pluralize;
10
- exports.group = group;
11
- exports.featurePath = featurePath;
12
1
  /**
13
2
  * @license
14
3
  * Copyright Google Inc. All Rights Reserved.
@@ -31,7 +20,7 @@ var STRING_UNDERSCORE_REGEXP_2 = /-|\s+/g;
31
20
  decamelize('my favorite items'); // 'my favorite items'
32
21
  ```
33
22
  */
34
- function decamelize(str) {
23
+ export function decamelize(str) {
35
24
  return str.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase();
36
25
  }
37
26
  /**
@@ -44,7 +33,7 @@ function decamelize(str) {
44
33
  dasherize('my favorite items'); // 'my-favorite-items'
45
34
  ```
46
35
  */
47
- function dasherize(str) {
36
+ export function dasherize(str) {
48
37
  return decamelize(str || '').replace(STRING_DASHERIZE_REGEXP, '-');
49
38
  }
50
39
  /**
@@ -58,7 +47,7 @@ function dasherize(str) {
58
47
  camelize('My Favorite Items'); // 'myFavoriteItems'
59
48
  ```
60
49
  */
61
- function camelize(str) {
50
+ export function camelize(str) {
62
51
  return str
63
52
  .replace(STRING_CAMELIZE_REGEXP, function (_match, _separator, chr) {
64
53
  return chr ? chr.toUpperCase() : '';
@@ -75,7 +64,7 @@ function camelize(str) {
75
64
  'my favorite items'.classify(); // 'MyFavoriteItems'
76
65
  ```
77
66
  */
78
- function classify(str) {
67
+ export function classify(str) {
79
68
  return str
80
69
  .split('.')
81
70
  .map(function (part) { return capitalize(camelize(part)); })
@@ -92,7 +81,7 @@ function classify(str) {
92
81
  'my favorite items'.underscore(); // 'my_favorite_items'
93
82
  ```
94
83
  */
95
- function underscore(str) {
84
+ export function underscore(str) {
96
85
  return str
97
86
  .replace(STRING_UNDERSCORE_REGEXP_1, '$1_$2')
98
87
  .replace(STRING_UNDERSCORE_REGEXP_2, '_')
@@ -108,7 +97,7 @@ function underscore(str) {
108
97
  'my favorite items'.capitalize() // 'My favorite items'
109
98
  ```
110
99
  */
111
- function capitalize(str) {
100
+ export function capitalize(str) {
112
101
  return str.charAt(0).toUpperCase() + str.substring(1);
113
102
  }
114
103
  /**
@@ -122,13 +111,13 @@ function capitalize(str) {
122
111
  'user'.pluralize() // 'users'
123
112
  ```
124
113
  */
125
- function pluralize(str) {
114
+ export function pluralize(str) {
126
115
  return camelize([/([^aeiou])y$/, /()fe?$/, /([^aeiou]o|[sxz]|[cs]h)$/].map(function (c, i) { return (str = str.replace(c, "$1".concat('iv'[i] || '', "e"))); }) && str + 's');
127
116
  }
128
- function group(name, group) {
117
+ export function group(name, group) {
129
118
  return group ? "".concat(group, "/").concat(name) : name;
130
119
  }
131
- function featurePath(group, flat, path, name) {
120
+ export function featurePath(group, flat, path, name) {
132
121
  if (group && !flat) {
133
122
  return "../../".concat(path, "/").concat(name, "/");
134
123
  }
@@ -1 +1 @@
1
- {"version":3,"file":"strings.js","sourceRoot":"","sources":["../../../../../modules/data/schematics-core/utility/strings.ts"],"names":[],"mappings":";;AAuBA,gCAEC;AAYD,8BAEC;AAaD,4BASC;AAYD,4BAKC;AAaD,gCAKC;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AAC,GAAW;IACpC,OAAO,GAAG;SACP,OAAO,CAAC,0BAA0B,EAAE,OAAO,CAAC;SAC5C,OAAO,CAAC,0BAA0B,EAAE,GAAG,CAAC;SACxC,WAAW,EAAE,CAAC;AACnB,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,UAAU,CAAC,GAAW;IACpC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AACxD,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,SAAS,CAAC,GAAW;IACnC,OAAO,QAAQ,CACb,CAAC,cAAc,EAAE,QAAQ,EAAE,0BAA0B,CAAC,CAAC,GAAG,CACxD,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,CAAC,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,YAAK,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,MAAG,CAAC,CAAC,EAA7C,CAA6C,CACxD,IAAI,GAAG,GAAG,GAAG,CACf,CAAC;AACJ,CAAC;AAED,SAAgB,KAAK,CAAC,IAAY,EAAE,KAAyB;IAC3D,OAAO,KAAK,CAAC,CAAC,CAAC,UAAG,KAAK,cAAI,IAAI,CAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC3C,CAAC;AAED,SAAgB,WAAW,CACzB,KAA0B,EAC1B,IAAyB,EACzB,IAAY,EACZ,IAAY;IAEZ,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;QACnB,OAAO,gBAAS,IAAI,cAAI,IAAI,MAAG,CAAC;IAClC,CAAC;IAED,OAAO,KAAK,CAAC,CAAC,CAAC,aAAM,IAAI,MAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AACtC,CAAC","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nconst STRING_DASHERIZE_REGEXP = /[ _]/g;\nconst STRING_DECAMELIZE_REGEXP = /([a-z\\d])([A-Z])/g;\nconst STRING_CAMELIZE_REGEXP = /(-|_|\\.|\\s)+(.)?/g;\nconst STRING_UNDERSCORE_REGEXP_1 = /([a-z\\d])([A-Z]+)/g;\nconst STRING_UNDERSCORE_REGEXP_2 = /-|\\s+/g;\n\n/**\n * Converts a camelized string into all lower case separated by underscores.\n *\n ```javascript\n decamelize('innerHTML'); // 'inner_html'\n decamelize('action_name'); // 'action_name'\n decamelize('css-class-name'); // 'css-class-name'\n decamelize('my favorite items'); // 'my favorite items'\n ```\n */\nexport function decamelize(str: string): string {\n return str.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase();\n}\n\n/**\n Replaces underscores, spaces, or camelCase with dashes.\n\n ```javascript\n dasherize('innerHTML'); // 'inner-html'\n dasherize('action_name'); // 'action-name'\n dasherize('css-class-name'); // 'css-class-name'\n dasherize('my favorite items'); // 'my-favorite-items'\n ```\n */\nexport function dasherize(str?: string): string {\n return decamelize(str || '').replace(STRING_DASHERIZE_REGEXP, '-');\n}\n\n/**\n Returns the lowerCamelCase form of a string.\n\n ```javascript\n camelize('innerHTML'); // 'innerHTML'\n camelize('action_name'); // 'actionName'\n camelize('css-class-name'); // 'cssClassName'\n camelize('my favorite items'); // 'myFavoriteItems'\n camelize('My Favorite Items'); // 'myFavoriteItems'\n ```\n */\nexport function camelize(str: string): string {\n return str\n .replace(\n STRING_CAMELIZE_REGEXP,\n (_match: string, _separator: string, chr: string) => {\n return chr ? chr.toUpperCase() : '';\n }\n )\n .replace(/^([A-Z])/, (match: string) => match.toLowerCase());\n}\n\n/**\n Returns the UpperCamelCase form of a string.\n\n ```javascript\n 'innerHTML'.classify(); // 'InnerHTML'\n 'action_name'.classify(); // 'ActionName'\n 'css-class-name'.classify(); // 'CssClassName'\n 'my favorite items'.classify(); // 'MyFavoriteItems'\n ```\n */\nexport function classify(str: string): string {\n return str\n .split('.')\n .map((part) => capitalize(camelize(part)))\n .join('.');\n}\n\n/**\n More general than decamelize. Returns the lower\\_case\\_and\\_underscored\n form of a string.\n\n ```javascript\n 'innerHTML'.underscore(); // 'inner_html'\n 'action_name'.underscore(); // 'action_name'\n 'css-class-name'.underscore(); // 'css_class_name'\n 'my favorite items'.underscore(); // 'my_favorite_items'\n ```\n */\nexport function underscore(str: string): string {\n return str\n .replace(STRING_UNDERSCORE_REGEXP_1, '$1_$2')\n .replace(STRING_UNDERSCORE_REGEXP_2, '_')\n .toLowerCase();\n}\n\n/**\n Returns the Capitalized form of a string\n\n ```javascript\n 'innerHTML'.capitalize() // 'InnerHTML'\n 'action_name'.capitalize() // 'Action_name'\n 'css-class-name'.capitalize() // 'Css-class-name'\n 'my favorite items'.capitalize() // 'My favorite items'\n ```\n */\nexport function capitalize(str: string): string {\n return str.charAt(0).toUpperCase() + str.substring(1);\n}\n\n/**\n Returns the plural form of a string\n\n ```javascript\n 'innerHTML'.pluralize() // 'innerHTMLs'\n 'action_name'.pluralize() // 'actionNames'\n 'css-class-name'.pluralize() // 'cssClassNames'\n 'regex'.pluralize() // 'regexes'\n 'user'.pluralize() // 'users'\n ```\n */\nexport function pluralize(str: string): string {\n return camelize(\n [/([^aeiou])y$/, /()fe?$/, /([^aeiou]o|[sxz]|[cs]h)$/].map(\n (c, i) => (str = str.replace(c, `$1${'iv'[i] || ''}e`))\n ) && str + 's'\n );\n}\n\nexport function group(name: string, group: string | undefined) {\n return group ? `${group}/${name}` : name;\n}\n\nexport function featurePath(\n group: boolean | undefined,\n flat: boolean | undefined,\n path: string,\n name: string\n) {\n if (group && !flat) {\n return `../../${path}/${name}/`;\n }\n\n return group ? `../${path}/` : './';\n}\n"]}
1
+ {"version":3,"file":"strings.js","sourceRoot":"","sources":["../../../../../modules/data/schematics-core/utility/strings.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,IAAM,uBAAuB,GAAG,OAAO,CAAC;AACxC,IAAM,wBAAwB,GAAG,mBAAmB,C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ACxC,WAAW,EAAE,CAAC;AACnB,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AACxD,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,OAAO,QAAQ,CACb,CAAC,cAAc,EAAE,QAAQ,EAAE,0BAA0B,CAAC,CAAC,GAAG,CACxD,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,CAAC,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,YAAK,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,MAAG,CAAC,CAAC,EAA7C,CAA6C,CACxD,IAAI,GAAG,GAAG,GAAG,CACf,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,IAAY,EAAE,KAAyB;IAC3D,OAAO,KAAK,CAAC,CAAC,CAAC,UAAG,KAAK,cAAI,IAAI,CAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,WAAW,CACzB,KAA0B,EAC1B,IAAyB,EACzB,IAAY,EACZ,IAAY;IAEZ,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;QACnB,OAAO,gBAAS,IAAI,cAAI,IAAI,MAAG,CAAC;IAClC,CAAC;IAED,OAAO,KAAK,CAAC,CAAC,CAAC,aAAM,IAAI,MAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AACtC,CAAC","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nconst STRING_DASHERIZE_REGEXP = /[ _]/g;\nconst STRING_DECAMELIZE_REGEXP = /([a-z\\d])([A-Z])/g;\nconst STRING_CAMELIZE_REGEXP = /(-|_|\\.|\\s)+(.)?/g;\nconst STRING_UNDERSCORE_REGEXP_1 = /([a-z\\d])([A-Z]+)/g;\nconst STRING_UNDERSCORE_REGEXP_2 = /-|\\s+/g;\n\n/**\n * Converts a camelized string into all lower case separated by underscores.\n *\n ```javascript\n decamelize('innerHTML'); // 'inner_html'\n decamelize('action_name'); // 'action_name'\n decamelize('css-class-name'); // 'css-class-name'\n decamelize('my favorite items'); // 'my favorite items'\n ```\n */\nexport function decamelize(str: string): string {\n return str.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase();\n}\n\n/**\n Replaces underscores, spaces, or camelCase with dashes.\n\n ```javascript\n dasherize('innerHTML'); // 'inner-html'\n dasherize('action_name'); // 'action-name'\n dasherize('css-class-name'); // 'css-class-name'\n dasherize('my favorite items'); // 'my-favorite-items'\n ```\n */\nexport function dasherize(str?: string): string {\n return decamelize(str || '').replace(STRING_DASHERIZE_REGEXP, '-');\n}\n\n/**\n Returns the lowerCamelCase form of a string.\n\n ```javascript\n camelize('innerHTML'); // 'innerHTML'\n camelize('action_name'); // 'actionName'\n camelize('css-class-name'); // 'cssClassName'\n camelize('my favorite items'); // 'myFavoriteItems'\n camelize('My Favorite Items'); // 'myFavoriteItems'\n ```\n */\nexport function camelize(str: string): string {\n return str\n .replace(\n STRING_CAMELIZE_REGEXP,\n (_match: string, _separator: string, chr: string) => {\n return chr ? chr.toUpperCase() : '';\n }\n )\n .replace(/^([A-Z])/, (match: string) => match.toLowerCase());\n}\n\n/**\n Returns the UpperCamelCase form of a string.\n\n ```javascript\n 'innerHTML'.classify(); // 'InnerHTML'\n 'action_name'.classify(); // 'ActionName'\n 'css-class-name'.classify(); // 'CssClassName'\n 'my favorite items'.classify(); // 'MyFavoriteItems'\n ```\n */\nexport function classify(str: string): string {\n return str\n .split('.')\n .map((part) => capitalize(camelize(part)))\n .join('.');\n}\n\n/**\n More general than decamelize. Returns the lower\\_case\\_and\\_underscored\n form of a string.\n\n ```javascript\n 'innerHTML'.underscore(); // 'inner_html'\n 'action_name'.underscore(); // 'action_name'\n 'css-class-name'.underscore(); // 'css_class_name'\n 'my favorite items'.underscore(); // 'my_favorite_items'\n ```\n */\nexport function underscore(str: string): string {\n return str\n .replace(STRING_UNDERSCORE_REGEXP_1, '$1_$2')\n .replace(STRING_UNDERSCORE_REGEXP_2, '_')\n .toLowerCase();\n}\n\n/**\n Returns the Capitalized form of a string\n\n ```javascript\n 'innerHTML'.capitalize() // 'InnerHTML'\n 'action_name'.capitalize() // 'Action_name'\n 'css-class-name'.capitalize() // 'Css-class-name'\n 'my favorite items'.capitalize() // 'My favorite items'\n ```\n */\nexport function capitalize(str: string): string {\n return str.charAt(0).toUpperCase() + str.substring(1);\n}\n\n/**\n Returns the plural form of a string\n\n ```javascript\n 'innerHTML'.pluralize() // 'innerHTMLs'\n 'action_name'.pluralize() // 'actionNames'\n 'css-class-name'.pluralize() // 'cssClassNames'\n 'regex'.pluralize() // 'regexes'\n 'user'.pluralize() // 'users'\n ```\n */\nexport function pluralize(str: string): string {\n return camelize(\n [/([^aeiou])y$/, /()fe?$/, /([^aeiou]o|[sxz]|[cs]h)$/].map(\n (c, i) => (str = str.replace(c, `$1${'iv'[i] || ''}e`))\n ) && str + 's'\n );\n}\n\nexport function group(name: string, group: string | undefined) {\n return group ? `${group}/${name}` : name;\n}\n\nexport function featurePath(\n group: boolean | undefined,\n flat: boolean | undefined,\n path: string,\n name: string\n) {\n if (group && !flat) {\n return `../../${path}/${name}/`;\n }\n\n return group ? `../${path}/` : './';\n}\n"]}
@@ -1,18 +1,15 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updatePackage = updatePackage;
4
- var schematics_1 = require("@angular-devkit/schematics");
5
- function updatePackage(name) {
1
+ import { SchematicsException, } from '@angular-devkit/schematics';
2
+ export function updatePackage(name) {
6
3
  return function (tree, context) {
7
4
  var pkgPath = '/package.json';
8
5
  var buffer = tree.read(pkgPath);
9
6
  if (buffer === null) {
10
- throw new schematics_1.SchematicsException('Could not read package.json');
7
+ throw new SchematicsException('Could not read package.json');
11
8
  }
12
9
  var content = buffer.toString();
13
10
  var pkg = JSON.parse(content);
14
11
  if (pkg === null || typeof pkg !== 'object' || Array.isArray(pkg)) {
15
- throw new schematics_1.SchematicsException('Error reading package.json');
12
+ throw new SchematicsException('Error reading package.json');
16
13
  }
17
14
  var dependencyCategories = ['dependencies', 'devDependencies'];
18
15
  dependencyCategories.forEach(function (category) {
@@ -1 +1 @@
1
- {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../../modules/data/schematics-core/utility/update.ts"],"names":[],"mappings":";;AAOA,sCA+BC;AAtCD,yDAKoC;AAEpC,SAAgB,aAAa,CAAC,IAAY;IACxC,OAAO,UAAC,IAAU,EAAE,OAAyB;QAC3C,IAAM,OAAO,GAAG,eAAe,CAAC;QAChC,IAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAClC,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;YACpB,MAAM,IAAI,gCAAmB,CAAC,6BAA6B,CAAC,CAAC;QAC/D,CAAC;QACD,IAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;QAClC,IAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAEhC,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YAClE,MAAM,IAAI,gCAAmB,CAAC,4BAA4B,CAAC,CAAC;QAC9D,CAAC;QAED,IAAM,oBAAoB,GAAG,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC;QAEjE,oBAAoB,CAAC,OAAO,CAAC,UAAC,QAAQ;YACpC,IAAM,WAAW,GAAG,gBAAS,IAAI,CAAE,CAAC;YAEpC,IAAI,GAAG,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC;gBAChD,IAAM,SAAS,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;gBAChD,IAAM,MAAM,GAAG,KAAK,CAAC,SAAS,EAAE,GAAG,CAAC,IAAI,KAAK,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;gBAE9D,GAAG,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,GAAG,UAAG,MAAM,UAAO,CAAC;YAChD,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAEtD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,KAAK,CAAC,KAAa,EAAE,IAAY;IACxC,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AACpC,CAAC","sourcesContent":["import {\n Rule,\n SchematicContext,\n Tree,\n SchematicsException,\n} from '@angular-devkit/schematics';\n\nexport function updatePackage(name: string): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const pkgPath = '/package.json';\n const buffer = tree.read(pkgPath);\n if (buffer === null) {\n throw new SchematicsException('Could not read package.json');\n }\n const content = buffer.toString();\n const pkg = JSON.parse(content);\n\n if (pkg === null || typeof pkg !== 'object' || Array.isArray(pkg)) {\n throw new SchematicsException('Error reading package.json');\n }\n\n const dependencyCategories = ['dependencies', 'devDependencies'];\n\n dependencyCategories.forEach((category) => {\n const packageName = `@ngrx/${name}`;\n\n if (pkg[category] && pkg[category][packageName]) {\n const firstChar = pkg[category][packageName][0];\n const suffix = match(firstChar, '^') || match(firstChar, '~');\n\n pkg[category][packageName] = `${suffix}6.0.0`;\n }\n });\n\n tree.overwrite(pkgPath, JSON.stringify(pkg, null, 2));\n\n return tree;\n };\n}\n\nfunction match(value: string, test: string) {\n return value === test ? test : '';\n}\n"]}
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../../modules/data/schematics-core/utility/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AAEpC,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,UAAC,IAAU,EAAE,OAAyB;QAC3C,IAAM,OAAO,GAAG,eAAe,CAAC;QAChC,IAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAClC,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;YACpB,MAAM,IAAI,mBAAmB,CAAC,6BAA6B,CAAC,CAAC;QAC/D,CAAC;QACD,IAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;QAClC,IAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAEhC,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YAClE,MAAM,IAAI,mBAAmB,CAAC,4BAA4B,CAAC,CAAC;QAC9D,CAAC;QAED,IAAM,oBAAoB,GAAG,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC;QAEjE,oBAAoB,CAAC,OAAO,CAAC,UAAC,QAAQ;YACpC,IAAM,WAAW,GAAG,gBAAS,IAAI,CAAE,CAAC;YAEpC,IAAI,GAAG,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC;gBAChD,IAAM,SAAS,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;gBAChD,IAAM,MAAM,GAAG,KAAK,CAAC,SAAS,EAAE,GAAG,CAAC,IAAI,KAAK,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;gBAE9D,GAAG,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,GAAG,UAAG,MAAM,UAAO,CAAC;YAChD,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAEtD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,KAAK,CAAC,KAAa,EAAE,IAAY;IACxC,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AACpC,CAAC","sourcesContent":["import {\n Rule,\n SchematicContext,\n Tree,\n SchematicsException,\n} from '@angular-devkit/schematics';\n\nexport function updatePackage(name: string): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const pkgPath = '/package.json';\n const buffer = tree.read(pkgPath);\n if (buffer === null) {\n throw new SchematicsException('Could not read package.json');\n }\n const content = buffer.toString();\n const pkg = JSON.parse(content);\n\n if (pkg === null || typeof pkg !== 'object' || Array.isArray(pkg)) {\n throw new SchematicsException('Error reading package.json');\n }\n\n const dependencyCategories = ['dependencies', 'devDependencies'];\n\n dependencyCategories.forEach((category) => {\n const packageName = `@ngrx/${name}`;\n\n if (pkg[category] && pkg[category][packageName]) {\n const firstChar = pkg[category][packageName][0];\n const suffix = match(firstChar, '^') || match(firstChar, '~');\n\n pkg[category][packageName] = `${suffix}6.0.0`;\n }\n });\n\n tree.overwrite(pkgPath, JSON.stringify(pkg, null, 2));\n\n return tree;\n };\n}\n\nfunction match(value: string, test: string) {\n return value === test ? test : '';\n}\n"]}
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __generator = (this && this.__generator) || function (thisArg, body) {
3
2
  var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
4
3
  return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
@@ -53,22 +52,9 @@ var __read = (this && this.__read) || function (o, n) {
53
52
  }
54
53
  return ar;
55
54
  };
56
- Object.defineProperty(exports, "__esModule", { value: true });
57
- exports.visitTSSourceFiles = visitTSSourceFiles;
58
- exports.visitTemplates = visitTemplates;
59
- exports.visitNgModuleImports = visitNgModuleImports;
60
- exports.visitNgModuleExports = visitNgModuleExports;
61
- exports.visitComponents = visitComponents;
62
- exports.visitNgModules = visitNgModules;
63
- exports.visitDecorator = visitDecorator;
64
- exports.visitImportDeclaration = visitImportDeclaration;
65
- exports.visitImportSpecifier = visitImportSpecifier;
66
- exports.visitTypeReference = visitTypeReference;
67
- exports.visitTypeLiteral = visitTypeLiteral;
68
- exports.visitCallExpression = visitCallExpression;
69
- var ts = require("typescript");
70
- var core_1 = require("@angular-devkit/core");
71
- function visitTSSourceFiles(tree, visitor) {
55
+ import * as ts from 'typescript';
56
+ import { normalize, resolve } from '@angular-devkit/core';
57
+ export function visitTSSourceFiles(tree, visitor) {
72
58
  var e_1, _a;
73
59
  var result = undefined;
74
60
  try {
@@ -86,7 +72,7 @@ function visitTSSourceFiles(tree, visitor) {
86
72
  }
87
73
  return result;
88
74
  }
89
- function visitTemplates(tree, visitor) {
75
+ export function visitTemplates(tree, visitor) {
90
76
  visitTSSourceFiles(tree, function (source) {
91
77
  visitComponents(source, function (_, decoratorExpressionNode) {
92
78
  ts.forEachChild(decoratorExpressionNode, function findTemplates(n) {
@@ -106,8 +92,8 @@ function visitTemplates(tree, visitor) {
106
92
  }
107
93
  else if (n.name.text === 'templateUrl' &&
108
94
  ts.isStringLiteralLike(n.initializer)) {
109
- var parts = (0, core_1.normalize)(source.fileName).split('/').slice(0, -1);
110
- var templatePath = (0, core_1.resolve)((0, core_1.normalize)(parts.join('/')), (0, core_1.normalize)(n.initializer.text));
95
+ var parts = normalize(source.fileName).split('/').slice(0, -1);
96
+ var templatePath = resolve(normalize(parts.join('/')), normalize(n.initializer.text));
111
97
  if (!tree.exists(templatePath)) {
112
98
  return;
113
99
  }
@@ -129,10 +115,10 @@ function visitTemplates(tree, visitor) {
129
115
  });
130
116
  });
131
117
  }
132
- function visitNgModuleImports(sourceFile, callback) {
118
+ export function visitNgModuleImports(sourceFile, callback) {
133
119
  visitNgModuleProperty(sourceFile, callback, 'imports');
134
120
  }
135
- function visitNgModuleExports(sourceFile, callback) {
121
+ export function visitNgModuleExports(sourceFile, callback) {
136
122
  visitNgModuleProperty(sourceFile, callback, 'exports');
137
123
  }
138
124
  function visitNgModuleProperty(sourceFile, callback, property) {
@@ -149,13 +135,13 @@ function visitNgModuleProperty(sourceFile, callback, property) {
149
135
  });
150
136
  });
151
137
  }
152
- function visitComponents(sourceFile, callback) {
138
+ export function visitComponents(sourceFile, callback) {
153
139
  visitDecorator(sourceFile, 'Component', callback);
154
140
  }
155
- function visitNgModules(sourceFile, callback) {
141
+ export function visitNgModules(sourceFile, callback) {
156
142
  visitDecorator(sourceFile, 'NgModule', callback);
157
143
  }
158
- function visitDecorator(sourceFile, decoratorName, callback) {
144
+ export function visitDecorator(sourceFile, decoratorName, callback) {
159
145
  ts.forEachChild(sourceFile, function findClassDeclaration(node) {
160
146
  if (!ts.isClassDeclaration(node)) {
161
147
  ts.forEachChild(node, findClassDeclaration);
@@ -184,7 +170,7 @@ function visitDecorator(sourceFile, decoratorName, callback) {
184
170
  callback(classDeclarationNode, arg);
185
171
  });
186
172
  }
187
- function visitImportDeclaration(node, callback) {
173
+ export function visitImportDeclaration(node, callback) {
188
174
  if (ts.isImportDeclaration(node)) {
189
175
  var moduleSpecifier = node.moduleSpecifier.getText();
190
176
  var moduleName = moduleSpecifier.replaceAll('"', '').replaceAll("'", '');
@@ -194,7 +180,7 @@ function visitImportDeclaration(node, callback) {
194
180
  visitImportDeclaration(child, callback);
195
181
  });
196
182
  }
197
- function visitImportSpecifier(node, callback) {
183
+ export function visitImportSpecifier(node, callback) {
198
184
  var e_2, _a, e_3, _b;
199
185
  var importClause = node.importClause;
200
186
  if (!importClause) {
@@ -232,7 +218,7 @@ function visitImportSpecifier(node, callback) {
232
218
  finally { if (e_2) throw e_2.error; }
233
219
  }
234
220
  }
235
- function visitTypeReference(node, callback) {
221
+ export function visitTypeReference(node, callback) {
236
222
  if (ts.isTypeReferenceNode(node)) {
237
223
  callback(node);
238
224
  }
@@ -240,7 +226,7 @@ function visitTypeReference(node, callback) {
240
226
  visitTypeReference(child, callback);
241
227
  });
242
228
  }
243
- function visitTypeLiteral(node, callback) {
229
+ export function visitTypeLiteral(node, callback) {
244
230
  if (ts.isTypeLiteralNode(node)) {
245
231
  callback(node);
246
232
  }
@@ -248,7 +234,7 @@ function visitTypeLiteral(node, callback) {
248
234
  visitTypeLiteral(child, callback);
249
235
  });
250
236
  }
251
- function visitCallExpression(node, callback) {
237
+ export function visitCallExpression(node, callback) {
252
238
  if (ts.isCallExpression(node)) {
253
239
  callback(node);
254
240
  }