res-pareto-build 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (21) hide show
  1. package/dist/api.generated.d.ts +14 -6
  2. package/dist/glossary/algorithmtypes.generated.d.ts +29 -3
  3. package/dist/implementation.generated.js +14 -6
  4. package/dist/implementations/createAsyncArrayBuilder.native.d.ts +2 -0
  5. package/dist/implementations/createAsyncArrayBuilder.native.js +39 -0
  6. package/dist/implementations/createAsyncIgnoringDictionaryBuilder.native.d.ts +2 -0
  7. package/dist/implementations/createAsyncIgnoringDictionaryBuilder.native.js +45 -0
  8. package/dist/implementations/createAsyncOverwritingDictionaryBuilder.native.d.ts +2 -0
  9. package/dist/implementations/createAsyncOverwritingDictionaryBuilder.native.js +43 -0
  10. package/dist/implementations/createSyncIgnoringDictionaryBuilder.native.d.ts +2 -0
  11. package/dist/implementations/createSyncOverwritingDictionaryBuilder.native.d.ts +2 -0
  12. package/dist/implementations/createUnsafeAsyncDictionaryBuilder.native.d.ts +2 -0
  13. package/dist/implementations/createUnsafeAsyncDictionaryBuilder.native.js +42 -0
  14. package/dist/implementations/unsafeSyncBuildDictionary.native.d.ts +2 -0
  15. package/package.json +3 -3
  16. package/dist/implementations/createIgnoringDictionaryBuilder.native.d.ts +0 -2
  17. package/dist/implementations/createOverwritingDictionaryBuilder.native.d.ts +0 -2
  18. package/dist/implementations/unsafeBuildDictionary.native.d.ts +0 -2
  19. /package/dist/implementations/{createIgnoringDictionaryBuilder.native.js → createSyncIgnoringDictionaryBuilder.native.js} +0 -0
  20. /package/dist/implementations/{createOverwritingDictionaryBuilder.native.js → createSyncOverwritingDictionaryBuilder.native.js} +0 -0
  21. /package/dist/implementations/{unsafeBuildDictionary.native.js → unsafeSyncBuildDictionary.native.js} +0 -0
@@ -2,17 +2,25 @@ import * as g_common from "glo-pareto-common";
2
2
  import * as g_this from "./glossary";
