@angular-devkit/schematics 17.3.6 → 17.3.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-devkit/schematics",
3
- "version": "17.3.6",
3
+ "version": "17.3.8",
4
4
  "description": "Angular Schematics - Library",
5
5
  "main": "src/index.js",
6
6
  "typings": "src/index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "tooling"
19
19
  ],
20
20
  "dependencies": {
21
- "@angular-devkit/core": "17.3.6",
21
+ "@angular-devkit/core": "17.3.8",
22
22
  "jsonc-parser": "3.2.1",
23
23
  "magic-string": "0.30.8",
24
24
  "ora": "5.4.1",
@@ -42,7 +42,10 @@ function applyContentTemplate(options) {
42
42
  };
43
43
  }
44
44
  catch (e) {
45
- if (e.code === 'ERR_ENCODING_INVALID_ENCODED_DATA') {
45
+ // The second part should not be needed. But Jest does not support instanceof correctly.
46
+ // See: https://github.com/jestjs/jest/issues/2549
47
+ if (e instanceof TypeError ||
48
+ e.code === 'ERR_ENCODING_INVALID_ENCODED_DATA') {
46
49
  return entry;
47
50
  }
48
51
  throw e;
@@ -227,7 +227,10 @@ class HostTree {
227
227
  return decoder.decode(data);
228
228
  }
229
229
  catch (e) {
230
- if (e instanceof TypeError) {
230
+ // The second part should not be needed. But Jest does not support instanceof correctly.
231
+ // See: https://github.com/jestjs/jest/issues/2549
232
+ if (e instanceof TypeError ||
233
+ e.code === 'ERR_ENCODING_INVALID_ENCODED_DATA') {
231
234
  throw new Error(`Failed to decode "${path}" as UTF-8 text.`);
232
235
  }
233
236
  throw e;