@auscope/angular2parse 20.3.0 → 21.0.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 (109) hide show
  1. package/.editorconfig +13 -0
  2. package/LICENSE +21 -0
  3. package/README.md +66 -49
  4. package/angular.json +56 -0
  5. package/package.json +41 -33
  6. package/projects/angular2parse/README.md +49 -0
  7. package/projects/angular2parse/ng-package.json +7 -0
  8. package/projects/angular2parse/package.json +19 -0
  9. package/projects/angular2parse/src/lib/angular/compiler/assertions.d.ts +10 -0
  10. package/projects/angular2parse/src/lib/angular/compiler/assertions.d.ts.map +1 -0
  11. package/projects/angular2parse/src/lib/angular/compiler/assertions.js +45 -0
  12. package/projects/angular2parse/src/lib/angular/compiler/assertions.js.map +1 -0
  13. package/projects/angular2parse/src/lib/angular/compiler/assertions.ts +49 -0
  14. package/projects/angular2parse/src/lib/angular/compiler/ast.d.ts +243 -0
  15. package/projects/angular2parse/src/lib/angular/compiler/ast.d.ts.map +1 -0
  16. package/projects/angular2parse/src/lib/angular/compiler/ast.js +393 -0
  17. package/projects/angular2parse/src/lib/angular/compiler/ast.js.map +1 -0
  18. package/projects/angular2parse/src/lib/angular/compiler/ast.ts +393 -0
  19. package/projects/angular2parse/src/lib/angular/compiler/chars.d.ts +70 -0
  20. package/projects/angular2parse/src/lib/angular/compiler/chars.d.ts.map +1 -0
  21. package/projects/angular2parse/src/lib/angular/compiler/chars.js +78 -0
  22. package/projects/angular2parse/src/lib/angular/compiler/chars.js.map +1 -0
  23. package/projects/angular2parse/src/lib/angular/compiler/chars.ts +89 -0
  24. package/projects/angular2parse/src/lib/angular/compiler/interpolation-config.d.ts +15 -0
  25. package/projects/angular2parse/src/lib/angular/compiler/interpolation-config.d.ts.map +1 -0
  26. package/projects/angular2parse/src/lib/angular/compiler/interpolation-config.js +24 -0
  27. package/projects/angular2parse/src/lib/angular/compiler/interpolation-config.js.map +1 -0
  28. package/projects/angular2parse/src/lib/angular/compiler/interpolation-config.ts +25 -0
  29. package/projects/angular2parse/src/lib/angular/compiler/lexer.d.ts +45 -0
  30. package/projects/angular2parse/src/lib/angular/compiler/lexer.d.ts.map +1 -0
  31. package/projects/angular2parse/src/lib/angular/compiler/lexer.js +344 -0
  32. package/projects/angular2parse/src/lib/angular/compiler/lexer.js.map +1 -0
  33. package/projects/angular2parse/src/lib/angular/compiler/lexer.ts +383 -0
  34. package/projects/angular2parse/src/lib/angular/compiler/parser.d.ts +93 -0
  35. package/projects/angular2parse/src/lib/angular/compiler/parser.d.ts.map +1 -0
  36. package/projects/angular2parse/src/lib/angular/compiler/parser.js +735 -0
  37. package/projects/angular2parse/src/lib/angular/compiler/parser.js.map +1 -0
  38. package/projects/angular2parse/src/lib/angular/compiler/parser.ts +825 -0
  39. package/projects/angular2parse/src/lib/angular/compiler.d.ts +7 -0
  40. package/projects/angular2parse/src/lib/angular/compiler.d.ts.map +1 -0
  41. package/projects/angular2parse/src/lib/angular/compiler.js +7 -0
  42. package/projects/angular2parse/src/lib/angular/compiler.js.map +1 -0
  43. package/projects/angular2parse/src/lib/angular/compiler.ts +6 -0
  44. package/projects/angular2parse/src/lib/angular/facade/lang.d.ts +45 -0
  45. package/projects/angular2parse/src/lib/angular/facade/lang.d.ts.map +1 -0
  46. package/projects/angular2parse/src/lib/angular/facade/lang.js +85 -0
  47. package/projects/angular2parse/src/lib/angular/facade/lang.js.map +1 -0
  48. package/projects/angular2parse/src/lib/angular/facade/lang.ts +124 -0
  49. package/projects/angular2parse/src/lib/angular/facade.d.ts +2 -0
  50. package/projects/angular2parse/src/lib/angular/facade.d.ts.map +1 -0
  51. package/projects/angular2parse/src/lib/angular/facade.js +2 -0
  52. package/projects/angular2parse/src/lib/angular/facade.js.map +1 -0
  53. package/projects/angular2parse/src/lib/angular/facade.ts +1 -0
  54. package/projects/angular2parse/src/lib/angular.d.ts +3 -0
  55. package/projects/angular2parse/src/lib/angular.d.ts.map +1 -0
  56. package/projects/angular2parse/src/lib/angular.js +3 -0
  57. package/projects/angular2parse/src/lib/angular.js.map +1 -0
  58. package/projects/angular2parse/src/lib/angular.ts +2 -0
  59. package/projects/angular2parse/src/lib/module.d.ts +6 -0
  60. package/projects/angular2parse/src/lib/module.d.ts.map +1 -0
  61. package/projects/angular2parse/src/lib/module.js +17 -0
  62. package/projects/angular2parse/src/lib/module.js.map +1 -0
  63. package/projects/angular2parse/src/lib/module.ts +12 -0
  64. package/projects/angular2parse/src/lib/parse.d.ts +19 -0
  65. package/projects/angular2parse/src/lib/parse.d.ts.map +1 -0
  66. package/projects/angular2parse/src/lib/parse.js +61 -0
  67. package/projects/angular2parse/src/lib/parse.js.map +1 -0
  68. package/projects/angular2parse/src/lib/parse.ts +78 -0
  69. package/projects/angular2parse/src/lib/util/binary-operations.d.ts +2 -0
  70. package/projects/angular2parse/src/lib/util/binary-operations.d.ts.map +1 -0
  71. package/projects/angular2parse/src/lib/util/binary-operations.js +18 -0
  72. package/projects/angular2parse/src/lib/util/binary-operations.js.map +1 -0
  73. package/projects/angular2parse/src/lib/util/binary-operations.ts +17 -0
  74. package/projects/angular2parse/src/lib/util/lang.d.ts +5 -0
  75. package/projects/angular2parse/src/lib/util/lang.d.ts.map +1 -0
  76. package/projects/angular2parse/src/lib/util/lang.js +13 -0
  77. package/projects/angular2parse/src/lib/util/lang.js.map +1 -0
  78. package/projects/angular2parse/src/lib/util/lang.ts +15 -0
  79. package/projects/angular2parse/src/lib/util.d.ts +3 -0
  80. package/projects/angular2parse/src/lib/util.d.ts.map +1 -0
  81. package/projects/angular2parse/src/lib/util.js +3 -0
  82. package/projects/angular2parse/src/lib/util.js.map +1 -0
  83. package/projects/angular2parse/src/lib/util.ts +2 -0
  84. package/projects/angular2parse/src/lib/visitors/parse-visitor-compiler.d.ts +24 -0
  85. package/projects/angular2parse/src/lib/visitors/parse-visitor-compiler.d.ts.map +1 -0
  86. package/projects/angular2parse/src/lib/visitors/parse-visitor-compiler.js +96 -0
  87. package/projects/angular2parse/src/lib/visitors/parse-visitor-compiler.js.map +1 -0
  88. package/projects/angular2parse/src/lib/visitors/parse-visitor-compiler.ts +149 -0
  89. package/projects/angular2parse/src/lib/visitors/parse-visitor-resolver.d.ts +26 -0
  90. package/projects/angular2parse/src/lib/visitors/parse-visitor-resolver.d.ts.map +1 -0
  91. package/projects/angular2parse/src/lib/visitors/parse-visitor-resolver.js +141 -0
  92. package/projects/angular2parse/src/lib/visitors/parse-visitor-resolver.js.map +1 -0
  93. package/projects/angular2parse/src/lib/visitors/parse-visitor-resolver.ts +208 -0
  94. package/projects/angular2parse/src/lib/visitors.d.ts +3 -0
  95. package/projects/angular2parse/src/lib/visitors.d.ts.map +1 -0
  96. package/projects/angular2parse/src/lib/visitors.js +3 -0
  97. package/projects/angular2parse/src/lib/visitors.js.map +1 -0
  98. package/projects/angular2parse/src/lib/visitors.ts +2 -0
  99. package/projects/angular2parse/src/public-api.d.ts +3 -0
  100. package/projects/angular2parse/src/public-api.d.ts.map +1 -0
  101. package/projects/angular2parse/src/public-api.js +6 -0
  102. package/projects/angular2parse/src/public-api.js.map +1 -0
  103. package/projects/angular2parse/src/public-api.ts +5 -0
  104. package/projects/angular2parse/tsconfig.lib.json +22 -0
  105. package/projects/angular2parse/tsconfig.lib.prod.json +15 -0
  106. package/tsconfig.json +21 -0
  107. package/fesm2022/auscope-angular2parse.mjs +0 -2033
  108. package/fesm2022/auscope-angular2parse.mjs.map +0 -1
  109. package/index.d.ts +0 -32