3
3
  export declare namespace A {
4
4
  type buildArray = g_this.SYNC.F.BuildArray;
5
- type createIgnoringDictionaryBuilder = ($d: {}, $se: {
5
+ type createAsyncArrayBuilder = g_this.ASYNC.C.CreateArrayBuilder;
6
+ type createAsyncIgnoringDictionaryBuilder = g_this.ASYNC.C.CreateSafeDictionaryBuilder;
7
+ type createAsyncOverwritingDictionaryBuilder = g_this.ASYNC.C.CreateSafeDictionaryBuilder;
8
+ type createSyncIgnoringDictionaryBuilder = ($d: {}, $se: {
6
9
  readonly 'onDuplicate': g_common.SYNC.I.String;
7
10
  }) => g_this.SYNC.F.BuildDictionary;
8
- type createOverwritingDictionaryBuilder = ($d: {}, $se: {
11
+ type createSyncOverwritingDictionaryBuilder = ($d: {}, $se: {
9
12
  readonly 'onDuplicate': g_common.SYNC.I.String;
10
13
  }) => g_this.SYNC.F.BuildDictionary;
11
- type unsafeBuildDictionary = g_this.SYNC.F.UnsafeBuildDictionary;
14
+ type createUnsafeAsyncDictionaryBuilder = g_this.ASYNC.C.CreateUnsafeDictionaryBuilder;
15
+ type unsafeSyncBuildDictionary = g_this.SYNC.F.BuildDictionary;
12
16
  }
13
17
  export type API = {
14
18
  buildArray: A.buildArray;
15
- createIgnoringDictionaryBuilder: A.createIgnoringDictionaryBuilder;
16
- createOverwritingDictionaryBuilder: A.createOverwritingDictionaryBuilder;
17
- unsafeBuildDictionary: A.unsafeBuildDictionary;
19
+ createAsyncArrayBuilder: A.createAsyncArrayBuilder;
20
+ createAsyncIgnoringDictionaryBuilder: A.createAsyncIgnoringDictionaryBuilder;
21
+ createAsyncOverwritingDictionaryBuilder: A.createAsyncOverwritingDictionaryBuilder;
22
+ createSyncIgnoringDictionaryBuilder: A.createSyncIgnoringDictionaryBuilder;
23
+ createSyncOverwritingDictionaryBuilder: A.createSyncOverwritingDictionaryBuilder;
24
+ createUnsafeAsyncDictionaryBuilder: A.createUnsafeAsyncDictionaryBuilder;
25
+ unsafeSyncBuildDictionary: A.unsafeSyncBuildDictionary;
18
26
  };
@@ -1,7 +1,34 @@
1
1
  import { T } from "./datatypes.generated";
2
+ import * as g_common from "glo-pareto-common";
2
3
  export declare namespace ASYNC {
3
- namespace I { }
4
- namespace C { }
4
+ namespace I {
5
+ type Array<GType> = ($: T.Array<GType>) => void;
6
+ type Dictionary<GType> = ($: T.Dictionary<GType>) => void;
7
+ type DuplicatesHandler<GType> = {
8
+ 'data': ($: g_common.T.String) => void;
9
+ 'end': () => void;
10
+ };
11
+ type Elements<GType> = {
12
+ 'data': ($: T.Type<GType>) => void;
13
+ 'end': () => void;
14
+ };
15
+ type Entries<GType> = {
16
+ 'data': ($: T.KeyValuePair<GType>) => void;
17
+ 'end': () => void;
18
+ };
19
+ }
20
+ namespace C {
21
+ type CreateArrayBuilder = <GType>($is: {
22
+ 'handler': I.Array<GType>;
23
+ }) => I.Elements<GType>;
24
+ type CreateSafeDictionaryBuilder = <GType>($is: {
25
+ 'duplicatesHandler': I.DuplicatesHandler<GType>;
26
+ 'handler': I.Dictionary<GType>;
27
+ }) => I.Entries<GType>;
28
+ type CreateUnsafeDictionaryBuilder = <GType>($is: {
29
+ 'handler': I.Dictionary<GType>;
30
+ }) => I.Entries<GType>;
31
+ }
5
32
  namespace F { }
6
33
  }
7
34
  export declare namespace SYNC {
@@ -23,6 +50,5 @@ export declare namespace SYNC {
23
50
  namespace F {
24
51
  type BuildArray = <GType>($c: ($b: I.Push<GType>) => void) => T.Array<GType>;
25
52
  type BuildDictionary = <GType>($c: ($b: I.Add<GType>) => void) => T.Dictionary<GType>;
26
- type UnsafeBuildDictionary = <GType>($c: ($b: I.Add<GType>) => void) => T.Dictionary<GType>;
27
53
  }
28
54
  }
@@ -2,12 +2,20 @@
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 createIgnoringDictionaryBuilder_native_1 = require("./implementations/createIgnoringDictionaryBuilder.native");
6
- const createOverwritingDictionaryBuilder_native_1 = require("./implementations/createOverwritingDictionaryBuilder.native");
7
- const unsafeBuildDictionary_native_1 = require("./implementations/unsafeBuildDictionary.native");
5
+ const createAsyncArrayBuilder_native_1 = require("./implementations/createAsyncArrayBuilder.native");
6
+ const createAsyncIgnoringDictionaryBuilder_native_1 = require("./implementations/createAsyncIgnoringDictionaryBuilder.native");
7
+ const createAsyncOverwritingDictionaryBuilder_native_1 = require("./implementations/createAsyncOverwritingDictionaryBuilder.native");
8
+ const createSyncIgnoringDictionaryBuilder_native_1 = require("./implementations/createSyncIgnoringDictionaryBuilder.native");
9
+ const createSyncOverwritingDictionaryBuilder_native_1 = require("./implementations/createSyncOverwritingDictionaryBuilder.native");
10
+ const createUnsafeAsyncDictionaryBuilder_native_1 = require("./implementations/createUnsafeAsyncDictionaryBuilder.native");
11
+ const unsafeSyncBuildDictionary_native_1 = require("./implementations/unsafeSyncBuildDictionary.native");
8
12
  exports.$r = {
9
13
  'buildArray': buildArray_native_1.$$,
10
- 'createIgnoringDictionaryBuilder': createIgnoringDictionaryBuilder_native_1.$$,
11
- 'createOverwritingDictionaryBuilder': createOverwritingDictionaryBuilder_native_1.$$,
12
- 'unsafeBuildDictionary': unsafeBuildDictionary_native_1.$$,
14
+ 'createAsyncArrayBuilder': createAsyncArrayBuilder_native_1.$$,
15
+ 'createAsyncIgnoringDictionaryBuilder': createAsyncIgnoringDictionaryBuilder_native_1.$$,
16
+ 'createAsyncOverwritingDictionaryBuilder': createAsyncOverwritingDictionaryBuilder_native_1.$$,
17
+ 'createSyncIgnoringDictionaryBuilder': createSyncIgnoringDictionaryBuilder_native_1.$$,
18
+ 'createSyncOverwritingDictionaryBuilder': createSyncOverwritingDictionaryBuilder_native_1.$$,
19
+ 'createUnsafeAsyncDictionaryBuilder': createUnsafeAsyncDictionaryBuilder_native_1.$$,
20
+ 'unsafeSyncBuildDictionary': unsafeSyncBuildDictionary_native_1.$$,
13
21
  };
@@ -0,0 +1,2 @@
1
+ import { A } from "../api.generated";
2
+ export declare const $$: A.createAsyncArrayBuilder;
@@ -0,0 +1,39 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.$$ = void 0;
27
+ const pi = __importStar(require("pareto-core-internals"));
28
+ const $$ = ($is) => {
29
+ const arr = [];
30
+ return {
31
+ 'data': ($) => {
32
+ arr.push($);
33
+ },
34
+ 'end': () => {
35
+ $is.handler(pi.wrapRawArray(arr));
36
+ }
37
+ };
38
+ };
39
+ exports.$$ = $$;
@@ -0,0 +1,2 @@
1
+ import { A } from "../api.generated";
2
+ export declare const $$: A.createAsyncIgnoringDictionaryBuilder;
@@ -0,0 +1,45 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.$$ = void 0;
27
+ const pi = __importStar(require("pareto-core-internals"));
28
+ const $$ = ($is) => {
29
+ const dict = {};
30
+ return {
31
+ 'data': ($) => {
32
+ if (dict[$.key] !== undefined) {
33
+ $is.duplicatesHandler.data($.key);
34
+ }
35
+ else {
36
+ dict[$.key] = $.value;
37
+ }
38
+ },
39
+ 'end': () => {
40
+ $is.handler(pi.wrapRawDictionary(dict));
41
+ $is.duplicatesHandler.end();
42
+ }
43
+ };
44
+ };
45
+ exports.$$ = $$;
@@ -0,0 +1,2 @@
1
+ import { A } from "../api.generated";
2
+ export declare const $$: A.createAsyncOverwritingDictionaryBuilder;
@@ -0,0 +1,43 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.$$ = void 0;
27
+ const pi = __importStar(require("pareto-core-internals"));
28
+ const $$ = ($is) => {
29
+ const dict = {};
30
+ return {
31
+ 'data': ($) => {
32
+ if (dict[$.key] !== undefined) {
33
+ $is.duplicatesHandler.data($.key);
34
+ }
35
+ dict[$.key] = $.value;
36
+ },
37
+ 'end': () => {
38
+ $is.handler(pi.wrapRawDictionary(dict));
39
+ $is.duplicatesHandler.end();
40
+ }
41
+ };
42
+ };
43
+ exports.$$ = $$;
@@ -0,0 +1,2 @@
1
+ import { A } from "../api.generated";
2
+ export declare const $$: A.createSyncIgnoringDictionaryBuilder;
@@ -0,0 +1,2 @@
1
+ import { A } from "../api.generated";
2
+ export declare const $$: A.createSyncOverwritingDictionaryBuilder;
@@ -0,0 +1,2 @@
1
+ import { A } from "../api.generated";
2
+ export declare const $$: A.createUnsafeAsyncDictionaryBuilder;
@@ -0,0 +1,42 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.$$ = void 0;
27
+ const pi = __importStar(require("pareto-core-internals"));
28
+ const $$ = ($is) => {
29
+ const dict = {};
30
+ return {
31
+ 'data': ($) => {
32
+ if (dict[$.key] !== undefined) {
33
+ pi.panic(`duplicate key: ${$.key}`);
34
+ }
35
+ dict[$.key] = $.value;
36
+ },
37
+ 'end': () => {
38
+ $is.handler(pi.wrapRawDictionary(dict));
39
+ }
40
+ };
41
+ };
42
+ exports.$$ = $$;
@@ -0,0 +1,2 @@
1
+ import { A } from "../api.generated";
2
+ export declare const $$: A.unsafeSyncBuildDictionary;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "description": "this library provides functions to build arrays and dictionaries by adding entries/elements one by one",
5
5
  "dependencies": {
6
6
  "glo-pareto-common": "^0.22.0",
7
- "pareto-core-internals": "^0.13.0"
7
+ "pareto-core-internals": "^0.13.2"
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.7.0",
20
- "content-fingerprint": "048ec3fd2165a655546f1a78df67e6612de2821c"
19
+ "version": "0.8.0",
20
+ "content-fingerprint": "ce4db0da70a210f780601c97f8c7c823b7f0c97f"
21
21
  }
@@ -1,2 +0,0 @@
1
- import { A } from "../api.generated";
2
- export declare const $$: A.createIgnoringDictionaryBuilder;
@@ -1,2 +0,0 @@
1
- import { A } from "../api.generated";
2
- export declare const $$: A.createOverwritingDictionaryBuilder;
@@ -1,2 +0,0 @@
1
- import { A } from "../api.generated";
2
- export declare const $$: A.unsafeBuildDictionary;