res-pareto-build 0.10.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/api.generated.d.ts +4 -0
- package/dist/glossary/algorithmtypes.generated.d.ts +37 -19
- package/dist/glossary/datatypes.generated.d.ts +22 -5
- package/dist/implementation.generated.js +2 -0
- package/dist/implementations/createArrayBuilder.native.js +15 -10
- package/dist/implementations/createSafeDictionaryBuilder.native.js +32 -27
- package/dist/implementations/createStringBuilder.native.d.ts +2 -0
- package/dist/implementations/createStringBuilder.native.js +22 -0
- 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: {
|
@@ -8,6 +10,7 @@ export declare namespace A {
|
|
8
10
|
type buildUnsafeDictionary = () => g_this.SYNC.A.F.BuildUnsafeDictionary;
|
9
11
|
type createArrayBuilder = () => g_this.ASYNC.A.C.CreateArrayBuilder;
|
10
12
|
type createSafeDictionaryBuilder = ($: g_this.T.DictionaryBuildStrategy) => g_this.ASYNC.A.C.CreateSafeDictionaryBuilder;
|
13
|
+
type createStringBuilder = ($: g_common.T.String) => g_this.ASYNC.A.C.CreateStringBuilder;
|
11
14
|
type createUnsafeDictionaryBuilder = () => g_this.ASYNC.A.C.CreateUnsafeDictionaryBuilder;
|
12
15
|
}
|
13
16
|
export type API = {
|
@@ -16,5 +19,6 @@ export type API = {
|
|
16
19
|
readonly 'buildUnsafeDictionary': A.buildUnsafeDictionary;
|
17
20
|
readonly 'createArrayBuilder': A.createArrayBuilder;
|
18
21
|
readonly 'createSafeDictionaryBuilder': A.createSafeDictionaryBuilder;
|
22
|
+
readonly 'createStringBuilder': A.createStringBuilder;
|
19
23
|
readonly 'createUnsafeDictionaryBuilder': A.createUnsafeDictionaryBuilder;
|
20
24
|
};
|
@@ -2,37 +2,55 @@ 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
|
+
};
|
19
|
+
type StringConsumer<TEndType> = ($: T.String<TEndType>) => void;
|
20
|
+
type StringStreamConsumer<TEndType> = {
|
21
|
+
'data': ($: g_common.T.String) => void;
|
22
|
+
'end': ($: TEndType) => void;
|
18
23
|
};
|
19
24
|
}
|
20
25
|
namespace A {
|
21
26
|
namespace C {
|
22
|
-
type CreateArrayBuilder =
|
23
|
-
|
24
|
-
|
27
|
+
type CreateArrayBuilder = {
|
28
|
+
'construct': <TEndType, TType>($is: {
|
29
|
+
readonly 'handler': ASYNC.I.Array<TEndType, TType>;
|
30
|
+
}) => ASYNC.I.Elements<TEndType, TType>;
|
31
|
+
};
|
32
|
+
}
|
33
|
+
namespace C {
|
34
|
+
type CreateSafeDictionaryBuilder = {
|
35
|
+
'construct': <TEndType, TType>($is: {
|
36
|
+
readonly 'duplicatesHandler': ASYNC.I.DuplicatesHandler;
|
37
|
+
readonly 'handler': ASYNC.I.Dictionary<TEndType, TType>;
|
38
|
+
}) => ASYNC.I.Entries<TEndType, TType>;
|
39
|
+
};
|
25
40
|
}
|
26
41
|
namespace C {
|
27
|
-
type
|
28
|
-
|
29
|
-
|
30
|
-
|
42
|
+
type CreateStringBuilder = {
|
43
|
+
'construct': <TEndType>($is: {
|
44
|
+
readonly 'handler': ASYNC.I.StringConsumer<TEndType>;
|
45
|
+
}) => ASYNC.I.StringStreamConsumer<TEndType>;
|
46
|
+
};
|
31
47
|
}
|
32
48
|
namespace C {
|
33
|
-
type CreateUnsafeDictionaryBuilder =
|
34
|
-
|
35
|
-
|
49
|
+
type CreateUnsafeDictionaryBuilder = {
|
50
|
+
'construct': <TEndType, TType>($is: {
|
51
|
+
readonly 'handler': ASYNC.I.Dictionary<TEndType, TType>;
|
52
|
+
}) => ASYNC.I.Entries<TEndType, TType>;
|
53
|
+
};
|
36
54
|
}
|
37
55
|
}
|
38
56
|
}
|
@@ -43,13 +61,13 @@ export declare namespace SYNC {
|
|
43
61
|
}
|
44
62
|
namespace A {
|
45
63
|
namespace F {
|
46
|
-
type BuildArray = <TType>($c: ($i: SYNC.I.Push<TType>) => void) => T.Array<TType>;
|
64
|
+
type BuildArray = <TType>($c: ($i: SYNC.I.Push<TType>) => void) => g_common.T.Array<TType>;
|
47
65
|
}
|
48
66
|
namespace F {
|
49
|
-
type BuildSafeDictionary = <TType>($c: ($i: SYNC.I.Add<TType>) => void) => T.Dictionary<TType>;
|
67
|
+
type BuildSafeDictionary = <TType>($c: ($i: SYNC.I.Add<TType>) => void) => g_common.T.Dictionary<TType>;
|
50
68
|
}
|
51
69
|
namespace F {
|
52
|
-
type BuildUnsafeDictionary = <TType>($c: ($i: SYNC.I.Add<TType>) => void) => T.Dictionary<TType>;
|
70
|
+
type BuildUnsafeDictionary = <TType>($c: ($i: SYNC.I.Add<TType>) => void) => g_common.T.Dictionary<TType>;
|
53
71
|
}
|
54
72
|
}
|
55
73
|
}
|
@@ -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;
|
@@ -23,4 +32,12 @@ export declare namespace T {
|
|
23
32
|
readonly 'key': string;
|
24
33
|
readonly 'value': TType;
|
25
34
|
};
|
35
|
+
namespace String {
|
36
|
+
type end<TEndType> = TEndType;
|
37
|
+
type _lstring<TEndType> = string;
|
38
|
+
}
|
39
|
+
type String<TEndType> = {
|
40
|
+
readonly 'end': TEndType;
|
41
|
+
readonly 'string': string;
|
42
|
+
};
|
26
43
|
}
|
@@ -6,6 +6,7 @@ const buildSafeDictionary_native_1 = require("./implementations/buildSafeDiction
|
|
6
6
|
const buildUnsafeDictionary_native_1 = require("./implementations/buildUnsafeDictionary.native");
|
7
7
|
const createArrayBuilder_native_1 = require("./implementations/createArrayBuilder.native");
|
8
8
|
const createSafeDictionaryBuilder_native_1 = require("./implementations/createSafeDictionaryBuilder.native");
|
9
|
+
const createStringBuilder_native_1 = require("./implementations/createStringBuilder.native");
|
9
10
|
const createUnsafeDictionaryBuilder_native_1 = require("./implementations/createUnsafeDictionaryBuilder.native");
|
10
11
|
exports.$r = {
|
11
12
|
'buildArray': buildArray_native_1.$$,
|
@@ -13,5 +14,6 @@ exports.$r = {
|
|
13
14
|
'buildUnsafeDictionary': buildUnsafeDictionary_native_1.$$,
|
14
15
|
'createArrayBuilder': createArrayBuilder_native_1.$$,
|
15
16
|
'createSafeDictionaryBuilder': createSafeDictionaryBuilder_native_1.$$,
|
17
|
+
'createStringBuilder': createStringBuilder_native_1.$$,
|
16
18
|
'createUnsafeDictionaryBuilder': createUnsafeDictionaryBuilder_native_1.$$,
|
17
19
|
};
|
@@ -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.$$ = $$;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.$$ = void 0;
|
4
|
+
const $$ = ($c) => {
|
5
|
+
return {
|
6
|
+
'construct': ($is) => {
|
7
|
+
let temp = $c;
|
8
|
+
return {
|
9
|
+
'data': ($) => {
|
10
|
+
temp += $;
|
11
|
+
},
|
12
|
+
'end': ($) => {
|
13
|
+
$is.handler({
|
14
|
+
'string': temp,
|
15
|
+
'end': $,
|
16
|
+
});
|
17
|
+
}
|
18
|
+
};
|
19
|
+
}
|
20
|
+
};
|
21
|
+
};
|
22
|
+
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.12.0",
|
20
|
+
"content-fingerprint": "421d7d800b6fd7f16004729e735e19fe7c2b389b"
|
21
21
|
}
|