@angular-wave/angular.ts 0.4.1 → 0.4.3

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 (90) hide show
  1. package/dist/angular-ts.esm.js +2 -2
  2. package/dist/angular-ts.umd.js +2 -2
  3. package/package.json +7 -7
  4. package/src/angular.spec.js +1 -264
  5. package/src/animations/animate-css-driver.js +2 -2
  6. package/src/animations/animate-css.js +7 -8
  7. package/src/animations/animate-js-driver.js +1 -3
  8. package/src/animations/animate-js.js +4 -4
  9. package/src/animations/animate-queue.js +6 -6
  10. package/src/animations/animation.js +3 -3
  11. package/src/animations/shared.js +16 -14
  12. package/src/core/compile/attributes.js +2 -3
  13. package/src/core/compile/compile.js +248 -232
  14. package/src/core/compile/compile.spec.js +46 -51
  15. package/src/core/compile/compile.test.js +1 -1
  16. package/src/core/interpolate/interpolate.js +2 -2
  17. package/src/core/interval/interval.test.js +1 -1
  18. package/src/core/{parser/lexer.html → parse/ast/ast.html} +1 -1
  19. package/src/core/{parser → parse/ast}/ast.js +43 -29
  20. package/src/core/parse/ast/ast.spec.js +1462 -0
  21. package/src/core/parse/ast/ast.test.js +10 -0
  22. package/src/core/{parser → parse}/interpreter.js +10 -10
  23. package/src/core/parse/lexer/lexer.html +18 -0
  24. package/src/core/{parser → parse/lexer}/lexer.js +1 -1
  25. package/src/core/{parser → parse/lexer}/lexer.spec.js +2 -2
  26. package/src/core/parse/lexer/lexer.test.js +10 -0
  27. package/src/core/{parser → parse}/parse.html +1 -1
  28. package/src/core/{parser → parse}/parse.js +6 -6
  29. package/src/core/{parser → parse}/parse.spec.js +6 -1725
  30. package/src/core/parse/parse.test.js +10 -0
  31. package/src/core/parse/parser/parser.html +18 -0
  32. package/src/core/{parser → parse/parser}/parser.js +6 -6
  33. package/src/core/parse/parser/parser.spec.js +8 -0
  34. package/src/core/parse/parser/parser.test.js +10 -0
  35. package/src/core/sce/sce.js +1 -2
  36. package/src/core/scope/scope.js +4 -5
  37. package/src/directive/attrs/attrs.test.js +11 -0
  38. package/src/directive/attrs/boolean.html +18 -0
  39. package/src/directive/attrs/boolean.test.js +11 -0
  40. package/src/directive/attrs/element-style.html +21 -0
  41. package/src/directive/attrs/element-style.test.js +11 -0
  42. package/src/directive/bind/bing-html.spec.js +1 -1
  43. package/src/directive/class/class.js +1 -1
  44. package/src/directive/form/form.js +12 -19
  45. package/src/directive/if/if.spec.js +2 -3
  46. package/src/directive/if/if.test.js +1 -2
  47. package/src/directive/include/include.js +2 -2
  48. package/src/directive/input/input.js +1 -2
  49. package/src/directive/input/input.spec.js +187 -191
  50. package/src/directive/list/list.js +2 -2
  51. package/src/directive/model/model.js +14 -19
  52. package/src/directive/model-options/model-options.js +22 -26
  53. package/src/directive/options/options.js +1 -3
  54. package/src/directive/options/options.spec.js +3 -4
  55. package/src/directive/repeat/repeat.js +2 -2
  56. package/src/directive/repeat/repeat.spec.js +48 -57
  57. package/src/directive/select/select.spec.js +9 -10
  58. package/src/directive/switch/switch.js +1 -2
  59. package/src/directive/validators/validators.js +3 -3
  60. package/src/public.js +1 -1
  61. package/src/router/directives/state-directives.js +18 -16
  62. package/src/router/directives/view-directive.js +2 -2
  63. package/src/router/state/views.js +2 -2
  64. package/src/router/url/url-service.js +2 -8
  65. package/src/router/url/url-service.spec.js +3 -4
  66. package/src/services/http/http.js +5 -6
  67. package/src/services/http-backend/http-backend.js +19 -17
  68. package/src/shared/common.js +5 -8
  69. package/src/shared/jqlite/jqlite.js +14 -12
  70. package/src/shared/jqlite/jqlite.spec.js +2 -2
  71. package/src/shared/utils.js +15 -92
  72. package/types/animations/shared.d.ts +1 -1
  73. package/types/core/compile/compile.d.ts +1 -1
  74. package/types/core/interpolate/interpolate.d.ts +1 -1
  75. package/types/core/{parser → parse/ast}/ast.d.ts +17 -17
  76. package/types/core/{parser → parse}/interpreter.d.ts +7 -7
  77. package/types/core/{parser → parse/parser}/parser.d.ts +8 -8
  78. package/types/core/scope/scope.d.ts +3 -3
  79. package/types/directive/class/class.d.ts +3 -3
  80. package/types/directive/form/form.d.ts +1 -0
  81. package/types/directive/model/model.d.ts +6 -6
  82. package/types/directive/validators/validators.d.ts +3 -3
  83. package/types/shared/common.d.ts +0 -1
  84. package/types/shared/utils.d.ts +0 -35
  85. package/src/core/parser/parser.test.js +0 -19
  86. /package/src/core/{parser → parse}/ast-type.js +0 -0
  87. /package/src/core/{parser → parse}/parse.md +0 -0
  88. /package/types/core/{parser → parse}/ast-type.d.ts +0 -0
  89. /package/types/core/{parser → parse/lexer}/lexer.d.ts +0 -0
  90. /package/types/core/{parser → parse}/parse.d.ts +0 -0
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@angular-wave/angular.ts",
3
3
  "description": "A modern, optimized and typesafe version of AngularJS",
