@e-mc/image 0.13.9 → 0.14.0
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 +5 -5
- package/index.js +9 -7
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @e-mc/image
|
|
2
2
|
|
|
3
|
-
* NodeJS
|
|
3
|
+
* NodeJS 20 (Minimum 18)
|
|
4
4
|
* ES2022
|
|
5
5
|
|
|
6
6
|
## General Usage
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
## Interface
|
|
11
11
|
|
|
12
|
-
* [View Source](https://www.unpkg.com/@e-mc/types@0.
|
|
12
|
+
* [View Source](https://www.unpkg.com/@e-mc/types@0.14.0/lib/index.d.ts)
|
|
13
13
|
|
|
14
14
|
```typescript
|
|
15
15
|
import type { IHost, ModuleConstructor } from "./index";
|
|
@@ -95,9 +95,9 @@ NOTE: Usage without a **Host** is conducted through static methods. The **using*
|
|
|
95
95
|
|
|
96
96
|
## References
|
|
97
97
|
|
|
98
|
-
- https://www.unpkg.com/@e-mc/types@0.
|
|
99
|
-
- https://www.unpkg.com/@e-mc/types@0.
|
|
100
|
-
- https://www.unpkg.com/@e-mc/types@0.
|
|
98
|
+
- https://www.unpkg.com/@e-mc/types@0.14.0/lib/asset.d.ts
|
|
99
|
+
- https://www.unpkg.com/@e-mc/types@0.14.0/lib/image.d.ts
|
|
100
|
+
- https://www.unpkg.com/@e-mc/types@0.14.0/lib/settings.d.ts
|
|
101
101
|
|
|
102
102
|
## LICENSE
|
|
103
103
|
|
package/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
const { Client } = require('@e-mc/core');
|
|
3
4
|
const kImage = Symbol.for('image:constructor');
|
|
4
5
|
const REGEXP_CROP = /\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*\|\s*(\d+)\s*[xX]\s*(\d+)\s*\)/;
|
|
5
6
|
const REGEXP_OPACITY = /\|\s*(\d*\.\d+)\s*\|/;
|
|
@@ -22,7 +23,7 @@ function isEscaped(value, checkQuote) {
|
|
|
22
23
|
}
|
|
23
24
|
const isNumber = (ch) => ch >= '0' && ch <= '9';
|
|
24
25
|
const parseHexDecimal = (value) => value ? +('0x' + value.toUpperCase().padEnd(8, 'F')) : NaN;
|
|
25
|
-
class Image extends
|
|
26
|
+
class Image extends Client {
|
|
26
27
|
static [kImage] = true;
|
|
27
28
|
static get MIME_JPEG() {
|
|
28
29
|
return 'image/jpeg';
|
|
@@ -276,35 +277,35 @@ class Image extends core_1.Client {
|
|
|
276
277
|
}
|
|
277
278
|
break invalid;
|
|
278
279
|
case 't':
|
|
279
|
-
if (value.
|
|
280
|
+
if (value.slice(i, i + 4) === 'true') {
|
|
280
281
|
addArg(true);
|
|
281
282
|
i += 3;
|
|
282
283
|
continue;
|
|
283
284
|
}
|
|
284
285
|
break invalid;
|
|
285
286
|
case 'f':
|
|
286
|
-
if (value.
|
|
287
|
+
if (value.slice(i, i + 5) === 'false') {
|
|
287
288
|
addArg(false);
|
|
288
289
|
i += 4;
|
|
289
290
|
continue;
|
|
290
291
|
}
|
|
291
292
|
break invalid;
|
|
292
293
|
case 'n':
|
|
293
|
-
if (value.
|
|
294
|
+
if (value.slice(i, i + 4) === 'null') {
|
|
294
295
|
addArg(null);
|
|
295
296
|
i += 3;
|
|
296
297
|
continue;
|
|
297
298
|
}
|
|
298
299
|
break invalid;
|
|
299
300
|
case 'u':
|
|
300
|
-
if (value.
|
|
301
|
+
if (value.slice(i, i + 9) === 'undefined') {
|
|
301
302
|
addArg(undefined);
|
|
302
303
|
i += 8;
|
|
303
304
|
continue;
|
|
304
305
|
}
|
|
305
306
|
break invalid;
|
|
306
307
|
case 'N':
|
|
307
|
-
if (value.
|
|
308
|
+
if (value.slice(i, i + 3) === 'NaN') {
|
|
308
309
|
addArg(NaN);
|
|
309
310
|
i += 2;
|
|
310
311
|
continue;
|
|
@@ -367,4 +368,5 @@ class Image extends core_1.Client {
|
|
|
367
368
|
return this.#outputAs;
|
|
368
369
|
}
|
|
369
370
|
}
|
|
371
|
+
|
|
370
372
|
module.exports = Image;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e-mc/image",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "Image constructor for E-mc.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -19,6 +19,6 @@
|
|
|
19
19
|
"license": "BSD-3-Clause",
|
|
20
20
|
"homepage": "https://github.com/anpham6/e-mc#readme",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@e-mc/core": "0.
|
|
22
|
+
"@e-mc/core": "0.14.0"
|
|
23
23
|
}
|
|
24
24
|
}
|