@duplojs/utils 1.5.5 → 1.5.7
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/dist/clean/entity/index.cjs +94 -0
- package/dist/clean/entity/index.d.ts +217 -0
- package/dist/clean/entity/index.mjs +85 -0
- package/dist/clean/entity/property.cjs +66 -0
- package/dist/clean/entity/property.d.ts +43 -0
- package/dist/clean/entity/property.mjs +59 -0
- package/dist/clean/entity/unwrap.cjs +58 -0
- package/dist/clean/{unwrapEntity.d.ts → entity/unwrap.d.ts} +13 -10
- package/dist/clean/entity/unwrap.mjs +55 -0
- package/dist/clean/index.cjs +14 -6
- package/dist/clean/index.d.ts +0 -1
- package/dist/clean/index.mjs +3 -2
- package/dist/clean/maybe.cjs +3 -3
- package/dist/clean/maybe.mjs +1 -1
- package/dist/common/memo.cjs +1 -1
- package/dist/common/memo.mjs +1 -1
- package/dist/common/memoPromise.cjs +1 -1
- package/dist/common/memoPromise.mjs +1 -1
- package/dist/dataParser/base.cjs +2 -2
- package/dist/dataParser/base.mjs +2 -2
- package/dist/dataParser/extended/tuple.d.ts +6 -2
- package/dist/date/computeTime.cjs +23 -0
- package/dist/date/computeTime.d.ts +41 -0
- package/dist/date/computeTime.mjs +21 -0
- package/dist/date/getDifference.cjs +17 -0
- package/dist/date/getDifference.d.ts +44 -0
- package/dist/date/getDifference.mjs +15 -0
- package/dist/date/index.cjs +4 -0
- package/dist/date/index.d.ts +2 -0
- package/dist/date/index.mjs +2 -0
- package/dist/date/theTime.d.ts +3 -2
- package/dist/date/toNative.cjs +11 -5
- package/dist/date/toNative.d.ts +21 -7
- package/dist/date/toNative.mjs +11 -5
- package/dist/date/types/serializedTheTime.d.ts +2 -1
- package/dist/metadata.json +50 -18
- package/package.json +2 -2
- package/dist/clean/entity.cjs +0 -145
- package/dist/clean/entity.d.ts +0 -234
- package/dist/clean/entity.mjs +0 -141
- package/dist/clean/unwrapEntity.cjs +0 -36
- package/dist/clean/unwrapEntity.mjs +0 -34
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var entity = require('./entity.cjs');
|
|
4
|
-
var flag = require('./flag.cjs');
|
|
5
|
-
var forward = require('../common/forward.cjs');
|
|
6
|
-
var unwrap = require('../common/unwrap.cjs');
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* {@include clean/unwrapEntity/index.md}
|
|
10
|
-
*/
|
|
11
|
-
function unwrapEntity(entity$1, params) {
|
|
12
|
-
const transformer = params?.transformer ?? forward.forward;
|
|
13
|
-
const unwrapEntity = {};
|
|
14
|
-
for (const prop in entity$1) {
|
|
15
|
-
if (prop === entity.entityKind.runTimeKey) {
|
|
16
|
-
unwrapEntity._entityName = entity$1[prop];
|
|
17
|
-
}
|
|
18
|
-
else if (prop === flag.flagKind.runTimeKey) {
|
|
19
|
-
unwrapEntity._flags = entity$1[prop];
|
|
20
|
-
}
|
|
21
|
-
else if (entity$1[prop] instanceof Array) {
|
|
22
|
-
const length = entity$1[prop].length;
|
|
23
|
-
const result = [];
|
|
24
|
-
for (let index = 0; index < length; index++) {
|
|
25
|
-
result[index] = transformer(unwrap.unwrap(entity$1[prop][index]));
|
|
26
|
-
}
|
|
27
|
-
unwrapEntity[prop] = result;
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
unwrapEntity[prop] = transformer(unwrap.unwrap(entity$1[prop]));
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return unwrapEntity;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
exports.unwrapEntity = unwrapEntity;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { entityKind } from './entity.mjs';
|
|
2
|
-
import { flagKind } from './flag.mjs';
|
|
3
|
-
import { forward } from '../common/forward.mjs';
|
|
4
|
-
import { unwrap } from '../common/unwrap.mjs';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* {@include clean/unwrapEntity/index.md}
|
|
8
|
-
*/
|
|
9
|
-
function unwrapEntity(entity, params) {
|
|
10
|
-
const transformer = params?.transformer ?? forward;
|
|
11
|
-
const unwrapEntity = {};
|
|
12
|
-
for (const prop in entity) {
|
|
13
|
-
if (prop === entityKind.runTimeKey) {
|
|
14
|
-
unwrapEntity._entityName = entity[prop];
|
|
15
|
-
}
|
|
16
|
-
else if (prop === flagKind.runTimeKey) {
|
|
17
|
-
unwrapEntity._flags = entity[prop];
|
|
18
|
-
}
|
|
19
|
-
else if (entity[prop] instanceof Array) {
|
|
20
|
-
const length = entity[prop].length;
|
|
21
|
-
const result = [];
|
|
22
|
-
for (let index = 0; index < length; index++) {
|
|
23
|
-
result[index] = transformer(unwrap(entity[prop][index]));
|
|
24
|
-
}
|
|
25
|
-
unwrapEntity[prop] = result;
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
unwrapEntity[prop] = transformer(unwrap(entity[prop]));
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return unwrapEntity;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export { unwrapEntity };
|