4
4
  "license": "MIT",
5
- "version": "0.4.1",
5
+ "version": "0.4.3",
6
6
  "type": "module",
7
7
  "main": "dist/angular-ts.esm.js",
8
8
  "browser": "dist/angular-ts.umd.js",
@@ -26,13 +26,13 @@
26
26
  "generate-docs": "node_modules/.bin/typedoc"
27
27
  },
28
28
  "devDependencies": {
29
- "@playwright/test": "^1.44.0",
29
+ "@playwright/test": "latest",
30
30
  "@rollup/plugin-commonjs": "latest",
31
31
  "@rollup/plugin-node-resolve": "latest",
32
- "@rollup/plugin-terser": "^0.4.4",
32
+ "@rollup/plugin-terser": "latest",
33
33
  "@types/jasmine": "latest",
34
34
  "@types/node": "latest",
35
- "docdash": "^2.0.2",
35
+ "docdash": "latest",
36
36
  "eslint": "latest",
37
37
  "eslint-config-airbnb-base": "latest",
38
38
  "eslint-config-prettier": "latest",
@@ -40,12 +40,12 @@
40
40
  "eslint-plugin-promise": "latest",
41
41
  "express": "latest",
42
42
  "jasmine-core": "latest",
43
- "jsdoc": "^4.0.3",
43
+ "jsdoc": "latest",
44
44
  "npm-run-all": "latest",
45
- "playwright": "^1.44.0",
45
+ "playwright": "latest",
46
46
  "prettier": "latest",
47
47
  "rollup": "latest",
48
- "rollup-plugin-version-injector": "^1.3.3",
48
+ "rollup-plugin-version-injector": "latest",
49
49
  "sinon": "latest",
50
50
  "typedoc": "latest",
51
51
  "typescript": "latest",
@@ -17,7 +17,6 @@ import {
17
17
  isArrayLike,
18
18
  encodeUriSegment,
19
19
  encodeUriQuery,
20
- forEach,
21
20
  toJson,
22
21
  fromJson,
23
22
  nextUid,
@@ -1257,268 +1256,6 @@ describe("angular", () => {
1257
1256
  });
1258
1257
  });
1259
1258
 
