res-pareto-build 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,11 +1,18 @@
1
+ import * as g_common from "glo-pareto-common";
1
2
  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;
3
+ export declare namespace A {
4
+ type buildArray = g_this.SYNC.F.BuildArray;
5
+ type createIgnoringDictionaryBuilder = ($d: {}, $se: {
6
+ readonly 'onDuplicate': g_common.SYNC.I.String;
7
+ }) => g_this.SYNC.F.BuildDictionary;
8
+ type createOverwritingDictionaryBuilder = ($d: {}, $se: {
9
+ readonly 'onDuplicate': g_common.SYNC.I.String;
10
+ }) => g_this.SYNC.F.BuildDictionary;
11
+ type unsafeBuildDictionary = g_this.SYNC.F.UnsafeBuildDictionary;
12
+ }
7
13
  export type API = {
8
- buildArray: buildArray;
9
- createDictionaryBuilder: createDictionaryBuilder;
10
- unsafeBuildDictionary: unsafeBuildDictionary;
14
+ buildArray: A.buildArray;
15
+ createIgnoringDictionaryBuilder: A.createIgnoringDictionaryBuilder;
16
+ createOverwritingDictionaryBuilder: A.createOverwritingDictionaryBuilder;
17
+ unsafeBuildDictionary: A.unsafeBuildDictionary;
11
18
  };
@@ -0,0 +1,28 @@
1
+ import { T } from "./datatypes.generated";
2
+ export declare namespace ASYNC {
3
+ namespace I { }
4
+ namespace C { }
5
+ namespace F { }
6
+ }
7
+ export declare namespace SYNC {
8
+ namespace I {
9
+ type Add<GType> = ($: T.KeyValuePair<GType>) => void;
10
+ type Push<GType> = ($: T.Type<GType>) => void;
11
+ }
12
+ namespace I2 {
13
+ type Add<GType> = ($b: I.Add<GType>) => void;
14
+ type Push<GType> = ($b: I.Push<GType>) => void;
15
+ }
16
+ namespace I3 {
17
+ type Add<GType> = ($c: I2.Add<GType>) => void;
18
+ type Push<GType> = ($c: I2.Push<GType>) => void;
19
+ }
20
+ namespace C { }
21
+ namespace C2 { }
22
+ namespace C3 { }
23
+ namespace F {
24
+ type BuildArray = <GType>($c: ($b: I.Push<GType>) => void) => T.Array<GType>;
25
+ 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
+ }
28
+ }
@@ -1,2 +1,2 @@
1
- export * from "./types.generated";
2
- export * from "./public.generated";
1
+ export * from "./datatypes.generated";
2
+ export * from "./algorithmtypes.generated";
@@ -14,5 +14,5 @@ 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
- __exportStar(require("./types.generated"), exports);
18
- __exportStar(require("./public.generated"), exports);
17
+ __exportStar(require("./datatypes.generated"), exports);
18
+ __exportStar(require("./algorithmtypes.generated"), exports);
@@ -2,10 +2,12 @@
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 createDictionaryBuilder_native_1 = require("./implementations/createDictionaryBuilder.native");
5
+ const createIgnoringDictionaryBuilder_native_1 = require("./implementations/createIgnoringDictionaryBuilder.native");
6
+ const createOverwritingDictionaryBuilder_native_1 = require("./implementations/createOverwritingDictionaryBuilder.native");
6
7
  const unsafeBuildDictionary_native_1 = require("./implementations/unsafeBuildDictionary.native");
7
8
  exports.$r = {
8
9
  'buildArray': buildArray_native_1.$$,
9
- 'createDictionaryBuilder': createDictionaryBuilder_native_1.$$,
10
+ 'createIgnoringDictionaryBuilder': createIgnoringDictionaryBuilder_native_1.$$,
11
+ 'createOverwritingDictionaryBuilder': createOverwritingDictionaryBuilder_native_1.$$,
10
12
  'unsafeBuildDictionary': unsafeBuildDictionary_native_1.$$,
11
13
  };
@@ -1,2 +1,2 @@
1
- import { buildArray } from "../api.generated";
2
- export declare const $$: buildArray;
1
+ import { A } from "../api.generated";
2
+ export declare const $$: A.buildArray;
@@ -25,7 +25,7 @@ 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 $$ = ($, $c) => {
28
+ const $$ = ($c) => {
29
29
  const out = [];
30
30
  $c(($) => {
31
31
  out.push($);
@@ -0,0 +1,2 @@
1
+ import { A } from "../api.generated";
2
+ export declare const $$: A.createIgnoringDictionaryBuilder;
@@ -25,31 +25,15 @@ 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 $$ = ($d) => {
29
- return ($, $c) => {
30
- const dbs = $;
28
+ const $$ = ($d, $se) => {
29
+ return ($c) => {
31
30
  const out = {};
32
31
  $c(($) => {
33
32
  if (out[$.key] === undefined) {
34
33
  out[$.key] = $.value;
35
34
  }
36
35
  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
- });
36
+ $se.onDuplicate($.key);
53
37
  }
54
38
  });
55
39
  return pi.wrapRawDictionary(out);
@@ -0,0 +1,2 @@
1
+ import { A } from "../api.generated";
2
+ export declare const $$: A.createOverwritingDictionaryBuilder;
@@ -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 $$ = ($d, $se) => {
29
+ return ($c) => {
30
+ const out = {};
31
+ $c(($) => {
32
+ if (out[$.key] === undefined) {
33
+ out[$.key] = $.value;
34
+ }
35
+ else {
36
+ out[$.key] = $.value;
37
+ $se.onDuplicate($.key);
38
+ }
39
+ });
40
+ return pi.wrapRawDictionary(out);
41
+ };
42
+ };
43
+ exports.$$ = $$;
@@ -1,2 +1,2 @@
1
- import { unsafeBuildDictionary } from "../api.generated";
2
- export declare const $$: unsafeBuildDictionary;
1
+ import { A } from "../api.generated";
2
+ export declare const $$: A.unsafeBuildDictionary;
@@ -25,7 +25,7 @@ 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 $$ = ($, $c) => {
28
+ const $$ = ($c) => {
29
29
  const out = {};
30
30
  $c(($) => {
31
31
  if (out[$.key] !== undefined) {
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.20.0",
6
+ "glo-pareto-common": "^0.22.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.6.0",
20
- "content-fingerprint": "5891851e0e7383fbeda0258f4114b84f7c8324c3"
19
+ "version": "0.7.0",
20
+ "content-fingerprint": "048ec3fd2165a655546f1a78df67e6612de2821c"
21
21
  }
@@ -1,13 +0,0 @@
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
- }
@@ -1,2 +0,0 @@
1
- import { createDictionaryBuilder } from "../api.generated";
2
- export declare const $$: createDictionaryBuilder;