module-specifiers.js 1.1 KB

12345678910111213141516171819202122232425
  1. "use strict";
  2. /**
  3. * Use of this source code is governed by an MIT-style license that can be
  4. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  5. */
  6. Object.defineProperty(exports, "__esModule", { value: true });
  7. exports.ngZorroModuleSpecifier = void 0;
  8. exports.isNgZorroImportDeclaration = isNgZorroImportDeclaration;
  9. exports.isNgZorroExportDeclaration = isNgZorroExportDeclaration;
  10. const schematics_1 = require("@angular/cdk/schematics");
  11. exports.ngZorroModuleSpecifier = 'ng-zorro-antd';
  12. function isNgZorroImportDeclaration(node) {
  13. return isNgZorroDeclaration((0, schematics_1.getImportDeclaration)(node));
  14. }
  15. function isNgZorroExportDeclaration(node) {
  16. return isNgZorroDeclaration((0, schematics_1.getExportDeclaration)(node));
  17. }
  18. function isNgZorroDeclaration(declaration) {
  19. if (!declaration.moduleSpecifier) {
  20. return false;
  21. }
  22. const moduleSpecifier = declaration.moduleSpecifier.getText();
  23. return moduleSpecifier.indexOf(exports.ngZorroModuleSpecifier) !== -1;
  24. }
  25. //# sourceMappingURL=module-specifiers.js.map