@auscope/angular2parse 22.0.0 → 22.0.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.
- package/README.md +1 -18
- package/fesm2022/auscope-angular2parse.mjs +2047 -0
- package/fesm2022/auscope-angular2parse.mjs.map +1 -0
- package/package.json +34 -41
- package/types/auscope-angular2parse.d.ts +32 -0
- package/.editorconfig +0 -13
- package/LICENSE +0 -21
- package/angular.json +0 -56
- package/projects/angular2parse/README.md +0 -49
- package/projects/angular2parse/ng-package.json +0 -7
- package/projects/angular2parse/package.json +0 -19
- package/projects/angular2parse/src/lib/angular/compiler/assertions.d.ts +0 -10
- package/projects/angular2parse/src/lib/angular/compiler/assertions.d.ts.map +0 -1
- package/projects/angular2parse/src/lib/angular/compiler/assertions.js +0 -45
- package/projects/angular2parse/src/lib/angular/compiler/assertions.js.map +0 -1
- package/projects/angular2parse/src/lib/angular/compiler/assertions.ts +0 -49
- package/projects/angular2parse/src/lib/angular/compiler/ast.d.ts +0 -243
- package/projects/angular2parse/src/lib/angular/compiler/ast.d.ts.map +0 -1
- package/projects/angular2parse/src/lib/angular/compiler/ast.js +0 -393
- package/projects/angular2parse/src/lib/angular/compiler/ast.js.map +0 -1
- package/projects/angular2parse/src/lib/angular/compiler/ast.ts +0 -393
- package/projects/angular2parse/src/lib/angular/compiler/chars.d.ts +0 -70
- package/projects/angular2parse/src/lib/angular/compiler/chars.d.ts.map +0 -1
- package/projects/angular2parse/src/lib/angular/compiler/chars.js +0 -78
- package/projects/angular2parse/src/lib/angular/compiler/chars.js.map +0 -1
- package/projects/angular2parse/src/lib/angular/compiler/chars.ts +0 -89
- package/projects/angular2parse/src/lib/angular/compiler/interpolation-config.d.ts +0 -15
- package/projects/angular2parse/src/lib/angular/compiler/interpolation-config.d.ts.map +0 -1
- package/projects/angular2parse/src/lib/angular/compiler/interpolation-config.js +0 -24
- package/projects/angular2parse/src/lib/angular/compiler/interpolation-config.js.map +0 -1
- package/projects/angular2parse/src/lib/angular/compiler/interpolation-config.ts +0 -25
- package/projects/angular2parse/src/lib/angular/compiler/lexer.d.ts +0 -45
- package/projects/angular2parse/src/lib/angular/compiler/lexer.d.ts.map +0 -1
- package/projects/angular2parse/src/lib/angular/compiler/lexer.js +0 -344
- package/projects/angular2parse/src/lib/angular/compiler/lexer.js.map +0 -1
- package/projects/angular2parse/src/lib/angular/compiler/lexer.ts +0 -383
- package/projects/angular2parse/src/lib/angular/compiler/parser.d.ts +0 -93
- package/projects/angular2parse/src/lib/angular/compiler/parser.d.ts.map +0 -1
- package/projects/angular2parse/src/lib/angular/compiler/parser.js +0 -735
- package/projects/angular2parse/src/lib/angular/compiler/parser.js.map +0 -1
- package/projects/angular2parse/src/lib/angular/compiler/parser.ts +0 -825
- package/projects/angular2parse/src/lib/angular/compiler.d.ts +0 -7
- package/projects/angular2parse/src/lib/angular/compiler.d.ts.map +0 -1
- package/projects/angular2parse/src/lib/angular/compiler.js +0 -7
- package/projects/angular2parse/src/lib/angular/compiler.js.map +0 -1
- package/projects/angular2parse/src/lib/angular/compiler.ts +0 -6
- package/projects/angular2parse/src/lib/angular/facade/lang.d.ts +0 -45
- package/projects/angular2parse/src/lib/angular/facade/lang.d.ts.map +0 -1
- package/projects/angular2parse/src/lib/angular/facade/lang.js +0 -85
- package/projects/angular2parse/src/lib/angular/facade/lang.js.map +0 -1
- package/projects/angular2parse/src/lib/angular/facade/lang.ts +0 -124
- package/projects/angular2parse/src/lib/angular/facade.d.ts +0 -2
- package/projects/angular2parse/src/lib/angular/facade.d.ts.map +0 -1
- package/projects/angular2parse/src/lib/angular/facade.js +0 -2
- package/projects/angular2parse/src/lib/angular/facade.js.map +0 -1
- package/projects/angular2parse/src/lib/angular/facade.ts +0 -1
- package/projects/angular2parse/src/lib/angular.d.ts +0 -3
- package/projects/angular2parse/src/lib/angular.d.ts.map +0 -1
- package/projects/angular2parse/src/lib/angular.js +0 -3
- package/projects/angular2parse/src/lib/angular.js.map +0 -1
- package/projects/angular2parse/src/lib/angular.ts +0 -2
- package/projects/angular2parse/src/lib/module.d.ts +0 -6
- package/projects/angular2parse/src/lib/module.d.ts.map +0 -1
- package/projects/angular2parse/src/lib/module.js +0 -17
- package/projects/angular2parse/src/lib/module.js.map +0 -1
- package/projects/angular2parse/src/lib/module.ts +0 -12
- package/projects/angular2parse/src/lib/parse.d.ts +0 -19
- package/projects/angular2parse/src/lib/parse.d.ts.map +0 -1
- package/projects/angular2parse/src/lib/parse.js +0 -61
- package/projects/angular2parse/src/lib/parse.js.map +0 -1
- package/projects/angular2parse/src/lib/parse.ts +0 -78
- package/projects/angular2parse/src/lib/util/binary-operations.d.ts +0 -2
- package/projects/angular2parse/src/lib/util/binary-operations.d.ts.map +0 -1
- package/projects/angular2parse/src/lib/util/binary-operations.js +0 -18
- package/projects/angular2parse/src/lib/util/binary-operations.js.map +0 -1
- package/projects/angular2parse/src/lib/util/binary-operations.ts +0 -17
- package/projects/angular2parse/src/lib/util/lang.d.ts +0 -5
- package/projects/angular2parse/src/lib/util/lang.d.ts.map +0 -1
- package/projects/angular2parse/src/lib/util/lang.js +0 -13
- package/projects/angular2parse/src/lib/util/lang.js.map +0 -1
- package/projects/angular2parse/src/lib/util/lang.ts +0 -15
- package/projects/angular2parse/src/lib/util.d.ts +0 -3
- package/projects/angular2parse/src/lib/util.d.ts.map +0 -1
- package/projects/angular2parse/src/lib/util.js +0 -3
- package/projects/angular2parse/src/lib/util.js.map +0 -1
- package/projects/angular2parse/src/lib/util.ts +0 -2
- package/projects/angular2parse/src/lib/visitors/parse-visitor-compiler.d.ts +0 -24
- package/projects/angular2parse/src/lib/visitors/parse-visitor-compiler.d.ts.map +0 -1
- package/projects/angular2parse/src/lib/visitors/parse-visitor-compiler.js +0 -96
- package/projects/angular2parse/src/lib/visitors/parse-visitor-compiler.js.map +0 -1
- package/projects/angular2parse/src/lib/visitors/parse-visitor-compiler.ts +0 -149
- package/projects/angular2parse/src/lib/visitors/parse-visitor-resolver.d.ts +0 -26
- package/projects/angular2parse/src/lib/visitors/parse-visitor-resolver.d.ts.map +0 -1
- package/projects/angular2parse/src/lib/visitors/parse-visitor-resolver.js +0 -141
- package/projects/angular2parse/src/lib/visitors/parse-visitor-resolver.js.map +0 -1
- package/projects/angular2parse/src/lib/visitors/parse-visitor-resolver.ts +0 -208
- package/projects/angular2parse/src/lib/visitors.d.ts +0 -3
- package/projects/angular2parse/src/lib/visitors.d.ts.map +0 -1
- package/projects/angular2parse/src/lib/visitors.js +0 -3
- package/projects/angular2parse/src/lib/visitors.js.map +0 -1
- package/projects/angular2parse/src/lib/visitors.ts +0 -2
- package/projects/angular2parse/src/public-api.d.ts +0 -3
- package/projects/angular2parse/src/public-api.d.ts.map +0 -1
- package/projects/angular2parse/src/public-api.js +0 -6
- package/projects/angular2parse/src/public-api.js.map +0 -1
- package/projects/angular2parse/src/public-api.ts +0 -5
- package/projects/angular2parse/tsconfig.lib.json +0 -22
- package/projects/angular2parse/tsconfig.lib.prod.json +0 -15
- package/tsconfig.json +0 -21
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AST,
|
|
3
|
-
RecursiveAstVisitor,
|
|
4
|
-
PropertyRead,
|
|
5
|
-
MethodCall,
|
|
6
|
-
KeyedRead,
|
|
7
|
-
ImplicitReceiver,
|
|
8
|
-
LiteralPrimitive,
|
|
9
|
-
Binary,
|
|
10
|
-
Chain,
|
|
11
|
-
Conditional,
|
|
12
|
-
BindingPipe,
|
|
13
|
-
FunctionCall,
|
|
14
|
-
Interpolation,
|
|
15
|
-
KeyedWrite,
|
|
16
|
-
LiteralArray,
|
|
17
|
-
LiteralMap,
|
|
18
|
-
PrefixNot,
|
|
19
|
-
PropertyWrite,
|
|
20
|
-
SafePropertyRead,
|
|
21
|
-
SafeMethodCall,
|
|
22
|
-
Quote
|
|
23
|
-
} from '../angular';
|
|
24
|
-
import * as util from '../util';
|
|
25
|
-
import { BinaryOperations } from '../util/binary-operations';
|
|
26
|
-
|
|
27
|
-
export class ParseVisitorResolver extends RecursiveAstVisitor {
|
|
28
|
-
|
|
29
|
-
constructor(private pipes: Map<string, any>) {
|
|
30
|
-
super();
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
visitBinary(ast: Binary, context: any): any {
|
|
34
|
-
const execFn = BinaryOperations.get(ast.operation);
|
|
35
|
-
|
|
36
|
-
if (!execFn) {
|
|
37
|
-
throw new Error(`Parse ERROR: on visitBinary, unknown operator ${ast.operation}`);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return execFn(ast.left.visit(this, context), ast.right.visit(this, context));
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// TODO
|
|
44
|
-
visitChain(ast: Chain, context: any): any {
|
|
45
|
-
return this.visitAll(ast.expressions, context);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
visitConditional(ast: Conditional, context: any): any {
|
|
49
|
-
if (ast.condition.visit(this, context)) {
|
|
50
|
-
return ast.trueExp.visit(this, context);
|
|
51
|
-
}
|
|
52
|
-
else if (util.isPresent(ast.falseExp)) {
|
|
53
|
-
return ast.falseExp.visit(this, context);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
visitPipe(ast: BindingPipe, context: any): any {
|
|
60
|
-
const pipe = this.pipes.get(ast.name);
|
|
61
|
-
|
|
62
|
-
if (!pipe) {
|
|
63
|
-
throw new Error(`pipe ${ast.name} not found.`);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
if (!pipe.transform) {
|
|
67
|
-
throw new Error(`Parse ERROR: on visitPipe, transform method doesn't exist on pipe ${ast.name}.`);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const value = ast.exp.visit(this, context);
|
|
71
|
-
const pipeArgs = this.visitAll(ast.args, context);
|
|
72
|
-
|
|
73
|
-
pipeArgs.unshift(value);
|
|
74
|
-
|
|
75
|
-
return pipe.transform.apply(null, pipeArgs);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// TODO
|
|
79
|
-
visitFunctionCall(ast: FunctionCall, context: any): any {
|
|
80
|
-
const target = ast.target.visit(this, context);
|
|
81
|
-
|
|
82
|
-
if (!util.isFunction(target)) {
|
|
83
|
-
throw new Error(`Parse ERROR: on visitFunctionCall, target is not a function.`);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const args = this.visitAll(ast.args, context);
|
|
87
|
-
return target.apply(target, args);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
visitImplicitReceiver(ast: ImplicitReceiver, context: any): any {
|
|
91
|
-
return context;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
visitInterpolation(ast: Interpolation, context: any): any {
|
|
95
|
-
return this.visitAll(ast.expressions, context)[0];
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
visitKeyedRead(ast: KeyedRead, context: any): any {
|
|
99
|
-
const obj = ast.obj.visit(this, context);
|
|
100
|
-
const key = ast.key.visit(this, context);
|
|
101
|
-
return obj[key];
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
visitKeyedWrite(ast: KeyedWrite, context: any): any {
|
|
105
|
-
const obj = ast.obj.visit(this, context);
|
|
106
|
-
const key = ast.key.visit(this, context);
|
|
107
|
-
const value = ast.value.visit(this, context);
|
|
108
|
-
obj[key] = value;
|
|
109
|
-
return null;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
visitLiteralArray(ast: LiteralArray, context: any): any {
|
|
113
|
-
return this.visitAll(ast.expressions, context);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
visitLiteralMap(ast: LiteralMap, context: any): any {
|
|
117
|
-
const result: any = {};
|
|
118
|
-
const keys = ast.keys;
|
|
119
|
-
const values = this.visitAll(ast.values, context);
|
|
120
|
-
|
|
121
|
-
for (let i = 0, length = keys.length; i < length; i++) {
|
|
122
|
-
result[keys[i]] = values[i];
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
return result;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
visitLiteralPrimitive(ast: LiteralPrimitive, context: any): any {
|
|
129
|
-
return ast.value;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
visitMethodCall(ast: MethodCall, context: any): any {
|
|
133
|
-
const receiver = ast.receiver.visit(this, context);
|
|
134
|
-
|
|
135
|
-
if (!util.isJsObject(receiver)) {
|
|
136
|
-
throw new Error(`Parse ERROR: on visitMethodCall, invalid method receiver.`);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
const method = receiver[ast.name];
|
|
140
|
-
|
|
141
|
-
if (!util.isFunction(method)) {
|
|
142
|
-
throw new Error(`Parse ERROR: on visitMethodCall, method ${ast.name} doesn't exist on receiver.`);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
const args = this.visitAll(ast.args, context);
|
|
146
|
-
return method.apply(receiver, args);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
visitPrefixNot(ast: PrefixNot, context: any): any {
|
|
150
|
-
return ast.expression.visit(this, context);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
visitPropertyRead(ast: PropertyRead, context: any): any {
|
|
154
|
-
const receiver = ast.receiver.visit(this, context);
|
|
155
|
-
|
|
156
|
-
if (!util.isJsObject(receiver)) {
|
|
157
|
-
throw new Error(`Parse ERROR: on visitPropertyRead, invalid property receiver.`);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
return receiver[ast.name];
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
visitPropertyWrite(ast: PropertyWrite, context: any): any {
|
|
164
|
-
const receiver = ast.receiver.visit(this, context);
|
|
165
|
-
|
|
166
|
-
if (!util.isJsObject(receiver)) {
|
|
167
|
-
throw new Error(`Parse ERROR: on visitPropertyRead, invalid property receiver.`);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
receiver[ast.name] = ast.value.visit(this, context);
|
|
171
|
-
return null;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
visitSafePropertyRead(ast: SafePropertyRead, context: any): any {
|
|
175
|
-
const receiver = ast.receiver.visit(this, context);
|
|
176
|
-
|
|
177
|
-
if (!util.isJsObject(receiver)) {
|
|
178
|
-
throw new Error(`Parse ERROR: on visitSafePropertyRead, invalid property receiver.`);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
return receiver[ast.name];
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
visitSafeMethodCall(ast: SafeMethodCall, context: any): any {
|
|
185
|
-
const receiver = ast.receiver.visit(this, context);
|
|
186
|
-
|
|
187
|
-
if (!util.isJsObject(receiver)) {
|
|
188
|
-
throw new Error(`Parse ERROR: on visitSafeMethodCall, invalid method receiver.`);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
const method = receiver[ast.name];
|
|
192
|
-
|
|
193
|
-
if (!util.isFunction(method)) {
|
|
194
|
-
throw new Error(`Parse ERROR: on visitSafeMethodCall, method ${ast.name} doesn't exist on receiver.`);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
const args = this.visitAll(ast.args, context);
|
|
198
|
-
return method.apply(receiver, args);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
visitAll(asts: AST[], context: any): any {
|
|
202
|
-
return asts.map(ast => ast.visit(this, context));
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
visitQuote(ast: Quote, context: any): any {
|
|
206
|
-
throw new Error(`Parse ERROR: on visitQuote, quote expression not allowed.`);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"visitors.d.ts","sourceRoot":"","sources":["visitors.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"visitors.js","sourceRoot":"","sources":["visitors.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC","sourcesContent":["export * from './visitors/parse-visitor-compiler';\r\nexport * from './visitors/parse-visitor-resolver';"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["public-api.ts"],"names":[],"mappings":"AAGA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"public-api.js","sourceRoot":"","sources":["public-api.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAA","sourcesContent":["/*\r\n * Public API Surface of angular2parse\r\n */\r\nexport * from './lib/module';\r\nexport * from './lib/parse'\r\n"]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "../../out-tsc/lib",
|
|
5
|
-
"declarationMap": true,
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"inlineSources": true,
|
|
8
|
-
"types": []
|
|
9
|
-
},
|
|
10
|
-
"angularCompilerOptions": {
|
|
11
|
-
"skipTemplateCodegen": true,
|
|
12
|
-
"extendedDiagnostics": {
|
|
13
|
-
"checks": {
|
|
14
|
-
"nullishCoalescingNotNullable": "suppress",
|
|
15
|
-
"optionalChainNotNullable": "suppress"
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
"strictMetadataEmit": true,
|
|
19
|
-
"enableResourceInlining": true,
|
|
20
|
-
"strictTemplates": true
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.lib.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"declarationMap": false
|
|
5
|
-
},
|
|
6
|
-
"angularCompilerOptions": {
|
|
7
|
-
"compilationMode": "partial",
|
|
8
|
-
"extendedDiagnostics": {
|
|
9
|
-
"checks": {
|
|
10
|
-
"nullishCoalescingNotNullable": "suppress",
|
|
11
|
-
"optionalChainNotNullable": "suppress"
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compileOnSave": false,
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"sourceMap": true,
|
|
5
|
-
"esModuleInterop": true,
|
|
6
|
-
"declaration": false,
|
|
7
|
-
"experimentalDecorators": true,
|
|
8
|
-
"module": "esnext",
|
|
9
|
-
"moduleResolution": "bundler",
|
|
10
|
-
"importHelpers": true,
|
|
11
|
-
"target": "ES2022",
|
|
12
|
-
"typeRoots": [
|
|
13
|
-
"node_modules/@types"
|
|
14
|
-
],
|
|
15
|
-
"useDefineForClassFields": false
|
|
16
|
-
},
|
|
17
|
-
"angularCompilerOptions": {
|
|
18
|
-
"fullTemplateTypeCheck": true,
|
|
19
|
-
"strictInjectionParameters": true
|
|
20
|
-
}
|
|
21
|
-
}
|