1260
- describe("forEach", () => {
1261
- it("should iterate over *own* object properties", () => {
1262
- function MyObj() {
1263
- this.bar = "barVal";
1264
- this.baz = "bazVal";
1265
- }
1266
- MyObj.prototype.foo = "fooVal";
1267
-
1268
- const obj = new MyObj();
1269
- const log = [];
1270
-
1271
- forEach(obj, (value, key) => {
1272
- log.push(`${key}:${value}`);
1273
- });
1274
-
1275
- expect(log).toEqual(["bar:barVal", "baz:bazVal"]);
1276
- });
1277
-
1278
- it("should not break if obj is an array we override hasOwnProperty", () => {
1279
- const obj = [];
1280
- obj[0] = 1;
1281
- obj[1] = 2;
1282
- obj.hasOwnProperty = null;
1283
- const log = [];
1284
- forEach(obj, (value, key) => {
1285
- log.push(`${key}:${value}`);
1286
- });
1287
- expect(log).toEqual(["0:1", "1:2"]);
1288
- });
1289
-
1290
- it("should handle JQLite and jQuery objects like arrays", () => {
1291
- let jqObject = JQLite("<p><span>s1</span><span>s2</span></p>").find(
1292
- "span",
1293
- );
1294
- let log = [];
1295
-
1296
- forEach(jqObject, (value, key) => {
1297
- log.push(`${key}:${value.innerHTML}`);
1298
- });
1299
- expect(log).toEqual(["0:s1", "1:s2"]);
1300
-
1301
- log = [];
1302
- jqObject = JQLite("<pane></pane>");
1303
- forEach(jqObject.children(), (value, key) => {
1304
- log.push(`${key}:${value.innerHTML}`);
1305
- });
1306
- expect(log).toEqual([]);
1307
- });
1308
-
1309
- it("should handle NodeList objects like arrays", () => {
1310
- const nodeList = JQLite(
1311
- "<p><span>a</span><span>b</span><span>c</span></p>",
1312
- )[0].childNodes;
1313
- const log = [];
1314
-
1315
- forEach(nodeList, (value, key) => {
1316
- log.push(`${key}:${value.innerHTML}`);
1317
- });
1318
- expect(log).toEqual(["0:a", "1:b", "2:c"]);
1319
- });
1320
-
1321
- it("should handle HTMLCollection objects like arrays", () => {
1322
- document.getElementById("dummy").innerHTML =
1323
- "<p>" +
1324
- "<a name='x'>a</a>" +
1325
- "<a name='y'>b</a>" +
1326
- "<a name='x'>c</a>" +
1327
- "</p>";
1328
-
1329
- const htmlCollection = document.getElementsByName("x");
1330
- const log = [];
1331
-
1332
- forEach(htmlCollection, (value, key) => {
1333
- log.push(`${key}:${value.innerHTML}`);
1334
- });
1335
- expect(log).toEqual(["0:a", "1:c"]);
1336
- });
1337
-
1338
- it("should handle arguments objects like arrays", () => {
1339
- let args;
1340
- const log = [];
1341
-
1342
- (function () {
1343
- args = arguments;
1344
- })("a", "b", "c");
1345
-
1346
- forEach(args, (value, key) => {
1347
- log.push(`${key}:${value}`);
1348
- });
1349
- expect(log).toEqual(["0:a", "1:b", "2:c"]);
1350
- });
1351
-
1352
- it("should handle string values like arrays", () => {
1353
- const log = [];
1354
-
1355
- forEach("bar", (value, key) => {
1356
- log.push(`${key}:${value}`);
1357
- });
1358
- expect(log).toEqual(["0:b", "1:a", "2:r"]);
1359
- });
1360
-
1361
- it("should handle objects with length property as objects", () => {
1362
- const obj = {
1363
- foo: "bar",
1364
- length: 2,
1365
- };
1366
- const log = [];
1367
-
1368
- forEach(obj, (value, key) => {
1369
- log.push(`${key}:${value}`);
1370
- });
1371
- expect(log).toEqual(["foo:bar", "length:2"]);
1372
- });
1373
-
1374
- it("should handle objects of custom types with length property as objects", () => {
1375
- function CustomType() {
1376
- this.length = 2;
1377
- this.foo = "bar";
1378
- }
1379
-
1380
- const obj = new CustomType();
1381
- const log = [];
1382
-
1383
- forEach(obj, (value, key) => {
1384
- log.push(`${key}:${value}`);
1385
- });
1386
- expect(log).toEqual(["length:2", "foo:bar"]);
1387
- });
1388
-
1389
- it("should not invoke the iterator for indexed properties which are not present in the collection", () => {
1390
- const log = [];
1391
- const collection = [];
1392
- collection[5] = "SPARSE";
1393
- forEach(collection, (item, index) => {
1394
- log.push(item + index);
1395
- });
1396
- expect(log.length).toBe(1);
1397
- expect(log[0]).toBe("SPARSE5");
1398
- });
1399
-
1400
- it("should safely iterate through objects with no prototype parent", () => {
1401
- const obj = extend(Object.create(null), {
1402
- a: 1,
1403
- b: 2,
1404
- c: 3,
1405
- });
1406
- const log = [];
1407
- const self = {};
1408
- forEach(
1409
- obj,
1410
- function (val, key, collection) {
1411
- expect(this).toBe(self);
1412
- expect(collection).toBe(obj);
1413
- log.push(`${key}=${val}`);
1414
- },
1415
- self,
1416
- );
1417
- expect(log.length).toBe(3);
1418
- expect(log).toEqual(["a=1", "b=2", "c=3"]);
1419
- });
1420
-
1421
- it("should safely iterate through objects which shadow Object.prototype.hasOwnProperty", () => {
1422
- const obj = {
1423
- hasOwnProperty: true,
1424
- a: 1,
1425
- b: 2,
1426
- c: 3,
1427
- };
1428
- const log = [];
1429
- const self = {};
1430
- forEach(
1431
- obj,
1432
- function (val, key, collection) {
1433
- expect(this).toBe(self);
1434
- expect(collection).toBe(obj);
1435
- log.push(`${key}=${val}`);
1436
- },
1437
- self,
1438
- );
1439
- expect(log.length).toBe(4);
1440
- expect(log).toEqual(["hasOwnProperty=true", "a=1", "b=2", "c=3"]);
1441
- });
1442
-
1443
- describe("ES spec api compliance", () => {
1444
- function testForEachSpec(expectedSize, collection) {
1445
- const that = {};
1446
-
1447
- forEach(
1448
- collection,
1449
- function (value, key, collectionArg) {
1450
- expect(collectionArg).toBe(collection);
1451
- expect(collectionArg[key]).toBe(value);
1452
-
1453
- expect(this).toBe(that);
1454
-
1455
- expectedSize--;
1456
- },
1457
- that,
1458
- );
1459
-
1460
- expect(expectedSize).toBe(0);
1461
- }
1462
-
1463
- it("should follow the ES spec when called with array", () => {
1464
- testForEachSpec(2, [1, 2]);
1465
- });
1466
-
1467
- it("should follow the ES spec when called with arguments", () => {
1468
- testForEachSpec(
1469
- 2,
1470
- (function () {
1471
- return arguments;
1472
- })(1, 2),
1473
- );
1474
- });
1475
-
1476
- it("should follow the ES spec when called with string", () => {
1477
- testForEachSpec(2, "12");
1478
- });
1479
-
1480
- it("should follow the ES spec when called with jQuery/shared/jqlite/jqlite", () => {
1481
- testForEachSpec(2, JQLite("<span>a</span><span>b</span>"));
1482
- });
1483
-
1484
- it("should follow the ES spec when called with childNodes NodeList", () => {
1485
- testForEachSpec(
1486
- 2,
1487
- JQLite("<p><span>a</span><span>b</span></p>")[0].childNodes,
1488
- );
1489
- });
1490
-
1491
- it("should follow the ES spec when called with getElementsByTagName HTMLCollection", () => {
1492
- testForEachSpec(
1493
- 2,
1494
- JQLite("<p><span>a</span><span>b</span></p>")[0].getElementsByTagName(
1495
- "*",
1496
- ),
1497
- );
1498
- });
1499
-
1500
- it("should follow the ES spec when called with querySelectorAll HTMLCollection", () => {
1501
- testForEachSpec(
1502
- 2,
1503
- JQLite("<p><span>a</span><span>b</span></p>")[0].querySelectorAll(
1504
- "*",
1505
- ),
1506
- );
1507
- });
1508
-
1509
- it("should follow the ES spec when called with JSON", () => {
1510
- testForEachSpec(2, { a: 1, b: 2 });
1511
- });
1512
-
1513
- it("should follow the ES spec when called with function", () => {
1514
- function f() {}
1515
- f.a = 1;
1516
- f.b = 2;
1517
- testForEachSpec(2, f);
1518
- });
1519
- });
1520
- });
1521
-
1522
1259
  describe("encodeUriSegment", () => {
1523
1260
  it("should correctly encode uri segment and not encode chars defined as pchar set in rfc3986", () => {
1524
1261
  // don't encode alphanum
@@ -1993,7 +1730,7 @@ describe("angular", () => {
1993
1730
  body,
1994
1731
  element,
1995
1732
  ];
1996
- forEach(tests, (value, idx) => {
1733
+ Object.entries(tests).forEach(([idx, value]) => {
1997
1734
  const result = isElement(value);
1998
1735
  expect(typeof result).toEqual("boolean");
1999
1736
  expect(result).toEqual(expected[idx]);
@@ -1,5 +1,5 @@
1
1
  import { JQLite } from "../shared/jqlite/jqlite";
2
- import { forEach, isString } from "../shared/utils";
2
+ import { isString } from "../shared/utils";
3
3
  import { concatWithSpace, getDomNode } from "./shared";
4
4
 
5
5
  const NG_ANIMATE_SHIM_CLASS_NAME = "ng-animate-shim";
@@ -211,7 +211,7 @@ export function AnimateCssDriverProvider($$animationProvider) {
211
211
  animationRunners.push(toAnimation.start());
212
212
  }
213
213
 
214
- forEach(anchorAnimations, (animation) => {
214
+ anchorAnimations.forEach((animation) => {
215
215
  animationRunners.push(animation.start());
216
216
  });
217
217
 
@@ -1,4 +1,4 @@
1
- import { forEach, isDefined } from "../shared/utils";
1
+ import { isDefined } from "../shared/utils";
2
2
  import {
3
3
  TRANSITION_DURATION_PROP,
4
4
  TRANSITION_DELAY_PROP,
@@ -67,7 +67,7 @@ function getCssDelayStyle(delay, isKeyframeAnimation) {
67
67
  function computeCssStyles(element, properties) {
68
68
  const styles = Object.create(null);
69
69
  const detectedStyles = window.getComputedStyle(element) || {};
70
- forEach(properties, (formalStyleName, actualStyleName) => {
70
+ Object.entries(properties).forEach(([actualStyleName, formalStyleName]) => {
71
71
  let val = detectedStyles[formalStyleName];
72
72
  if (val) {
73
73
  const c = val.charAt(0);
@@ -92,8 +92,7 @@ function computeCssStyles(element, properties) {
92
92
 
93
93
  function parseMaxTime(str) {
94
94
  let maxValue = 0;
95
- const values = str.split(/\s*,\s*/);
96
- forEach(values, (value) => {
95
+ str.split(/\s*,\s*/).forEach((value) => {
97
96
  // it's always safe to consider only second values and omit `ms` values since
98
97
  // getComputedStyle will always handle the conversion for us
99
98
  if (value.charAt(value.length - 1) === "s") {
@@ -130,7 +129,7 @@ function getCssTransitionDurationStyle(duration, applyOnlyDuration) {
130
129
  // is to be removed at the end of the animation). If we had a simple
131
130
  // "OR" statement then it would not be enough to catch that.
132
131
  function registerRestorableStyles(backup, node, properties) {
133
- forEach(properties, (prop) => {
132
+ properties.forEach((prop) => {
134
133
  backup[prop] = isDefined(backup[prop])
135
134
  ? backup[prop]
136
135
  : node.style.getPropertyValue(prop);
@@ -599,7 +598,7 @@ export function AnimateCssProvider() {
599
598
  blockKeyframeAnimations(node, false);
600
599
  blockTransitions(node, false);
601
600
 
602
- forEach(temporaryStyles, (entry) => {
601
+ temporaryStyles.forEach((entry) => {
603
602
  // There is only one way to remove inline style properties entirely from elements.
604
603
  // By using `removeProperty` this works, but we need to convert camel-cased CSS
605
604
  // styles down to hyphenated values.
@@ -610,7 +609,7 @@ export function AnimateCssProvider() {
610
609
  applyAnimationStyles(element, options);
611
610
 
612
611
  if (Object.keys(restoreStyles).length) {
613
- forEach(restoreStyles, (value, prop) => {
612
+ Object.entries(restoreStyles).forEach(([prop, value]) => {
614
613
  if (value) {
615
614
  node.style.setProperty(prop, value);
616
615
  } else {
@@ -775,7 +774,7 @@ export function AnimateCssProvider() {
775
774
 
776
775
  applyBlocking(false);
777
776
 
778
- forEach(temporaryStyles, (entry) => {
777
+ temporaryStyles.forEach((entry) => {
779
778
  const key = entry[0];
780
779
  const value = entry[1];
781
780
  node.style[key] = value;
@@ -1,5 +1,3 @@
1
- import { forEach } from "../shared/utils";
2
-
3
1
  AnimateJsDriverProvider.$inject = ["$$animationProvider"];
4
2
  export function AnimateJsDriverProvider($$animationProvider) {
5
3
  $$animationProvider.drivers.push("$$animateJsDriver");
@@ -36,7 +34,7 @@ export function AnimateJsDriverProvider($$animationProvider) {
36
34
 
37
35
  function endFnFactory() {
38
36
  return function () {
39
- forEach(animationRunners, (runner) => {
37
+ animationRunners.forEach((runner) => {
40
38
  // at this point we cannot cancel animations for groups just yet. 1.5+
41
39
  runner.end();
42
40
  });
@@ -1,4 +1,4 @@
1
- import { forEach, isObject, isFunction } from "../shared/utils";
1
+ import { isObject, isFunction } from "../shared/utils";
2
2
  import {
3
3
  applyAnimationClassesFactory,
4
4
  applyAnimationStyles,
@@ -218,7 +218,7 @@ export function AnimateJsProvider($animateProvider) {
218
218
  fnName,
219
219
  ) {
220
220
  const operations = [];
221
- forEach(animations, (ani) => {
221
+ animations.forEach((ani) => {
222
222
  const animation = ani[fnName];
223
223
  if (!animation) return;
224
224
 
@@ -326,7 +326,7 @@ export function AnimateJsProvider($animateProvider) {
326
326
  return function startAnimation(callback) {
327
327
  const runners = [];
328
328
  if (operations.length) {
329
- forEach(operations, (animateFn) => {
329
+ operations.forEach((animateFn) => {
330
330
  runners.push(animateFn());
331
331
  });
332
332
  }
@@ -338,7 +338,7 @@ export function AnimateJsProvider($animateProvider) {
338
338
  }
339
339
 
340
340
  return function endFn(reject) {
341
- forEach(runners, (runner) => {
341
+ runners.forEach((runner) => {
342
342
  if (reject) {
343
343
  runner.cancel();
344
344
  } else {
@@ -1,7 +1,6 @@
1
1
  import { getOrSetCacheData, JQLite } from "../shared/jqlite/jqlite";
2
2
  import {
3
3
  isUndefined,
4
- forEach,
5
4
  isObject,
6
5
  isString,
7
6
  isElement,
@@ -195,12 +194,13 @@ export function AnimateQueueProvider($animateProvider) {
195
194
  // compiled. The $templateRequest.totalPendingRequests variable keeps track of
196
195
  // all of the remote templates being currently downloaded. If there are no
197
196
  // templates currently downloading then the watcher will still fire anyway.
197
+ $rootScope["$templateRequest"] = $templateRequest;
198
198
  const deregisterWatch = $rootScope.$watch(
199
- () => $templateRequest.totalPendingRequests === 0,
200
- (isEmpty) => {
201
- if (!isEmpty) return;
199
+ "$templateRequest.totalPendingRequests",
200
+ (val) => {
201
+ if (val !== 0) return;
202
202
  deregisterWatch();
203
-
203
+ $rootScope["$templateRequest"] = undefined;
204
204
  // Now that all templates have been downloaded, $animate will wait until
205
205
  // the post digest queue is empty before enabling animations. By having two
206
206
  // calls to $postDigest calls we can ensure that the flag is enabled at the
@@ -717,7 +717,7 @@ export function AnimateQueueProvider($animateProvider) {
717
717
 
718
718
  function closeChildAnimations(node) {
719
719
  const children = node.querySelectorAll(`[${NG_ANIMATE_ATTR_NAME}]`);
720
- forEach(children, (child) => {
720
+ children.forEach((child) => {
721
721
  const state = parseInt(child.getAttribute(NG_ANIMATE_ATTR_NAME), 10);
722
722
  const animationDetails = activeAnimationsLookup.get(child);
723
723
  if (animationDetails) {
@@ -1,5 +1,5 @@
1
1
  import { JQLite } from "../shared/jqlite/jqlite";
2
- import { forEach, mergeClasses } from "../shared/utils";
2
+ import { mergeClasses } from "../shared/utils";
3
3
  import {
4
4
  NG_ANIMATE_CLASSNAME,
5
5
  PREPARE_CLASS_SUFFIX,
@@ -326,7 +326,7 @@ export function AnimationProvider() {
326
326
  ? [node]
327
327
  : node.querySelectorAll(SELECTOR);
328
328
  const anchors = [];
329
- forEach(items, (node) => {
329
+ items.forEach((node) => {
330
330
  const attr = node.getAttribute(NG_ANIMATE_REF_ATTR);
331
331
  if (attr && attr.length) {
332
332
  anchors.push(node);
@@ -338,7 +338,7 @@ export function AnimationProvider() {
338
338
  function groupAnimations(animations) {
339
339
  const preparedAnimations = [];
340
340
  const refLookup = {};
341
- forEach(animations, (animation, index) => {
341
+ animations.forEach((animation, index) => {
342
342
  const { element } = animation;
343
343
  const node = getDomNode(element);
344
344
  const { event } = animation;
@@ -1,6 +1,6 @@
1
- import { forEach, isString, minErr, extend } from "../shared/utils";
2
- import { JQLite } from "../shared/jqlite/jqlite";
3
- import { ASTType } from "../core/parser/ast-type";
1
+ import { isString, minErr, extend } from "../shared/utils.js";
2
+ import { JQLite } from "../shared/jqlite/jqlite.js";
3
+ import { ASTType } from "../core/parse/ast-type.js";
4
4
 
5
5
  export const ADD_CLASS_SUFFIX = "-add";
6
6
  export const REMOVE_CLASS_SUFFIX = "-remove";
@@ -262,12 +262,12 @@ export function resolveElementClasses(existing, toAdd, toRemove) {
262
262
  existing = splitClassesToLookup(existing);
263
263
 
264
264
  toAdd = splitClassesToLookup(toAdd);
265
- forEach(toAdd, (value, key) => {
265
+ Object.keys(toAdd).forEach((key) => {
266
266
  flags[key] = ADD_CLASS;
267
267
  });
268
268
 
269
269
  toRemove = splitClassesToLookup(toRemove);
270
- forEach(toRemove, (value, key) => {
270
+ Object.keys(toRemove).forEach((key) => {
271
271
  flags[key] = flags[key] === ADD_CLASS ? null : REMOVE_CLASS;
272
272
  });
273
273
 
@@ -276,7 +276,7 @@ export function resolveElementClasses(existing, toAdd, toRemove) {
276
276
  removeClass: "",
277
277
  };
278
278
 
279
- forEach(flags, function (val, klass) {
279
+ Object.entries(flags).forEach(([klass, val]) => {
280
280
  var prop, allow;
281
281
  if (val === ADD_CLASS) {
282
282
  prop = "addClass";
@@ -295,17 +295,19 @@ export function resolveElementClasses(existing, toAdd, toRemove) {
295
295
 
296
296
  function splitClassesToLookup(classes) {
297
297
  if (isString(classes)) {
298
- classes = classes.split(" ");
298
+ classes = classes.trim().split(" ");
299
299
  }
300
300
 
301
301
  const obj = {};
302
- forEach(classes, (klass) => {
303
- // sometimes the split leaves empty string values
304
- // incase extra spaces were applied to the options
305
- if (klass.length) {
306
- obj[klass] = true;
307
- }
308
- });
302
+ if (classes) {
303
+ classes.forEach((klass) => {
304
+ // sometimes the split leaves empty string values
305
+ // incase extra spaces were applied to the options
306
+ if (klass.length) {
307
+ obj[klass] = true;
308
+ }
309
+ });
310
+ }
309
311
  return obj;
310
312
  }
311
313
 
@@ -1,6 +1,5 @@
1
1
  import { getBooleanAttrName } from "../../shared/jqlite/jqlite";
2
2
  import {
3
- forEach,
4
3
  isString,
5
4
  snakeCase,
6
5
  isUndefined,
@@ -179,8 +178,8 @@ export class Attributes {
179
178
 
180
179
  // fire observers
181
180
  const { $$observers } = this;
182
- if ($$observers) {
183
- forEach($$observers[observer], (fn) => {
181
+ if ($$observers && $$observers[observer]) {
182
+ $$observers[observer].forEach((fn) => {
184
183
  try {
185
184
  fn(value);
186
185
  } catch (e) {