@angular/compiler 14.2.0 → 14.2.1

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.2.0
2
+ * @license Angular v14.2.1
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.2.0
2
+ * @license Angular v14.2.1
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -14784,42 +14784,42 @@ const SCHEMA = [
14784
14784
  'time^[HTMLElement]|dateTime',
14785
14785
  ':svg:cursor^:svg:|',
14786
14786
  ];
14787
- const _ATTR_TO_PROP = {
14787
+ const _ATTR_TO_PROP = new Map(Object.entries({
14788
14788
  'class': 'className',
14789
14789
  'for': 'htmlFor',
14790
14790
  'formaction': 'formAction',
14791
14791
  'innerHtml': 'innerHTML',
14792
14792
  'readonly': 'readOnly',
14793
14793
  'tabindex': 'tabIndex',
14794
- };
14794
+ }));
14795
14795
  // Invert _ATTR_TO_PROP.
14796
- const _PROP_TO_ATTR = Object.keys(_ATTR_TO_PROP).reduce((inverted, attr) => {
14797
- inverted[_ATTR_TO_PROP[attr]] = attr;
14796
+ const _PROP_TO_ATTR = Array.from(_ATTR_TO_PROP).reduce((inverted, [propertyName, attributeName]) => {
14797
+ inverted.set(propertyName, attributeName);
14798
14798
  return inverted;
14799
- }, {});
14799
+ }, new Map());
14800
14800
  class DomElementSchemaRegistry extends ElementSchemaRegistry {
14801
14801
  constructor() {
14802
14802
  super();
14803
- this._schema = {};
14803
+ this._schema = new Map();
14804
14804
  // We don't allow binding to events for security reasons. Allowing event bindings would almost
14805
14805
  // certainly introduce bad XSS vulnerabilities. Instead, we store events in a separate schema.
14806
- this._eventSchema = {};
14806
+ this._eventSchema = new Map;
14807
14807
  SCHEMA.forEach(encodedType => {
14808
- const type = {};
14808
+ const type = new Map();
14809
14809
  const events = new Set();
14810
14810
  const [strType, strProperties] = encodedType.split('|');
14811
14811
  const properties = strProperties.split(',');
14812
14812
  const [typeNames, superName] = strType.split('^');
14813
14813
  typeNames.split(',').forEach(tag => {
14814
- this._schema[tag.toLowerCase()] = type;
14815
- this._eventSchema[tag.toLowerCase()] = events;
14814
+ this._schema.set(tag.toLowerCase(), type);
14815
+ this._eventSchema.set(tag.toLowerCase(), events);
14816
14816
  });
14817
- const superType = superName && this._schema[superName.toLowerCase()];
14817
+ const superType = superName && this._schema.get(superName.toLowerCase());
14818
14818
  if (superType) {
14819
- Object.keys(superType).forEach((prop) => {
14820
- type[prop] = superType[prop];
14821
- });
14822
- for (const superEvent of this._eventSchema[superName.toLowerCase()]) {
14819
+ for (const [prop, value] of superType) {
14820
+ type.set(prop, value);
14821
+ }
14822
+ for (const superEvent of this._eventSchema.get(superName.toLowerCase())) {
14823
14823
  events.add(superEvent);
14824
14824
  }
14825
14825
  }
@@ -14830,16 +14830,16 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
14830
14830
  events.add(property.substring(1));
14831
14831
  break;
14832
14832
  case '!':
14833
- type[property.substring(1)] = BOOLEAN;
14833
+ type.set(property.substring(1), BOOLEAN);
14834
14834
  break;
14835
14835
  case '#':
14836
- type[property.substring(1)] = NUMBER;
14836
+ type.set(property.substring(1), NUMBER);
14837
14837
  break;
14838
14838
  case '%':
14839
- type[property.substring(1)] = OBJECT;
14839
+ type.set(property.substring(1), OBJECT);
14840
14840
  break;
14841
14841
  default:
14842
- type[property] = STRING;
14842
+ type.set(property, STRING);
14843
14843
  }
14844
14844
  }
14845
14845
  });
@@ -14859,8 +14859,8 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
14859
14859
  return true;
14860
14860
  }
14861
14861
  }
14862
- const elementProperties = this._schema[tagName.toLowerCase()] || this._schema['unknown'];
14863
- return !!elementProperties[propName];
14862
+ const elementProperties = this._schema.get(tagName.toLowerCase()) || this._schema.get('unknown');
14863
+ return elementProperties.has(propName);
14864
14864
  }
14865
14865
  hasElement(tagName, schemaMetas) {
14866
14866
  if (schemaMetas.some((schema) => schema.name === NO_ERRORS_SCHEMA.name)) {
@@ -14875,7 +14875,7 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
14875
14875
  return true;
14876
14876
  }
14877
14877
  }
14878
- return !!this._schema[tagName.toLowerCase()];
14878
+ return this._schema.has(tagName.toLowerCase());
14879
14879
  }
