@e-mc/image 0.8.4 → 0.8.6
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/LICENSE +1 -1
- package/README.md +4 -4
- package/index.js +12 -12
- package/package.json +2 -2
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
## Interface
|
|
11
11
|
|
|
12
|
-
- https://www.unpkg.com/@e-mc/types@0.8.
|
|
12
|
+
- https://www.unpkg.com/@e-mc/types@0.8.6/lib/index.d.ts
|
|
13
13
|
|
|
14
14
|
```typescript
|
|
15
15
|
import type { IHost, ModuleConstructor } from "./index";
|
|
@@ -52,9 +52,9 @@ interface ImageConstructor extends ModuleConstructor {
|
|
|
52
52
|
|
|
53
53
|
## References
|
|
54
54
|
|
|
55
|
-
- https://www.unpkg.com/@e-mc/types@0.8.
|
|
56
|
-
- https://www.unpkg.com/@e-mc/types@0.8.
|
|
57
|
-
- https://www.unpkg.com/@e-mc/types@0.8.
|
|
55
|
+
- https://www.unpkg.com/@e-mc/types@0.8.6/lib/asset.d.ts
|
|
56
|
+
- https://www.unpkg.com/@e-mc/types@0.8.6/lib/image.d.ts
|
|
57
|
+
- https://www.unpkg.com/@e-mc/types@0.8.6/lib/settings.d.ts
|
|
58
58
|
|
|
59
59
|
## LICENSE
|
|
60
60
|
|
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a, _b;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
const core_1 = require("
|
|
4
|
+
const core_1 = require("@e-mc/core");
|
|
5
5
|
const kCommand = Symbol('command');
|
|
6
6
|
const kOutputAs = Symbol('outputAs');
|
|
7
7
|
const REGEXP_CROP = /\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*\|\s*(\d+)\s*[xX]\s*(\d+)\s*\)/;
|
|
@@ -170,26 +170,26 @@ class Image extends core_1.Client {
|
|
|
170
170
|
case "'":
|
|
171
171
|
case '"':
|
|
172
172
|
if (type === 0) {
|
|
173
|
-
type = 3
|
|
173
|
+
type = 3;
|
|
174
174
|
stringType = ch;
|
|
175
175
|
continue;
|
|
176
176
|
}
|
|
177
|
-
else if (type === 3
|
|
177
|
+
else if (type === 3 && ch === stringType && !isEscaped(false)) {
|
|
178
178
|
addArg(current);
|
|
179
179
|
continue;
|
|
180
180
|
}
|
|
181
181
|
break;
|
|
182
182
|
case '[':
|
|
183
183
|
if (type === 0) {
|
|
184
|
-
type = 1
|
|
184
|
+
type = 1;
|
|
185
185
|
arrayCount = 1;
|
|
186
186
|
}
|
|
187
|
-
else if (type === 1
|
|
187
|
+
else if (type === 1 && !isEscaped()) {
|
|
188
188
|
++arrayCount;
|
|
189
189
|
}
|
|
190
190
|
break;
|
|
191
191
|
case ']':
|
|
192
|
-
if (type === 1
|
|
192
|
+
if (type === 1 && !isEscaped() && --arrayCount === 0) {
|
|
193
193
|
try {
|
|
194
194
|
addArg(JSON.parse(current + ']'));
|
|
195
195
|
continue;
|
|
@@ -201,15 +201,15 @@ class Image extends core_1.Client {
|
|
|
201
201
|
break;
|
|
202
202
|
case '{':
|
|
203
203
|
if (type === 0) {
|
|
204
|
-
type = 2
|
|
204
|
+
type = 2;
|
|
205
205
|
objectCount = 1;
|
|
206
206
|
}
|
|
207
|
-
else if (type === 2
|
|
207
|
+
else if (type === 2 && !isEscaped()) {
|
|
208
208
|
++objectCount;
|
|
209
209
|
}
|
|
210
210
|
break;
|
|
211
211
|
case '}':
|
|
212
|
-
if (type === 2
|
|
212
|
+
if (type === 2 && !isEscaped() && --objectCount === 0) {
|
|
213
213
|
try {
|
|
214
214
|
addArg(JSON.parse(current + '}'));
|
|
215
215
|
continue;
|
|
@@ -273,14 +273,14 @@ class Image extends core_1.Client {
|
|
|
273
273
|
case '-':
|
|
274
274
|
case '+':
|
|
275
275
|
if (isNumber(value[i + 1])) {
|
|
276
|
-
type = 4
|
|
276
|
+
type = 4;
|
|
277
277
|
current += ch;
|
|
278
278
|
continue;
|
|
279
279
|
}
|
|
280
280
|
break invalid;
|
|
281
281
|
default:
|
|
282
282
|
if (isNumber(ch)) {
|
|
283
|
-
type = 4
|
|
283
|
+
type = 4;
|
|
284
284
|
current += ch;
|
|
285
285
|
continue;
|
|
286
286
|
}
|
|
@@ -291,7 +291,7 @@ class Image extends core_1.Client {
|
|
|
291
291
|
break invalid;
|
|
292
292
|
}
|
|
293
293
|
else {
|
|
294
|
-
if (type === 4
|
|
294
|
+
if (type === 4 && !(ch === '.' && decimal++ === 0)) {
|
|
295
295
|
if (isSpace || ch === ',' || ch === ')') {
|
|
296
296
|
addArg(+current);
|
|
297
297
|
switch (ch) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e-mc/image",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.6",
|
|
4
4
|
"description": "Image constructor for E-mc.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -20,6 +20,6 @@
|
|
|
20
20
|
"license": "BSD 3-Clause",
|
|
21
21
|
"homepage": "https://github.com/anpham6/e-mc#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@e-mc/core": "0.8.
|
|
23
|
+
"@e-mc/core": "0.8.6"
|
|
24
24
|
}
|
|
25
25
|
}
|