@vope/utils 1.4.7 → 1.4.9
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/cjs/index.js +7 -3
- package/lib/index.js +2 -0
- package/lib/is/key.js +4 -0
- package/lib/memory/basic.js +3 -3
- package/package.json +1 -1
- package/types/index.d.ts +1 -0
- package/types/is/key.d.ts +4 -0
package/cjs/index.js
CHANGED
|
@@ -42,6 +42,7 @@ __export(src_exports, {
|
|
|
42
42
|
inputRegex: () => inputRegex,
|
|
43
43
|
isClass: () => isClass,
|
|
44
44
|
isEmpty: () => isEmpty,
|
|
45
|
+
isKey: () => isKey,
|
|
45
46
|
isNull: () => isNull,
|
|
46
47
|
joinPaths: () => joinPaths,
|
|
47
48
|
loadImage: () => loadImage,
|
|
@@ -288,6 +289,9 @@ var isNull = (value) => value === void 0 || value === null;
|
|
|
288
289
|
// src/is/empty.ts
|
|
289
290
|
var isEmpty = (value) => isNull(value) || value === "";
|
|
290
291
|
|
|
292
|
+
// src/is/key.ts
|
|
293
|
+
var isKey = (key, data) => key in data;
|
|
294
|
+
|
|
291
295
|
// src/load/image.ts
|
|
292
296
|
var loadImage = (src) => {
|
|
293
297
|
return new Promise((resolve) => {
|
|
@@ -393,9 +397,9 @@ var MemoryBasic = class {
|
|
|
393
397
|
return this;
|
|
394
398
|
for (const [type, target] of memorys) {
|
|
395
399
|
const memory = this.#reflex(target);
|
|
396
|
-
memory.forEach((value,
|
|
397
|
-
if (value >=
|
|
398
|
-
memory[
|
|
400
|
+
memory.forEach((value, i) => {
|
|
401
|
+
if (value >= index) {
|
|
402
|
+
memory[i] = value - 1;
|
|
399
403
|
}
|
|
400
404
|
});
|
|
401
405
|
if (memory !== target) {
|
package/lib/index.js
CHANGED
|
@@ -10,6 +10,7 @@ import { getEncoding } from "./encoding";
|
|
|
10
10
|
import { inputRegex } from "./input-regex";
|
|
11
11
|
import { isClass } from "./is/class";
|
|
12
12
|
import { isEmpty } from "./is/empty";
|
|
13
|
+
import { isKey } from "./is/key";
|
|
13
14
|
import { isNull } from "./is/null";
|
|
14
15
|
import { loadImage } from "./load/image";
|
|
15
16
|
import { MemoryBasic } from "./memory/basic";
|
|
@@ -48,6 +49,7 @@ export {
|
|
|
48
49
|
inputRegex,
|
|
49
50
|
isClass,
|
|
50
51
|
isEmpty,
|
|
52
|
+
isKey,
|
|
51
53
|
isNull,
|
|
52
54
|
joinPaths,
|
|
53
55
|
loadImage,
|
package/lib/is/key.js
ADDED
package/lib/memory/basic.js
CHANGED
|
@@ -93,9 +93,9 @@ class MemoryBasic {
|
|
|
93
93
|
return this;
|
|
94
94
|
for (const [type, target] of memorys) {
|
|
95
95
|
const memory = this.#reflex(target);
|
|
96
|
-
memory.forEach((value,
|
|
97
|
-
if (value >=
|
|
98
|
-
memory[
|
|
96
|
+
memory.forEach((value, i) => {
|
|
97
|
+
if (value >= index) {
|
|
98
|
+
memory[i] = value - 1;
|
|
99
99
|
}
|
|
100
100
|
});
|
|
101
101
|
if (memory !== target) {
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { getEncoding } from './encoding';
|
|
|
10
10
|
export { inputRegex } from './input-regex';
|
|
11
11
|
export { isClass } from './is/class';
|
|
12
12
|
export { isEmpty } from './is/empty';
|
|
13
|
+
export { isKey } from './is/key';
|
|
13
14
|
export { isNull } from './is/null';
|
|
14
15
|
export { loadImage } from './load/image';
|
|
15
16
|
export { MemoryBasic } from './memory/basic';
|