@angular/compiler 14.2.0 → 14.2.2

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.2
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -14519,10 +14519,24 @@ function SECURITY_SCHEMA() {
14519
14519
  registerContext(SecurityContext.STYLE, ['*|style']);
14520
14520
  // NB: no SCRIPT contexts here, they are never allowed due to the parser stripping them.
14521
14521
  registerContext(SecurityContext.URL, [
14522
- '*|formAction', 'area|href', 'area|ping', 'audio|src', 'a|href',
14523
- 'a|ping', 'blockquote|cite', 'body|background', 'del|cite', 'form|action',
14524
- 'img|src', 'img|srcset', 'input|src', 'ins|cite', 'q|cite',
14525
- 'source|src', 'source|srcset', 'track|src', 'video|poster', 'video|src',
14522
+ '*|formAction',
14523
+ 'area|href',
14524
+ 'area|ping',
14525
+ 'audio|src',
14526
+ 'a|href',
14527
+ 'a|ping',
14528
+ 'blockquote|cite',
14529
+ 'body|background',
14530
+ 'del|cite',
14531
+ 'form|action',
14532
+ 'img|src',
14533
+ 'input|src',
14534
+ 'ins|cite',
14535
+ 'q|cite',
14536
+ 'source|src',
14537
+ 'track|src',
14538
+ 'video|poster',
14539
+ 'video|src',
14526
14540
  ]);
14527
14541
  registerContext(SecurityContext.RESOURCE_URL, [
14528
14542
  'applet|code',
@@ -14778,42 +14792,42 @@ const SCHEMA = [
14778
14792
  'time^[HTMLElement]|dateTime',
14779
14793
  ':svg:cursor^:svg:|',
14780
14794
  ];
14781
- const _ATTR_TO_PROP = {
14795
+ const _ATTR_TO_PROP = new Map(Object.entries({
14782
14796
  'class': 'className',
14783
14797
  'for': 'htmlFor',
14784
14798
  'formaction': 'formAction',
14785
14799
  'innerHtml': 'innerHTML',
14786
14800
  'readonly': 'readOnly',
14787
14801
  'tabindex': 'tabIndex',
14788
- };
14802
+ }));
14789
14803
  // Invert _ATTR_TO_PROP.
14790
- const _PROP_TO_ATTR = Object.keys(_ATTR_TO_PROP).reduce((inverted, attr) => {
14791
- inverted[_ATTR_TO_PROP[attr]] = attr;
14804
+ const _PROP_TO_ATTR = Array.from(_ATTR_TO_PROP).reduce((inverted, [propertyName, attributeName]) => {
14805
+ inverted.set(propertyName, attributeName);
14792
14806
  return inverted;
14793
- }, {});
14807
+ }, new Map());
14794
14808
  class DomElementSchemaRegistry extends ElementSchemaRegistry {
14795
14809
  constructor() {
14796
14810
  super();
14797
- this._schema = {};
14811
+ this._schema = new Map();
14798
14812
  // We don't allow binding to events for security reasons. Allowing event bindings would almost
14799
14813
  // certainly introduce bad XSS vulnerabilities. Instead, we store events in a separate schema.
14800
- this._eventSchema = {};
14814
+ this._eventSchema = new Map;
14801
14815
  SCHEMA.forEach(encodedType => {
14802
- const type = {};
14816
+ const type = new Map();
14803
14817
  const events = new Set();
14804
14818
  const [strType, strProperties] = encodedType.split('|');
14805
14819
  const properties = strProperties.split(',');
14806
14820
  const [typeNames, superName] = strType.split('^');
14807
14821
  typeNames.split(',').forEach(tag => {
14808
- this._schema[tag.toLowerCase()] = type;
14809
- this._eventSchema[tag.toLowerCase()] = events;
14822
+ this._schema.set(tag.toLowerCase(), type);
14823
+ this._eventSchema.set(tag.toLowerCase(), events);
14810
14824
  });
14811
- const superType = superName && this._schema[superName.toLowerCase()];
14825
+ const superType = superName && this._schema.get(superName.toLowerCase());
14812
14826
  if (superType) {
14813
- Object.keys(superType).forEach((prop) => {
14814
- type[prop] = superType[prop];
14815
- });
14816
- for (const superEvent of this._eventSchema[superName.toLowerCase()]) {
14827
+ for (const [prop, value] of superType) {
14828
+ type.set(prop, value);
14829
+ }
14830
+ for (const superEvent of this._eventSchema.get(superName.toLowerCase())) {
14817
14831
  events.add(superEvent);
14818
14832
  }
14819
14833
  }
@@ -14824,16 +14838,16 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
14824
14838
  events.add(property.substring(1));
14825
14839
  break;
14826
14840
  case '!':
14827
- type[property.substring(1)] = BOOLEAN;
14841
+ type.set(property.substring(1), BOOLEAN);
14828
14842
  break;
14829
14843
  case '#':
14830
- type[property.substring(1)] = NUMBER;
14844
+ type.set(property.substring(1), NUMBER);
14831
14845
  break;
14832
14846
  case '%':
14833
- type[property.substring(1)] = OBJECT;
14847
+ type.set(property.substring(1), OBJECT);
14834
14848
  break;
14835
14849
  default:
14836
- type[property] = STRING;
14850
+ type.set(property, STRING);
14837
14851
  }
14838
14852
  }
14839
14853
  });
@@ -14853,8 +14867,8 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
14853
14867
  return true;
14854
14868
  }
14855
14869
  }
14856
- const elementProperties = this._schema[tagName.toLowerCase()] || this._schema['unknown'];
14857
- return !!elementProperties[propName];
14870
+ const elementProperties = this._schema.get(tagName.toLowerCase()) || this._schema.get('unknown');
14871
+ return elementProperties.has(propName);
14858
14872
  }
14859
14873
  hasElement(tagName, schemaMetas) {
14860
14874
  if (schemaMetas.some((schema) => schema.name === NO_ERRORS_SCHEMA.name)) {
@@ -14869,7 +14883,7 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
14869
14883
  return true;
14870
14884
  }
14871
14885
  }
14872
- return !!this._schema[tagName.toLowerCase()];
14886
+ return this._schema.has(tagName.toLowerCase());
14873
14887
  }
