res-pareto-build 0.5.0 → 0.6.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/dist/{definition/api.generated.d.ts → api.generated.d.ts} +4 -2
- package/dist/{definition/glossary → glossary}/public.generated.d.ts +2 -2
- package/dist/{definition/glossary → glossary}/types.generated.d.ts +1 -1
- package/dist/implementation.generated.d.ts +1 -1
- package/dist/implementation.generated.js +2 -2
- package/dist/implementations/buildArray.native.d.ts +1 -1
- package/dist/implementations/createDictionaryBuilder.native.d.ts +2 -0
- package/dist/implementations/{buildDictionary.native.js → createDictionaryBuilder.native.js} +28 -24
- package/dist/implementations/unsafeBuildDictionary.native.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/package.json +3 -3
- package/dist/implementations/buildDictionary.native.d.ts +0 -2
- /package/dist/{definition/api.generated.js → api.generated.js} +0 -0
- /package/dist/{definition/glossary → glossary}/index.d.ts +0 -0
- /package/dist/{definition/glossary → glossary}/index.js +0 -0
- /package/dist/{definition/glossary → glossary}/public.generated.js +0 -0
- /package/dist/{definition/glossary → glossary}/types.generated.js +0 -0
@@ -1,9 +1,11 @@
|
|
1
1
|
import * as g_this from "./glossary";
|
2
2
|
export type buildArray = g_this.F.BuildArray;
|
3
|
-
export type
|
3
|
+
export type createDictionaryBuilder = ($d: {
|
4
|
+
readonly 'onDuplicate': g_this.F.OnDuplicate;
|
5
|
+
}) => g_this.F.BuildDictionary;
|
4
6
|
export type unsafeBuildDictionary = g_this.F.UnsafeBuildDictionary;
|
5
7
|
export type API = {
|
6
8
|
buildArray: buildArray;
|
7
|
-
|
9
|
+
createDictionaryBuilder: createDictionaryBuilder;
|
8
10
|
unsafeBuildDictionary: unsafeBuildDictionary;
|
9
11
|
};
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import { T } from './types.generated';
|
2
2
|
import * as g_common from "glo-pareto-common";
|
3
|
-
export declare namespace I { }
|
4
3
|
export declare namespace B {
|
5
4
|
type Add<GType> = ($: T.KeyValuePair<GType>) => void;
|
6
5
|
type OnDuplicate<GType> = ($: g_common.T.String) => void;
|
@@ -8,6 +7,7 @@ export declare namespace B {
|
|
8
7
|
}
|
9
8
|
export declare namespace F {
|
10
9
|
type BuildArray = <GType>($: g_common.T.Null, $c: ($b: B.Push<GType>) => void) => T.Array<GType>;
|
11
|
-
type BuildDictionary = <GType>($: T.DictionaryBuildStrategy<GType>, $c: ($b: B.Add<GType>) => void
|
10
|
+
type BuildDictionary = <GType>($: T.DictionaryBuildStrategy<GType>, $c: ($b: B.Add<GType>) => void) => T.Dictionary<GType>;
|
11
|
+
type OnDuplicate = <GType>($: g_common.T.Null, $c: ($b: B.OnDuplicate<GType>) => void) => void;
|
12
12
|
type UnsafeBuildDictionary = <GType>($: g_common.T.Null, $c: ($b: B.Add<GType>) => void) => T.Dictionary<GType>;
|
13
13
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { API } from "./
|
1
|
+
import { API } from "./api.generated";
|
2
2
|
export declare const $r: API;
|
@@ -2,10 +2,10 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.$r = void 0;
|
4
4
|
const buildArray_native_1 = require("./implementations/buildArray.native");
|
5
|
-
const
|
5
|
+
const createDictionaryBuilder_native_1 = require("./implementations/createDictionaryBuilder.native");
|
6
6
|
const unsafeBuildDictionary_native_1 = require("./implementations/unsafeBuildDictionary.native");
|
7
7
|
exports.$r = {
|
8
8
|
'buildArray': buildArray_native_1.$$,
|
9
|
-
'
|
9
|
+
'createDictionaryBuilder': createDictionaryBuilder_native_1.$$,
|
10
10
|
'unsafeBuildDictionary': unsafeBuildDictionary_native_1.$$,
|
11
11
|
};
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { buildArray } from "../
|
1
|
+
import { buildArray } from "../api.generated";
|
2
2
|
export declare const $$: buildArray;
|
package/dist/implementations/{buildDictionary.native.js → createDictionaryBuilder.native.js}
RENAMED
@@ -25,30 +25,34 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
26
26
|
exports.$$ = void 0;
|
27
27
|
const pi = __importStar(require("pareto-core-internals"));
|
28
|
-
const $$ = (
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
out[$.key]
|
34
|
-
|
35
|
-
else {
|
36
|
-
const kv = $;
|
37
|
-
switch (dbs[0]) {
|
38
|
-
case 'ignore':
|
39
|
-
pi.cc(dbs[1], ($) => {
|
40
|
-
});
|
41
|
-
break;
|
42
|
-
case 'overwrite':
|
43
|
-
pi.cc(dbs[1], ($) => {
|
44
|
-
out[kv.key] = kv.value;
|
45
|
-
});
|
46
|
-
break;
|
47
|
-
default: pi.au(dbs[0]);
|
28
|
+
const $$ = ($d) => {
|
29
|
+
return ($, $c) => {
|
30
|
+
const dbs = $;
|
31
|
+
const out = {};
|
32
|
+
$c(($) => {
|
33
|
+
if (out[$.key] === undefined) {
|
34
|
+
out[$.key] = $.value;
|
48
35
|
}
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
36
|
+
else {
|
37
|
+
const kv = $;
|
38
|
+
switch (dbs[0]) {
|
39
|
+
case 'ignore':
|
40
|
+
pi.cc(dbs[1], ($) => {
|
41
|
+
});
|
42
|
+
break;
|
43
|
+
case 'overwrite':
|
44
|
+
pi.cc(dbs[1], ($) => {
|
45
|
+
out[kv.key] = kv.value;
|
46
|
+
});
|
47
|
+
break;
|
48
|
+
default: pi.au(dbs[0]);
|
49
|
+
}
|
50
|
+
$d.onDuplicate(null, ($i) => {
|
51
|
+
$i($.key);
|
52
|
+
});
|
53
|
+
}
|
54
|
+
});
|
55
|
+
return pi.wrapRawDictionary(out);
|
56
|
+
};
|
53
57
|
};
|
54
58
|
exports.$$ = $$;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { unsafeBuildDictionary } from "../
|
1
|
+
import { unsafeBuildDictionary } from "../api.generated";
|
2
2
|
export declare const $$: unsafeBuildDictionary;
|
package/dist/index.d.ts
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
export * from "./
|
2
|
-
export * from "./
|
1
|
+
export * from "./api.generated";
|
2
|
+
export * from "./glossary";
|
3
3
|
export { $r } from "./implementation.generated";
|
package/dist/index.js
CHANGED
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
15
|
};
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
17
|
exports.$r = void 0;
|
18
|
-
__exportStar(require("./
|
19
|
-
__exportStar(require("./
|
18
|
+
__exportStar(require("./api.generated"), exports);
|
19
|
+
__exportStar(require("./glossary"), exports);
|
20
20
|
var implementation_generated_1 = require("./implementation.generated");
|
21
21
|
Object.defineProperty(exports, "$r", { enumerable: true, get: function () { return implementation_generated_1.$r; } });
|
package/package.json
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
"license": "TBD",
|
4
4
|
"description": "this library provides functions to build arrays and dictionaries by adding entries/elements one by one",
|
5
5
|
"dependencies": {
|
6
|
-
"glo-pareto-common": "^0.
|
6
|
+
"glo-pareto-common": "^0.20.0",
|
7
7
|
"pareto-core-internals": "^0.13.0"
|
8
8
|
},
|
9
9
|
"files": [
|
@@ -16,6 +16,6 @@
|
|
16
16
|
"main": "dist/index.js",
|
17
17
|
"types": "dist/index.d.ts",
|
18
18
|
"name": "res-pareto-build",
|
19
|
-
"version": "0.
|
20
|
-
"content-fingerprint": "
|
19
|
+
"version": "0.6.0",
|
20
|
+
"content-fingerprint": "5891851e0e7383fbeda0258f4114b84f7c8324c3"
|
21
21
|
}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|