package/.editorconfig ADDED
@@ -0,0 +1,13 @@
1
+ # Editor configuration, see https://editorconfig.org
2
+ root = true
3
+
4
+ [*]
5
+ charset = utf-8
6
+ indent_style = space
7
+ indent_size = 2
8
+ insert_final_newline = true
9
+ trim_trailing_whitespace = true
10
+
11
+ [*.md]
12
+ max_line_length = off
13
+ trim_trailing_whitespace = false
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Articode 2017
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,49 +1,66 @@
1
- # angular2parse
2
- Parse util for angular expressions: html string -> angular temaplte
3
-
4
- # install
5
- `npm install angular2parse`
6
-
7
- ```typescript
8
- // app.module.ts
9
- @NgModule({
10
- imports: [Angular2ParseModule, ...],
11
- // ...
12
- })
13
- class AppModule {}
14
- ```
15
- # usage
16
- ```typescript
17
- import { Parse } from 'angular2parse';
18
-
19
- @Injectable()
20
- class MyService {
21
- constructor(private parser: Parse) {}
22
-
23
- parseAngularString() {
24
- const expression = `{
25
- positions: track.positions,
26
- cornerType: getCornerType(),
27
- material: track.color,
28
- width : 200000.0 }`;
29
-
30
- const expressionEvalFn = this.parser.eval(expression)
31
-
32
- const context = {
33
- getCornerType: () => 'value',
34
- track: {
35
- positions: [1,2,3],
36
- color: 'red',
37
- }
38
- }
39
- };
40
-
41
- const result = expressionEvalFn(context);
42
- console.log(result);
43
- // {positions: [1,2,3], cornerType: 'value', material: 'red', width: 2000}
44
-
45
- }
46
-
47
- ```
48
-
49
- ```
1
+ # angular2parse
2
+ Parse util for angular expressions: html string -> angular template
3
+
4
+ **This is a fork of Articode's [angular2parse](https://github.com/articodeltd/angular2parse), adapted for Angular v12 - v20**
5
+
6
+ **Available from 'npmjs' https://www.npmjs.com/package/@auscope/angular2parse**
7
+
8
+ | Angular Version | Branch |
9
+ |-----------------|-------------|
10
+ | v20 | upgrade-v20 |
11
+ | v19 | upgrade-v19 |
12
+ | v18 | upgrade-v18 |
13
+ | v17 | upgrade-v17 |
14
+ | v16 | upgrade-v16 |
15
+ | v15 | upgrade-v15 |
16
+ | v14 | upgrade-v14 |
17
+ | v13 | upgrade-v13 |
18
+ | v12 | upgrade-v12 |
19
+
20
+
21
+ # install
22
+ `npm install angular2parse`
23
+
24
+ ```typescript
25
+ // app.module.ts
26
+ @NgModule({
27
+ imports: [Angular2ParseModule, ...],
28
+ // ...
29
+ })
30
+ class AppModule {}
31
+ ```
32
+ # usage
33
+ ```typescript
34
+ import { Parse } from 'angular2parse';
35
+
36
+ @Injectable()
37
+ class MyService {
38
+ constructor(private parser: Parse) {}
39
+
40
+ parseAngularString() {
41
+ const expression = `{
42
+ positions: track.positions,
43
+ cornerType: getCornerType(),
44
+ material: track.color,
45
+ width : 200000.0 }`;
46
+
47
+ const expressionEvalFn = this.parser.eval(expression)
48
+
49
+ const context = {
50
+ getCornerType: () => 'value',
51
+ track: {
52
+ positions: [1,2,3],
53
+ color: 'red',
54
+ }
55
+ }
56
+ };
57
+
58
+ const result = expressionEvalFn(context);
59
+ console.log(result);
60
+ // {positions: [1,2,3], cornerType: 'value', material: 'red', width: 2000}
61
+
62
+ }
63
+
64
+ ```
65
+
66
+ ```
package/angular.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3
+ "version": 1,
4
+ "newProjectRoot": "projects",
5
+ "projects": {
6
+ "angular2parse": {
7
+ "projectType": "library",
8
+ "root": "projects/angular2parse",
9
+ "sourceRoot": "projects/angular2parse/src",
10
+ "prefix": "lib",
11
+ "architect": {
12
+ "build": {
13
+ "builder": "@angular/build:ng-packagr",
14
+ "options": {
15
+ "tsConfig": "projects/angular2parse/tsconfig.lib.json",
16
+ "project": "projects/angular2parse/ng-package.json"
17
+ },
18
+ "configurations": {
19
+ "production": {
20
+ "tsConfig": "projects/angular2parse/tsconfig.lib.prod.json"
21
+ }
22
+ }
23
+ }
24
+ }
25
+ }
26
+ },
27
+ "cli": {
28
+ "analytics": false
29
+ },
30
+ "schematics": {
31
+ "@schematics/angular:component": {
32
+ "type": "component"
33
+ },
34
+ "@schematics/angular:directive": {
35
+ "type": "directive"
36
+ },
37
+ "@schematics/angular:service": {
38
+ "type": "service"
39
+ },
40
+ "@schematics/angular:guard": {
41
+ "typeSeparator": "."
42
+ },
43
+ "@schematics/angular:interceptor": {
44
+ "typeSeparator": "."
45
+ },
46
+ "@schematics/angular:module": {
47
+ "typeSeparator": "."
48
+ },
49
+ "@schematics/angular:pipe": {
50
+ "typeSeparator": "."
51
+ },
52
+ "@schematics/angular:resolver": {
53
+ "typeSeparator": "."
54
+ }
55
+ }
56
+ }
package/package.json CHANGED
@@ -1,34 +1,42 @@
1
- {
2
- "name": "@auscope/angular2parse",
3
- "version": "20.3.0",
4
- "license": "MIT",
5
- "description": "Fork of articode repo for Angular v20",
6
- "bugs": {
7
- "url": "https://github.com/AuScope/angular2parse/issues"
8
- },
9
- "repository": {
10
- "type": "git",
11
- "url": "https://github.com/AuScope/angular2parse.git",
12
- "directory": "projects/angular2parse"
13
- },
14
- "homepage": "https://github.com/AuScope/angular2parse#readme",
15
- "peerDependencies": {
16
- "@angular/common": "^20.3.0",
17
- "@angular/core": "^20.3.0"
18
- },
19
- "module": "fesm2022/auscope-angular2parse.mjs",
20
- "typings": "index.d.ts",
21
- "exports": {
22
- "./package.json": {
23
- "default": "./package.json"
24
- },
25
- ".": {
26
- "types": "./index.d.ts",
27
- "default": "./fesm2022/auscope-angular2parse.mjs"
28
- }
29
- },
30
- "sideEffects": false,
31
- "dependencies": {
32
- "tslib": "^2.3.0"
33
- }
1
+ {
2
+ "name": "@auscope/angular2parse",
3
+ "version": "21.0.0",
4
+ "author": "Articode",
5
+ "license": "MIT",
6
+ "description": "Fork of articode repo for Angular v20",
7
+ "bugs": {
8
+ "url": "https://github.com/AuScope/angular2parse/issues"
9
+ },
10
+ "homepage": "https://github.com/AuScope/angular2parse#readme",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/AuScope/angular2parse.git"
14
+ },
15
+ "scripts": {
16
+ "ng": "ng",
17
+ "build": "ng build",
18
+ "build:prod": "ng build --configuration production",
19
+ "lib:publish": "npm run build:prod && cd dist/angular2parse && npm publish"
20
+ },
21
+ "dependencies": {
22
+ "@angular/common": "^22.1.1",
23
+ "@angular/compiler": "^22.1.1",
24
+ "@angular/core": "^22.1.1",
25
+ "@angular/localize": "^22.1.1",
26
+ "@angular/platform-browser": "^22.1.1",
27
+ "@angular/platform-browser-dynamic": "^22.1.1",
28
+ "rxjs": "~6.6.7",
29
+ "tslib": "^2.4.1",
30
+ "zone.js": "~0.15.0"
31
+ },
32
+ "devDependencies": {
33
+ "@angular/build": "^22.1.3",
34
+ "@angular/cli": "^22.1.3",
35
+ "@angular/compiler-cli": "^22.1.1",
36
+ "@angular/language-service": "^22.1.1",
37
+ "@types/node": "^26.2.0",
38
+ "ng-packagr": "^22.1.1",
39
+ "ts-node": "~8.10.2",
40
+ "typescript": "~6.0.3"
41
+ }
34
42
  }