14874
14888
  /**
14875
14889
  * securityContext returns the security context for the given property on the given DOM tag.
@@ -14898,7 +14912,8 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
14898
14912
  return ctx ? ctx : SecurityContext.NONE;
14899
14913
  }
14900
14914
  getMappedPropName(propName) {
14901
- return _ATTR_TO_PROP[propName] || propName;
14915
+ var _a;
14916
+ return (_a = _ATTR_TO_PROP.get(propName)) !== null && _a !== void 0 ? _a : propName;
14902
14917
  }
14903
14918
  getDefaultComponentElementName() {
14904
14919
  return 'ng-component';
@@ -14926,16 +14941,16 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
14926
14941
  }
14927
14942
  }
14928
14943
  allKnownElementNames() {
14929
- return Object.keys(this._schema);
14944
+ return Array.from(this._schema.keys());
14930
14945
  }
14931
14946
  allKnownAttributesOfElement(tagName) {
14932
- const elementProperties = this._schema[tagName.toLowerCase()] || this._schema['unknown'];
14947
+ const elementProperties = this._schema.get(tagName.toLowerCase()) || this._schema.get('unknown');
14933
14948
  // Convert properties to attributes.
14934
- return Object.keys(elementProperties).map(prop => { var _a; return (_a = _PROP_TO_ATTR[prop]) !== null && _a !== void 0 ? _a : prop; });
14949
+ return Array.from(elementProperties.keys()).map(prop => { var _a; return (_a = _PROP_TO_ATTR.get(prop)) !== null && _a !== void 0 ? _a : prop; });
14935
14950
  }
14936
14951
  allKnownEventsOfElement(tagName) {
14937
14952
  var _a;
14938
- return Array.from((_a = this._eventSchema[tagName.toLowerCase()]) !== null && _a !== void 0 ? _a : []);
14953
+ return Array.from((_a = this._eventSchema.get(tagName.toLowerCase())) !== null && _a !== void 0 ? _a : []);
14939
14954
  }
14940
14955
  normalizeAnimationStyleProperty(propName) {
14941
14956
  return dashCaseToCamelCase(propName);
@@ -19862,7 +19877,7 @@ function publishFacade(global) {
19862
19877
  * Use of this source code is governed by an MIT-style license that can be
19863
19878
  * found in the LICENSE file at https://angular.io/license
19864
19879
  */
