@angular-devkit/schematics 13.0.0-next.8 → 13.0.0-rc.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.
- package/package.json +4 -4
- package/src/utility/update-buffer.js +13 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-devkit/schematics",
|
|
3
|
-
"version": "13.0.0-
|
|
3
|
+
"version": "13.0.0-rc.2",
|
|
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
|
"schematics"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@angular-devkit/core": "13.0.0-
|
|
21
|
+
"@angular-devkit/core": "13.0.0-rc.2",
|
|
22
22
|
"jsonc-parser": "3.0.0",
|
|
23
23
|
"magic-string": "0.25.7",
|
|
24
24
|
"ora": "5.4.1",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"url": "https://github.com/angular/angular-cli.git"
|
|
30
30
|
},
|
|
31
31
|
"engines": {
|
|
32
|
-
"node": "^12.20.0 ||
|
|
33
|
-
"npm": "^6.11.0 || ^7.5.6",
|
|
32
|
+
"node": "^12.20.0 || ^14.15.0 || >=16.10.0",
|
|
33
|
+
"npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
|
|
34
34
|
"yarn": ">= 1.13.0"
|
|
35
35
|
},
|
|
36
36
|
"author": "Angular Authors",
|
|
@@ -209,8 +209,16 @@ class UpdateBuffer extends UpdateBufferBase {
|
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
_slice(start) {
|
|
212
|
-
|
|
213
|
-
|
|
212
|
+
let index;
|
|
213
|
+
if (start >= this._originalContent.length) {
|
|
214
|
+
index = start;
|
|
215
|
+
}
|
|
216
|
+
else if (start < 0) {
|
|
217
|
+
index = this._originalContent.length + start;
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
index = this._getTextPosition(start);
|
|
221
|
+
}
|
|
214
222
|
this._assertIndex(index);
|
|
215
223
|
// Find the chunk by going through the list.
|
|
216
224
|
const h = this._linkedList.find((chunk) => index <= chunk.end);
|
|
@@ -255,6 +263,9 @@ class UpdateBuffer extends UpdateBufferBase {
|
|
|
255
263
|
this._slice(index)[1].prepend(content, assert);
|
|
256
264
|
}
|
|
257
265
|
remove(index, length) {
|
|
266
|
+
if (length === 0) {
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
258
269
|
const end = index + length;
|
|
259
270
|
const first = this._slice(index)[1];
|
|
260
271
|
const last = this._slice(end)[1];
|