14880
14880
  /**
14881
14881
  * securityContext returns the security context for the given property on the given DOM tag.
@@ -14904,7 +14904,7 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
14904
14904
  return ctx ? ctx : SecurityContext.NONE;
14905
14905
  }
14906
14906
  getMappedPropName(propName) {
14907
- return _ATTR_TO_PROP[propName] || propName;
14907
+ return _ATTR_TO_PROP.get(propName) ?? propName;
14908
14908
  }
14909
14909
  getDefaultComponentElementName() {
14910
14910
  return 'ng-component';
@@ -14932,15 +14932,15 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
14932
14932
  }
14933
14933
  }
14934
14934
  allKnownElementNames() {
14935
- return Object.keys(this._schema);
14935
+ return Array.from(this._schema.keys());
14936
14936
  }
14937
14937
  allKnownAttributesOfElement(tagName) {
14938
- const elementProperties = this._schema[tagName.toLowerCase()] || this._schema['unknown'];
14938
+ const elementProperties = this._schema.get(tagName.toLowerCase()) || this._schema.get('unknown');
14939
14939
  // Convert properties to attributes.
14940
- return Object.keys(elementProperties).map(prop => _PROP_TO_ATTR[prop] ?? prop);
14940
+ return Array.from(elementProperties.keys()).map(prop => _PROP_TO_ATTR.get(prop) ?? prop);
14941
14941
  }
14942
14942
  allKnownEventsOfElement(tagName) {
14943
- return Array.from(this._eventSchema[tagName.toLowerCase()] ?? []);
14943
+ return Array.from(this._eventSchema.get(tagName.toLowerCase()) ?? []);
14944
14944
  }
14945
14945
  normalizeAnimationStyleProperty(propName) {
14946
14946
  return dashCaseToCamelCase(propName);
@@ -19904,7 +19904,7 @@ function publishFacade(global) {
19904
19904
  * Use of this source code is governed by an MIT-style license that can be
19905
19905
  * found in the LICENSE file at https://angular.io/license
19906
19906
  */
19907
- const VERSION = new Version('14.2.0');
19907
+ const VERSION = new Version('14.2.1');
19908
19908
 
19909
19909
  /**
19910
19910
  * @license
@@ -21937,7 +21937,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$6 = '12.0.0';
21937
21937
  function compileDeclareClassMetadata(metadata) {
21938
21938
  const definitionMap = new DefinitionMap();
21939
21939
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$6));
21940
- definitionMap.set('version', literal('14.2.0'));
21940
+ definitionMap.set('version', literal('14.2.1'));
21941
21941
  definitionMap.set('ngImport', importExpr(Identifiers.core));
21942
21942
  definitionMap.set('type', metadata.type);
21943
21943
  definitionMap.set('decorators', metadata.decorators);
@@ -22054,7 +22054,7 @@ function compileDeclareDirectiveFromMetadata(meta) {
22054
22054
  function createDirectiveDefinitionMap(meta) {
22055
22055
  const definitionMap = new DefinitionMap();
22056
22056
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
22057
- definitionMap.set('version', literal('14.2.0'));
22057
+ definitionMap.set('version', literal('14.2.1'));
22058
22058
  // e.g. `type: MyDirective`
22059
22059
  definitionMap.set('type', meta.internalType);
22060
22060
  if (meta.isStandalone) {
@@ -22268,7 +22268,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
22268
22268
  function compileDeclareFactoryFunction(meta) {
22269
22269
  const definitionMap = new DefinitionMap();
22270
22270
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
22271
- definitionMap.set('version', literal('14.2.0'));
22271
+ definitionMap.set('version', literal('14.2.1'));
22272
22272
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22273
22273
  definitionMap.set('type', meta.internalType);
22274
22274
  definitionMap.set('deps', compileDependencies(meta.deps));
@@ -22310,7 +22310,7 @@ function compileDeclareInjectableFromMetadata(meta) {
22310
22310
  function createInjectableDefinitionMap(meta) {
22311
22311
  const definitionMap = new DefinitionMap();
22312
22312
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
22313
- definitionMap.set('version', literal('14.2.0'));
22313
+ definitionMap.set('version', literal('14.2.1'));
22314
22314
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22315
22315
  definitionMap.set('type', meta.internalType);
22316
22316
  // Only generate providedIn property if it has a non-null value
@@ -22368,7 +22368,7 @@ function compileDeclareInjectorFromMetadata(meta) {
22368
22368
  function createInjectorDefinitionMap(meta) {
22369
22369
  const definitionMap = new DefinitionMap();
22370
22370
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
22371
- definitionMap.set('version', literal('14.2.0'));
22371
+ definitionMap.set('version', literal('14.2.1'));
22372
22372
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22373
22373
  definitionMap.set('type', meta.internalType);
22374
22374
  definitionMap.set('providers', meta.providers);
@@ -22405,7 +22405,7 @@ function compileDeclareNgModuleFromMetadata(meta) {
22405
22405
  function createNgModuleDefinitionMap(meta) {
22406
22406
  const definitionMap = new DefinitionMap();
22407
22407
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
22408
- definitionMap.set('version', literal('14.2.0'));
22408
+ definitionMap.set('version', literal('14.2.1'));
22409
22409
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22410
22410
  definitionMap.set('type', meta.internalType);
22411
22411
  // We only generate the keys in the metadata if the arrays contain values.
@@ -22463,7 +22463,7 @@ function compileDeclarePipeFromMetadata(meta) {
22463
22463
  function createPipeDefinitionMap(meta) {
22464
22464
  const definitionMap = new DefinitionMap();
22465
22465
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
22466
- definitionMap.set('version', literal('14.2.0'));
22466
+ definitionMap.set('version', literal('14.2.1'));
22467
22467
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22468
22468
  // e.g. `type: MyPipe`
22469
22469
  definitionMap.set('type', meta.internalType);