19865
- const VERSION = new Version('14.2.0');
19880
+ const VERSION = new Version('14.2.2');
19866
19881
 
19867
19882
  /**
19868
19883
  * @license
@@ -21889,7 +21904,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$6 = '12.0.0';
21889
21904
  function compileDeclareClassMetadata(metadata) {
21890
21905
  const definitionMap = new DefinitionMap();
21891
21906
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$6));
21892
- definitionMap.set('version', literal('14.2.0'));
21907
+ definitionMap.set('version', literal('14.2.2'));
21893
21908
  definitionMap.set('ngImport', importExpr(Identifiers.core));
21894
21909
  definitionMap.set('type', metadata.type);
21895
21910
  definitionMap.set('decorators', metadata.decorators);
@@ -22006,7 +22021,7 @@ function compileDeclareDirectiveFromMetadata(meta) {
22006
22021
  function createDirectiveDefinitionMap(meta) {
22007
22022
  const definitionMap = new DefinitionMap();
22008
22023
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
22009
- definitionMap.set('version', literal('14.2.0'));
22024
+ definitionMap.set('version', literal('14.2.2'));
22010
22025
  // e.g. `type: MyDirective`
22011
22026
  definitionMap.set('type', meta.internalType);
22012
22027
  if (meta.isStandalone) {
@@ -22220,7 +22235,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
22220
22235
  function compileDeclareFactoryFunction(meta) {
22221
22236
  const definitionMap = new DefinitionMap();
22222
22237
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
22223
- definitionMap.set('version', literal('14.2.0'));
22238
+ definitionMap.set('version', literal('14.2.2'));
22224
22239
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22225
22240
  definitionMap.set('type', meta.internalType);
22226
22241
  definitionMap.set('deps', compileDependencies(meta.deps));
@@ -22262,7 +22277,7 @@ function compileDeclareInjectableFromMetadata(meta) {
22262
22277
  function createInjectableDefinitionMap(meta) {
22263
22278
  const definitionMap = new DefinitionMap();
22264
22279
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
22265
- definitionMap.set('version', literal('14.2.0'));
22280
+ definitionMap.set('version', literal('14.2.2'));
22266
22281
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22267
22282
  definitionMap.set('type', meta.internalType);
22268
22283
  // Only generate providedIn property if it has a non-null value
@@ -22320,7 +22335,7 @@ function compileDeclareInjectorFromMetadata(meta) {
22320
22335
  function createInjectorDefinitionMap(meta) {
22321
22336
  const definitionMap = new DefinitionMap();
22322
22337
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
22323
- definitionMap.set('version', literal('14.2.0'));
22338
+ definitionMap.set('version', literal('14.2.2'));
22324
22339
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22325
22340
  definitionMap.set('type', meta.internalType);
22326
22341
  definitionMap.set('providers', meta.providers);
@@ -22357,7 +22372,7 @@ function compileDeclareNgModuleFromMetadata(meta) {
22357
22372
  function createNgModuleDefinitionMap(meta) {
22358
22373
  const definitionMap = new DefinitionMap();
22359
22374
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
22360
- definitionMap.set('version', literal('14.2.0'));
22375
+ definitionMap.set('version', literal('14.2.2'));
22361
22376
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22362
22377
  definitionMap.set('type', meta.internalType);
22363
22378
  // We only generate the keys in the metadata if the arrays contain values.
@@ -22415,7 +22430,7 @@ function compileDeclarePipeFromMetadata(meta) {
22415
22430
  function createPipeDefinitionMap(meta) {
22416
22431
  const definitionMap = new DefinitionMap();
22417
22432
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
22418
- definitionMap.set('version', literal('14.2.0'));
22433
+ definitionMap.set('version', literal('14.2.2'));
22419
22434
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22420
22435
  // e.g. `type: MyPipe`
22421
22436
  definitionMap.set('type', meta.internalType);