res-pareto-build 0.4.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/api.generated.d.ts +11 -0
- package/dist/glossary/public.generated.d.ts +13 -0
- package/dist/glossary/types.generated.d.ts +27 -0
- package/dist/implementation.generated.d.ts +2 -2
- package/dist/implementation.generated.js +4 -4
- package/dist/implementations/buildArray.native.d.ts +2 -2
- 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 +2 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +4 -3
- package/package.json +3 -3
- package/dist/api/api.generated.d.ts +0 -9
- package/dist/api/glossary/public.generated.d.ts +0 -8
- package/dist/api/glossary/types.generated.d.ts +0 -27
- package/dist/api/index.d.ts +0 -2
- package/dist/api/index.js +0 -18
- package/dist/implementations/buildDictionary.native.d.ts +0 -2
- /package/dist/{api/api.generated.js → api.generated.js} +0 -0
- /package/dist/{api/glossary → glossary}/index.d.ts +0 -0
- /package/dist/{api/glossary → glossary}/index.js +0 -0
- /package/dist/{api/glossary → glossary}/public.generated.js +0 -0
- /package/dist/{api/glossary → glossary}/types.generated.js +0 -0
@@ -0,0 +1,11 @@
|
|
1
|
+
import * as g_this from "./glossary";
|
2
|
+
export type buildArray = g_this.F.BuildArray;
|
3
|
+
export type createDictionaryBuilder = ($d: {
|
4
|
+
readonly 'onDuplicate': g_this.F.OnDuplicate;
|
5
|
+
}) => g_this.F.BuildDictionary;
|
6
|
+
export type unsafeBuildDictionary = g_this.F.UnsafeBuildDictionary;
|
7
|
+
export type API = {
|
8
|
+
buildArray: buildArray;
|
9
|
+
createDictionaryBuilder: createDictionaryBuilder;
|
10
|
+
unsafeBuildDictionary: unsafeBuildDictionary;
|
11
|
+
};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { T } from './types.generated';
|
2
|
+
import * as g_common from "glo-pareto-common";
|
3
|
+
export declare namespace B {
|
4
|
+
type Add<GType> = ($: T.KeyValuePair<GType>) => void;
|
5
|
+
type OnDuplicate<GType> = ($: g_common.T.String) => void;
|
6
|
+
type Push<GType> = ($: T.Type<GType>) => void;
|
7
|
+
}
|
8
|
+
export declare namespace F {
|
9
|
+
type BuildArray = <GType>($: g_common.T.Null, $c: ($b: B.Push<GType>) => void) => T.Array<GType>;
|
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
|
+
type UnsafeBuildDictionary = <GType>($: g_common.T.Null, $c: ($b: B.Add<GType>) => void) => T.Dictionary<GType>;
|
13
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import * as pt from 'pareto-core-types';
|
2
|
+
export declare namespace T {
|
3
|
+
namespace Array {
|
4
|
+
type A<GType> = GType;
|
5
|
+
}
|
6
|
+
type Array<GType> = pt.Array<GType>;
|
7
|
+
namespace Dictionary {
|
8
|
+
type D<GType> = GType;
|
9
|
+
}
|
10
|
+
type Dictionary<GType> = pt.Dictionary<GType>;
|
11
|
+
namespace DictionaryBuildStrategy {
|
12
|
+
namespace ignore { }
|
13
|
+
type ignore<GType> = null;
|
14
|
+
namespace overwrite { }
|
15
|
+
type overwrite<GType> = null;
|
16
|
+
}
|
17
|
+
type DictionaryBuildStrategy<GType> = ['ignore', null] | ['overwrite', null];
|
18
|
+
namespace KeyValuePair {
|
19
|
+
type key<GType> = string;
|
20
|
+
type value<GType> = GType;
|
21
|
+
}
|
22
|
+
type KeyValuePair<GType> = {
|
23
|
+
readonly 'key': string;
|
24
|
+
readonly 'value': GType;
|
25
|
+
};
|
26
|
+
type Type<GType> = GType;
|
27
|
+
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { API } from "./api";
|
2
|
-
export declare const $
|
1
|
+
import { API } from "./api.generated";
|
2
|
+
export declare const $r: API;
|
@@ -1,11 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.$
|
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
|
-
exports.$
|
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 {
|
2
|
-
export declare const $$:
|
1
|
+
import { buildArray } from "../api.generated";
|
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 {
|
2
|
-
export declare const $$:
|
1
|
+
import { unsafeBuildDictionary } from "../api.generated";
|
2
|
+
export declare const $$: unsafeBuildDictionary;
|
package/dist/index.d.ts
CHANGED
@@ -1,2 +1,3 @@
|
|
1
|
-
export * from "./api";
|
2
|
-
export
|
1
|
+
export * from "./api.generated";
|
2
|
+
export * from "./glossary";
|
3
|
+
export { $r } from "./implementation.generated";
|
package/dist/index.js
CHANGED
@@ -14,7 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
15
|
};
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
exports.$
|
18
|
-
__exportStar(require("./api"), exports);
|
17
|
+
exports.$r = void 0;
|
18
|
+
__exportStar(require("./api.generated"), exports);
|
19
|
+
__exportStar(require("./glossary"), exports);
|
19
20
|
var implementation_generated_1 = require("./implementation.generated");
|
20
|
-
Object.defineProperty(exports, "$
|
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
|
}
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import * as gglo from "./glossary";
|
2
|
-
export type CbuildArray = gglo.FBuildArray;
|
3
|
-
export type CbuildDictionary = gglo.FBuildDictionary;
|
4
|
-
export type CunsafeBuildDictionary = gglo.FUnsafeBuildDictionary;
|
5
|
-
export type API = {
|
6
|
-
buildArray: CbuildArray;
|
7
|
-
buildDictionary: CbuildDictionary;
|
8
|
-
unsafeBuildDictionary: CunsafeBuildDictionary;
|
9
|
-
};
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import { T } from './types.generated';
|
2
|
-
import * as gcommon from "glo-pareto-common";
|
3
|
-
export type IAdd<GPType> = ($: T.KeyValuePair<GPType>) => void;
|
4
|
-
export type IOnDuplicate<GPType> = ($: gcommon.T.String) => void;
|
5
|
-
export type IPush<GPType> = ($: T.Type<GPType>) => void;
|
6
|
-
export type FBuildArray = <GPType>($: gcommon.T.Null, $c: ($i: IPush<GPType>) => void) => T.Array<GPType>;
|
7
|
-
export type FBuildDictionary = <GPType>($: T.DictionaryBuildStrategy<GPType>, $c: ($i: IAdd<GPType>) => void, $i: IOnDuplicate<GPType>) => T.Dictionary<GPType>;
|
8
|
-
export type FUnsafeBuildDictionary = <GPType>($: gcommon.T.Null, $c: ($i: IAdd<GPType>) => void) => T.Dictionary<GPType>;
|
@@ -1,27 +0,0 @@
|
|
1
|
-
import * as pt from 'pareto-core-types';
|
2
|
-
export declare namespace T {
|
3
|
-
namespace Array {
|
4
|
-
type A<GPType> = GPType;
|
5
|
-
}
|
6
|
-
type Array<GPType> = pt.Array<GPType>;
|
7
|
-
namespace Dictionary {
|
8
|
-
type D<GPType> = GPType;
|
9
|
-
}
|
10
|
-
type Dictionary<GPType> = pt.Dictionary<GPType>;
|
11
|
-
namespace DictionaryBuildStrategy {
|
12
|
-
namespace ignore { }
|
13
|
-
type ignore<GPType> = {};
|
14
|
-
namespace overwrite { }
|
15
|
-
type overwrite<GPType> = {};
|
16
|
-
}
|
17
|
-
type DictionaryBuildStrategy<GPType> = ['ignore', {}] | ['overwrite', {}];
|
18
|
-
namespace KeyValuePair {
|
19
|
-
type key<GPType> = string;
|
20
|
-
type value<GPType> = GPType;
|
21
|
-
}
|
22
|
-
type KeyValuePair<GPType> = {
|
23
|
-
readonly 'key': string;
|
24
|
-
readonly 'value': GPType;
|
25
|
-
};
|
26
|
-
type Type<GPType> = GPType;
|
27
|
-
}
|
package/dist/api/index.d.ts
DELETED
package/dist/api/index.js
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
-
};
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
__exportStar(require("./glossary"), exports);
|
18
|
-
__exportStar(require("./api.generated"), exports);
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|