@@ -0,0 +1,49 @@
1
+ # angular2parse
2
+ Parse util for angular expressions: html string -> angular temaplte
3
+
4
+ # install
5
+ `npm install angular2parse`
6
+
7
+ ```typescript
8
+ // app.module.ts
9
+ @NgModule({
10
+ imports: [Angular2ParseModule, ...],
11
+ // ...
12
+ })
13
+ class AppModule {}
14
+ ```
15
+ # usage
16
+ ```typescript
17
+ import { Parse } from 'angular2parse';
18
+
19
+ @Injectable()
20
+ class MyService {
21
+ constructor(private parser: Parse) {}
22
+
23
+ parseAngularString() {
24
+ const expression = `{
25
+ positions: track.positions,
26
+ cornerType: getCornerType(),
27
+ material: track.color,
28
+ width : 200000.0 }`;
29
+
30
+ const expressionEvalFn = this.parser.eval(expression)
31
+
32
+ const context = {
33
+ getCornerType: () => 'value',
34
+ track: {
35
+ positions: [1,2,3],
36
+ color: 'red',
37
+ }
38
+ }
39
+ };
40
+
41
+ const result = expressionEvalFn(context);
42
+ console.log(result);
43
+ // {positions: [1,2,3], cornerType: 'value', material: 'red', width: 2000}
44
+
45
+ }
46
+
47
+ ```
48
+
49
+ ```
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
+ "dest": "../../dist/angular2parse",
4
+ "lib": {
5
+ "entryFile": "src/public-api.ts"
6
+ }
7
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "@auscope/angular2parse",
3
+ "version": "22.0.0",
4
+ "license": "MIT",
5
+ "description": "Fork of articode repo for Angular v22",
6
+ "bugs": {
7
+ "url": "https://github.com/AuScope/angular2parse/issues"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/AuScope/angular2parse.git",
12
+ "directory": "projects/angular2parse"
13
+ },
14
+ "homepage": "https://github.com/AuScope/angular2parse#readme",
15
+ "peerDependencies": {
16
+ "@angular/common": "^22.1.1",
17
+ "@angular/core": "^22.1.1"
18
+ }
19
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google Inc. All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ export declare function assertArrayOfStrings(identifier: string, value: any): void;
9
+ export declare function assertInterpolationSymbols(identifier: string, value: any): void;
10
+ //# sourceMappingURL=assertions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertions.d.ts","sourceRoot":"","sources":["assertions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,QAYlE;AAUD,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,CAa/E"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google Inc. All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ import { isBlank, isPresent } from '../facade/lang';
9
+ const isDevMode = () => false;
10
+ export function assertArrayOfStrings(identifier, value) {
11
+ if (!isDevMode() || isBlank(value)) {
12
+ return;
13
+ }
14
+ if (!Array.isArray(value)) {
15
+ throw new Error(`Expected '${identifier}' to be an array of strings.`);
16
+ }
17
+ for (let i = 0; i < value.length; i += 1) {
18
+ if (typeof value[i] !== 'string') {
19
+ throw new Error(`Expected '${identifier}' to be an array of strings.`);
20
+ }
21
+ }
22
+ }
23
+ const INTERPOLATION_BLACKLIST_REGEXPS = [
24
+ /^\s*$/, // empty
25
+ /[<>]/, // html tag
26
+ /^[{}]$/, // i18n expansion
27
+ /&(#|[a-z])/i, // character reference,
28
+ /^\/\//, // comment
29
+ ];
30
+ export function assertInterpolationSymbols(identifier, value) {
31
+ if (isPresent(value) && !(Array.isArray(value) && value.length == 2)) {
32
+ throw new Error(`Expected '${identifier}' to be an array, [start, end].`);
33
+ }
34
+ else if (isDevMode() && !isBlank(value)) {
35
+ const start = value[0];
36
+ const end = value[1];
37
+ // black list checking
38
+ INTERPOLATION_BLACKLIST_REGEXPS.forEach(regexp => {
39
+ if (regexp.test(start) || regexp.test(end)) {
40
+ throw new Error(`['${start}', '${end}'] contains unusable interpolation symbol.`);
41
+ }
42
+ });
43
+ }
44
+ }
45
+ //# sourceMappingURL=assertions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertions.js","sourceRoot":"","sources":["assertions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAC,OAAO,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAElD,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC;AAE9B,MAAM,UAAU,oBAAoB,CAAC,UAAkB,EAAE,KAAU;IAC/D,IAAI,CAAC,SAAS,EAAE,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACjC,OAAO;IACX,CAAC;IACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,aAAa,UAAU,8BAA8B,CAAC,CAAC;IAC3E,CAAC;IACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QACvC,IAAI,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE,CAAC;YAC/B,MAAM,IAAI,KAAK,CAAC,aAAa,UAAU,8BAA8B,CAAC,CAAC;QAC3E,CAAC;IACL,CAAC;AACL,CAAC;AAED,MAAM,+BAA+B,GAAG;IACpC,OAAO,EAAS,QAAQ;IACxB,MAAM,EAAU,WAAW;IAC3B,QAAQ,EAAQ,iBAAiB;IACjC,aAAa,EAAG,uBAAuB;IACvC,OAAO,EAAS,UAAU;CAC7B,CAAC;AAEF,MAAM,UAAU,0BAA0B,CAAC,UAAkB,EAAE,KAAU;IACrE,IAAI,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC,EAAE,CAAC;QACnE,MAAM,IAAI,KAAK,CAAC,aAAa,UAAU,iCAAiC,CAAC,CAAC;IAC9E,CAAC;SAAM,IAAI,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACxC,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAW,CAAC;QACjC,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAW,CAAC;QAC/B,sBAAsB;QACtB,+BAA+B,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YAC7C,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;gBACzC,MAAM,IAAI,KAAK,CAAC,KAAK,KAAK,OAAO,GAAG,4CAA4C,CAAC,CAAC;YACtF,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;AACL,CAAC","sourcesContent":["/**\r\n * @license\r\n * Copyright Google Inc. All Rights Reserved.\r\n *\r\n * Use of this source code is governed by an MIT-style license that can be\r\n * found in the LICENSE file at https://angular.io/license\r\n */\r\n\r\n\r\nimport {isBlank, isPresent} from '../facade/lang';\r\n\r\nconst isDevMode = () => false;\r\n\r\nexport function assertArrayOfStrings(identifier: string, value: any) {\r\n if (!isDevMode() || isBlank(value)) {\r\n return;\r\n }\r\n if (!Array.isArray(value)) {\r\n throw new Error(`Expected '${identifier}' to be an array of strings.`);\r\n }\r\n for (let i = 0; i < value.length; i += 1) {\r\n if (typeof value[i] !== 'string') {\r\n throw new Error(`Expected '${identifier}' to be an array of strings.`);\r\n }\r\n }\r\n}\r\n\r\nconst INTERPOLATION_BLACKLIST_REGEXPS = [\r\n /^\\s*$/, // empty\r\n /[<>]/, // html tag\r\n /^[{}]$/, // i18n expansion\r\n /&(#|[a-z])/i, // character reference,\r\n /^\\/\\//, // comment\r\n];\r\n\r\nexport function assertInterpolationSymbols(identifier: string, value: any): void {\r\n if (isPresent(value) && !(Array.isArray(value) && value.length == 2)) {\r\n throw new Error(`Expected '${identifier}' to be an array, [start, end].`);\r\n } else if (isDevMode() && !isBlank(value)) {\r\n const start = value[0] as string;\r\n const end = value[1] as string;\r\n // black list checking\r\n INTERPOLATION_BLACKLIST_REGEXPS.forEach(regexp => {\r\n if (regexp.test(start) || regexp.test(end)) {\r\n throw new Error(`['${start}', '${end}'] contains unusable interpolation symbol.`);\r\n }\r\n });\r\n }\r\n}"]}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google Inc. All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+
9
+
10
+ import {isBlank, isPresent} from '../facade/lang';
11
+
12
+ const isDevMode = () => false;
13
+
14
+ export function assertArrayOfStrings(identifier: string, value: any) {
15
+ if (!isDevMode() || isBlank(value)) {
16
+ return;
17
+ }
18
+ if (!Array.isArray(value)) {
19
+ throw new Error(`Expected '${identifier}' to be an array of strings.`);
20
+ }
21
+ for (let i = 0; i < value.length; i += 1) {
22
+ if (typeof value[i] !== 'string') {
23
+ throw new Error(`Expected '${identifier}' to be an array of strings.`);
24
+ }
25
+ }
26
+ }
27
+
28
+ const INTERPOLATION_BLACKLIST_REGEXPS = [
29
+ /^\s*$/, // empty
30
+ /[<>]/, // html tag
31
+ /^[{}]$/, // i18n expansion
32
+ /&(#|[a-z])/i, // character reference,
33
+ /^\/\//, // comment
34
+ ];
35
+
36
+ export function assertInterpolationSymbols(identifier: string, value: any): void {
37
+ if (isPresent(value) && !(Array.isArray(value) && value.length == 2)) {
38
+ throw new Error(`Expected '${identifier}' to be an array, [start, end].`);
39
+ } else if (isDevMode() && !isBlank(value)) {
40
+ const start = value[0] as string;
41
+ const end = value[1] as string;
42
+ // black list checking
43
+ INTERPOLATION_BLACKLIST_REGEXPS.forEach(regexp => {
44
+ if (regexp.test(start) || regexp.test(end)) {
45
+ throw new Error(`['${start}', '${end}'] contains unusable interpolation symbol.`);
46
+ }
47
+ });
48
+ }
49
+ }