res-pareto-build 0.10.0 → 0.11.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/api.generated.d.ts +2 -0
- package/dist/glossary/algorithmtypes.generated.d.ts +25 -19
- package/dist/glossary/datatypes.generated.d.ts +14 -5
- package/dist/implementations/createArrayBuilder.native.js +15 -10
- package/dist/implementations/createSafeDictionaryBuilder.native.js +32 -27
- package/dist/implementations/createUnsafeDictionaryBuilder.native.js +17 -12
- package/package.json +4 -4
package/dist/api.generated.d.ts
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
import * as g_common from "glo-pareto-common";
|
2
2
|
import * as g_this from "./glossary";
|
3
|
+
export declare namespace D {
|
4
|
+
}
|
3
5
|
export declare namespace A {
|
4
6
|
type buildArray = () => g_this.SYNC.A.F.BuildArray;
|
5
7
|
type buildSafeDictionary = ($: g_this.T.DictionaryBuildStrategy, $se: {
|
@@ -2,37 +2,43 @@ import { T } from "./datatypes.generated";
|
|
2
2
|
import * as g_common from "glo-pareto-common";
|
3
3
|
export declare namespace ASYNC {
|
4
4
|
namespace I {
|
5
|
-
type Array<TType> = ($: T.Array<TType>) => void;
|
6
|
-
type Dictionary<TType> = ($: T.Dictionary<TType>) => void;
|
5
|
+
type Array<TEndType, TType> = ($: T.Array<TEndType, TType>) => void;
|
6
|
+
type Dictionary<TEndType, TType> = ($: T.Dictionary<TEndType, TType>) => void;
|
7
7
|
type DuplicatesHandler = {
|
8
8
|
'data': ($: g_common.T.String) => void;
|
9
9
|
'end': () => void;
|
10
10
|
};
|
11
|
-
type Elements<TType> = {
|
11
|
+
type Elements<TEndType, TType> = {
|
12
12
|
'data': ($: TType) => void;
|
13
|
-
'end': () => void;
|
13
|
+
'end': ($: TEndType) => void;
|
14
14
|
};
|
15
|
-
type Entries<TType> = {
|
15
|
+
type Entries<TEndType, TType> = {
|
16
16
|
'data': ($: T.KeyValuePair<TType>) => void;
|
17
|
-
'end': () => void;
|
17
|
+
'end': ($: TEndType) => void;
|
18
18
|
};
|
19
19
|
}
|
20
20
|
namespace A {
|
21
21
|
namespace C {
|
22
|
-
type CreateArrayBuilder =
|
23
|
-
|
24
|
-
|
22
|
+
type CreateArrayBuilder = {
|
23
|
+
'construct': <TEndType, TType>($is: {
|
24
|
+
readonly 'handler': ASYNC.I.Array<TEndType, TType>;
|
25
|
+
}) => ASYNC.I.Elements<TEndType, TType>;
|
26
|
+
};
|
25
27
|
}
|
26
28
|
namespace C {
|
27
|
-
type CreateSafeDictionaryBuilder =
|
28
|
-
|
29
|
-
|
30
|
-
|
29
|
+
type CreateSafeDictionaryBuilder = {
|
30
|
+
'construct': <TEndType, TType>($is: {
|
31
|
+
readonly 'duplicatesHandler': ASYNC.I.DuplicatesHandler;
|
32
|
+
readonly 'handler': ASYNC.I.Dictionary<TEndType, TType>;
|
33
|
+
}) => ASYNC.I.Entries<TEndType, TType>;
|
34
|
+
};
|
31
35
|
}
|
32
36
|
namespace C {
|
33
|
-
type CreateUnsafeDictionaryBuilder =
|
34
|
-
|
35
|
-
|
37
|
+
type CreateUnsafeDictionaryBuilder = {
|
38
|
+
'construct': <TEndType, TType>($is: {
|
39
|
+
readonly 'handler': ASYNC.I.Dictionary<TEndType, TType>;
|
40
|
+
}) => ASYNC.I.Entries<TEndType, TType>;
|
41
|
+
};
|
36
42
|
}
|
37
43
|
}
|
38
44
|
}
|
@@ -43,13 +49,13 @@ export declare namespace SYNC {
|
|
43
49
|
}
|
44
50
|
namespace A {
|
45
51
|
namespace F {
|
46
|
-
type BuildArray = <TType>($c: ($i: SYNC.I.Push<TType>) => void) => T.Array<TType>;
|
52
|
+
type BuildArray = <TType>($c: ($i: SYNC.I.Push<TType>) => void) => g_common.T.Array<TType>;
|
47
53
|
}
|
48
54
|
namespace F {
|
49
|
-
type BuildSafeDictionary = <TType>($c: ($i: SYNC.I.Add<TType>) => void) => T.Dictionary<TType>;
|
55
|
+
type BuildSafeDictionary = <TType>($c: ($i: SYNC.I.Add<TType>) => void) => g_common.T.Dictionary<TType>;
|
50
56
|
}
|
51
57
|
namespace F {
|
52
|
-
type BuildUnsafeDictionary = <TType>($c: ($i: SYNC.I.Add<TType>) => void) => T.Dictionary<TType>;
|
58
|
+
type BuildUnsafeDictionary = <TType>($c: ($i: SYNC.I.Add<TType>) => void) => g_common.T.Dictionary<TType>;
|
53
59
|
}
|
54
60
|
}
|
55
61
|
}
|
@@ -1,13 +1,22 @@
|
|
1
|
-
import * as
|
1
|
+
import * as g_common from "glo-pareto-common";
|
2
|
+
export declare namespace N { }
|
2
3
|
export declare namespace T {
|
3
4
|
namespace Array {
|
4
|
-
type
|
5
|
+
type array<TEndType, TType> = g_common.T.Array<TType>;
|
6
|
+
type end<TEndType, TType> = TEndType;
|
5
7
|
}
|
6
|
-
type Array<TType> =
|
8
|
+
type Array<TEndType, TType> = {
|
9
|
+
readonly 'array': g_common.T.Array<TType>;
|
10
|
+
readonly 'end': TEndType;
|
11
|
+
};
|
7
12
|
namespace Dictionary {
|
8
|
-
type
|
13
|
+
type dictionary<TEndType, TType> = g_common.T.Dictionary<TType>;
|
14
|
+
type end<TEndType, TType> = TEndType;
|
9
15
|
}
|
10
|
-
type Dictionary<TType> =
|
16
|
+
type Dictionary<TEndType, TType> = {
|
17
|
+
readonly 'dictionary': g_common.T.Dictionary<TType>;
|
18
|
+
readonly 'end': TEndType;
|
19
|
+
};
|
11
20
|
namespace DictionaryBuildStrategy {
|
12
21
|
namespace ignore { }
|
13
22
|
type ignore = null;
|
@@ -26,16 +26,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.$$ = void 0;
|
27
27
|
const pi = __importStar(require("pareto-core-internals"));
|
28
28
|
const $$ = () => {
|
29
|
-
return
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
$
|
37
|
-
|
38
|
-
|
29
|
+
return {
|
30
|
+
'construct': ($is) => {
|
31
|
+
const arr = [];
|
32
|
+
return {
|
33
|
+
'data': ($) => {
|
34
|
+
arr.push($);
|
35
|
+
},
|
36
|
+
'end': ($) => {
|
37
|
+
$is.handler({
|
38
|
+
'end': $,
|
39
|
+
'array': pi.wrapRawArray(arr)
|
40
|
+
});
|
41
|
+
}
|
42
|
+
};
|
43
|
+
}
|
39
44
|
};
|
40
45
|
};
|
41
46
|
exports.$$ = $$;
|
@@ -26,35 +26,40 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.$$ = void 0;
|
27
27
|
const pi = __importStar(require("pareto-core-internals"));
|
28
28
|
const $$ = ($c) => {
|
29
|
-
return
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
29
|
+
return {
|
30
|
+
'construct': ($is) => {
|
31
|
+
const dict = {};
|
32
|
+
return {
|
33
|
+
'data': ($) => {
|
34
|
+
if (dict[$.key] !== undefined) {
|
35
|
+
const x = $;
|
36
|
+
switch ($c[0]) {
|
37
|
+
case 'ignore':
|
38
|
+
pi.cc($c[1], ($) => {
|
39
|
+
});
|
40
|
+
break;
|
41
|
+
case 'overwrite':
|
42
|
+
pi.cc($c[1], ($) => {
|
43
|
+
dict[x.key] = x.value;
|
44
|
+
});
|
45
|
+
break;
|
46
|
+
default: pi.au($c[0]);
|
47
|
+
}
|
48
|
+
$is.duplicatesHandler.data($.key);
|
46
49
|
}
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
50
|
+
else {
|
51
|
+
dict[$.key] = $.value;
|
52
|
+
}
|
53
|
+
},
|
54
|
+
'end': ($) => {
|
55
|
+
$is.handler({
|
56
|
+
'dictionary': pi.wrapRawDictionary(dict),
|
57
|
+
'end': $,
|
58
|
+
});
|
59
|
+
$is.duplicatesHandler.end();
|
51
60
|
}
|
52
|
-
}
|
53
|
-
|
54
|
-
$is.handler(pi.wrapRawDictionary(dict));
|
55
|
-
$is.duplicatesHandler.end();
|
56
|
-
}
|
57
|
-
};
|
61
|
+
};
|
62
|
+
}
|
58
63
|
};
|
59
64
|
};
|
60
65
|
exports.$$ = $$;
|
@@ -26,19 +26,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.$$ = void 0;
|
27
27
|
const pi = __importStar(require("pareto-core-internals"));
|
28
28
|
const $$ = () => {
|
29
|
-
return
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
29
|
+
return {
|
30
|
+
'construct': ($is) => {
|
31
|
+
const dict = {};
|
32
|
+
return {
|
33
|
+
'data': ($) => {
|
34
|
+
if (dict[$.key] !== undefined) {
|
35
|
+
pi.panic(`duplicate key: ${$.key}`);
|
36
|
+
}
|
37
|
+
dict[$.key] = $.value;
|
38
|
+
},
|
39
|
+
'end': ($) => {
|
40
|
+
$is.handler({
|
41
|
+
'dictionary': pi.wrapRawDictionary(dict),
|
42
|
+
'end': $
|
43
|
+
});
|
35
44
|
}
|
36
|
-
|
37
|
-
|
38
|
-
'end': () => {
|
39
|
-
$is.handler(pi.wrapRawDictionary(dict));
|
40
|
-
}
|
41
|
-
};
|
45
|
+
};
|
46
|
+
}
|
42
47
|
};
|
43
48
|
};
|
44
49
|
exports.$$ = $$;
|
package/package.json
CHANGED
@@ -3,8 +3,8 @@
|
|
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.
|
7
|
-
"pareto-core-internals": "^0.13.
|
6
|
+
"glo-pareto-common": "^0.28.0",
|
7
|
+
"pareto-core-internals": "^0.13.4"
|
8
8
|
},
|
9
9
|
"files": [
|
10
10
|
"dist"
|
@@ -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.11.0",
|
20
|
+
"content-fingerprint": "12ff37e1a36c0f336eedf4891c3d4e189f76cca7"
|
21
21
|
}
|