@zimtsui/iterflow 0.0.8 → 0.0.9
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/README.md +49 -57
- package/build/evaluation.d.ts +15 -0
- package/build/evaluation.js +25 -0
- package/build/evaluation.js.map +1 -0
- package/build/exports.d.ts +3 -1
- package/build/exports.js +3 -1
- package/build/exports.js.map +1 -1
- package/build/opteva.d.ts +3 -72
- package/build/opteva.js +13 -291
- package/build/opteva.js.map +1 -1
- package/build/optimization.d.ts +29 -0
- package/build/optimization.js +72 -0
- package/build/optimization.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/types.d.ts +23 -0
- package/build/types.js +40 -0
- package/build/types.js.map +1 -0
- package/package.json +5 -2
- package/test/test.ts +229 -0
- package/test/tsconfig.json +29 -0
- package/build/exceptions.d.ts +0 -8
- package/build/exceptions.js +0 -13
- package/build/exceptions.js.map +0 -1
- package/build/test.d.ts +0 -1
- package/build/test.js +0 -281
- package/build/test.js.map +0 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Draft, Rejection, Opposition } from './types.ts';
|
|
2
|
+
export interface Optimization<in out draft, in out rejection, in out opposition> extends AsyncDisposable, Optimization.View<draft, rejection, opposition> {
|
|
3
|
+
}
|
|
4
|
+
export declare namespace Optimization {
|
|
5
|
+
/**
|
|
6
|
+
* First yield must be a draft.
|
|
7
|
+
*/
|
|
8
|
+
type Generator<draft, rejection, opposition> = AsyncGenerator<Draft<draft> | Opposition<opposition>, never, Rejection<rejection>>;
|
|
9
|
+
function from<draft, rejection, opposition>(optgen: Optimization.Generator<draft, rejection, opposition>): Optimization<draft, rejection, opposition>;
|
|
10
|
+
class Instance<in out draft, in out rejection, in out opposition> implements Optimization<draft, rejection, opposition> {
|
|
11
|
+
protected it: AsyncGenerator<Draft<draft> | Opposition<opposition>, never, Rejection<rejection> | void>;
|
|
12
|
+
/**
|
|
13
|
+
* @param optgen Ownership transferred.
|
|
14
|
+
*/
|
|
15
|
+
constructor(optgen: Optimization.Generator<draft, rejection, opposition>);
|
|
16
|
+
repeat(): Promise<Draft<draft>>;
|
|
17
|
+
reject(rejection: Rejection<rejection>): Promise<Draft<draft> | Opposition<opposition>>;
|
|
18
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* @param optgen Ownership transferred.
|
|
21
|
+
*/
|
|
22
|
+
protected static iterate<draft, rejection, opposition>(optgen: Optimization.Generator<draft, rejection, opposition>): AsyncGenerator<Draft<draft> | Opposition<opposition>, never, Rejection<rejection> | void>;
|
|
23
|
+
}
|
|
24
|
+
function map<draft, nextdraft, rejection, opposition>(optview: Optimization.View<draft, rejection, opposition>, f: (draft: draft) => Promise<nextdraft>): Optimization.View<nextdraft, rejection, opposition>;
|
|
25
|
+
interface View<in out draft, in out rejection, in out opposition> {
|
|
26
|
+
repeat(): Promise<Draft<draft>>;
|
|
27
|
+
reject(rejection: Rejection<rejection>): Promise<Draft<draft> | Opposition<opposition>>;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Draft, Rejection, Opposition } from "./types.js";
|
|
2
|
+
export var Optimization;
|
|
3
|
+
(function (Optimization) {
|
|
4
|
+
function from(optgen) {
|
|
5
|
+
return new Optimization.Instance(optgen);
|
|
6
|
+
}
|
|
7
|
+
Optimization.from = from;
|
|
8
|
+
class Instance {
|
|
9
|
+
it;
|
|
10
|
+
/**
|
|
11
|
+
* @param optgen Ownership transferred.
|
|
12
|
+
*/
|
|
13
|
+
constructor(optgen) {
|
|
14
|
+
this.it = Instance.iterate(optgen);
|
|
15
|
+
}
|
|
16
|
+
async repeat() {
|
|
17
|
+
const output = await this.it.next().then(r => r.value);
|
|
18
|
+
if (output instanceof Draft) { }
|
|
19
|
+
else
|
|
20
|
+
throw new Error();
|
|
21
|
+
return output;
|
|
22
|
+
}
|
|
23
|
+
async reject(rejection) {
|
|
24
|
+
return await this.it.next(rejection).then(r => r.value);
|
|
25
|
+
}
|
|
26
|
+
async [Symbol.asyncDispose]() {
|
|
27
|
+
await this.it[Symbol.asyncDispose]?.();
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @param optgen Ownership transferred.
|
|
31
|
+
*/
|
|
32
|
+
static async *iterate(optgen) {
|
|
33
|
+
try {
|
|
34
|
+
let output = await optgen.next().then(r => r.value);
|
|
35
|
+
if (output instanceof Draft) { }
|
|
36
|
+
else
|
|
37
|
+
throw new Error();
|
|
38
|
+
let draft = output;
|
|
39
|
+
for (;;) {
|
|
40
|
+
const input = yield output;
|
|
41
|
+
if (input instanceof Rejection) {
|
|
42
|
+
output = await optgen.next(input).then(r => r.value);
|
|
43
|
+
if (output instanceof Draft)
|
|
44
|
+
draft = output;
|
|
45
|
+
}
|
|
46
|
+
else
|
|
47
|
+
output = draft;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
finally {
|
|
51
|
+
await optgen[Symbol.asyncDispose]?.();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
Optimization.Instance = Instance;
|
|
56
|
+
function map(optview, f) {
|
|
57
|
+
async function* nextoptgen() {
|
|
58
|
+
let nextoutput = new Draft(await f(await optview.repeat().then(r => r.extract())));
|
|
59
|
+
for (;;) {
|
|
60
|
+
const rejection = yield nextoutput;
|
|
61
|
+
const output = await optview.reject(rejection);
|
|
62
|
+
if (output instanceof Draft)
|
|
63
|
+
nextoutput = new Draft(await f(output.extract()));
|
|
64
|
+
else
|
|
65
|
+
nextoutput = output;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return Optimization.from(nextoptgen());
|
|
69
|
+
}
|
|
70
|
+
Optimization.map = map;
|
|
71
|
+
})(Optimization || (Optimization = {}));
|
|
72
|
+
//# sourceMappingURL=optimization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"optimization.js","sourceRoot":"","sources":["../src/optimization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAS1D,MAAM,KAAW,YAAY,CA0F5B;AA1FD,WAAiB,YAAY;IAUzB,SAAgB,IAAI,CAChB,MAA4D;QAE5D,OAAO,IAAI,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;IAJe,iBAAI,OAInB,CAAA;IAGD,MAAa,QAAQ;QACP,EAAE,CAA4F;QAExG;;UAEE;QACF,YAAmB,MAA4D;YAC3E,IAAI,CAAC,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACvC,CAAC;QAEM,KAAK,CAAC,MAAM;YACf,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACvD,IAAI,MAAM,YAAY,KAAK,EAAE,CAAC,CAAA,CAAC;;gBAAM,MAAM,IAAI,KAAK,EAAE,CAAC;YACvD,OAAO,MAAM,CAAC;QAClB,CAAC;QAEM,KAAK,CAAC,MAAM,CAAC,SAA+B;YAC/C,OAAO,MAAM,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QAC5D,CAAC;QAEM,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;YAC9B,MAAM,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,EAAE,CAAC;QAC3C,CAAC;QAED;;WAEG;QACO,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAC3B,MAA4D;YAE5D,IAAI,CAAC;gBACD,IAAI,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;gBACpD,IAAI,MAAM,YAAY,KAAK,EAAE,CAAC,CAAA,CAAC;;oBAAM,MAAM,IAAI,KAAK,EAAE,CAAC;gBACvD,IAAI,KAAK,GAAG,MAAM,CAAC;gBACnB,SAAS,CAAC;oBACN,MAAM,KAAK,GAAgC,MAAM,MAAM,CAAC;oBACxD,IAAI,KAAK,YAAY,SAAS,EAAE,CAAC;wBAC7B,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;wBACrD,IAAI,MAAM,YAAY,KAAK;4BAAE,KAAK,GAAG,MAAM,CAAC;oBAChD,CAAC;;wBACG,MAAM,GAAG,KAAK,CAAC;gBACvB,CAAC;YACL,CAAC;oBAAS,CAAC;gBACP,MAAM,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,EAAE,CAAC;YAC1C,CAAC;QACL,CAAC;KACJ;IA9CY,qBAAQ,WA8CpB,CAAA;IAID,SAAgB,GAAG,CACf,OAAwD,EACxD,CAAuC;QAEvC,KAAK,SAAS,CAAC,CAAC,UAAU;YACtB,IAAI,UAAU,GAA8C,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;YAC9H,SAAS,CAAC;gBACN,MAAM,SAAS,GAAyB,MAAM,UAAU,CAAC;gBACzD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;gBAC/C,IAAI,MAAM,YAAY,KAAK;oBACvB,UAAU,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;;oBAElD,UAAU,GAAG,MAAM,CAAC;YAC5B,CAAC;QACL,CAAC;QACD,OAAO,YAAY,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;IAC3C,CAAC;IAhBe,gBAAG,MAgBlB,CAAA;AAOL,CAAC,EA1FgB,YAAY,KAAZ,YAAY,QA0F5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"fileNames":["../../../../../usr/lib/node_modules/typescript/lib/lib.es5.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2015.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2016.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2017.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2018.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2019.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2020.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2021.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2022.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2023.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2024.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.esnext.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2023.array.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2023.collection.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2023.intl.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2024.collection.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2024.object.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2024.promise.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2024.string.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.esnext.array.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.esnext.collection.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.esnext.promise.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.esnext.iterator.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.esnext.float16.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.esnext.error.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.decorators.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/exceptions.ts","../src/opteva.ts","../src/exports.ts","../node_modules/ava/types/assertions.d.cts","../node_modules/ava/types/subscribable.d.cts","../node_modules/ava/types/try-fn.d.cts","../node_modules/ava/types/test-fn.d.cts","../node_modules/ava/entrypoints/main.d.mts","../src/test.ts","../node_modules/@types/estree/index.d.ts"],"fileIdsList":[[84,85,86,87],[84,85,86],[87],[81,82],[81],[83,88]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"8fd575e12870e9944c7e1d62e1f5a73fcf23dd8d3a321f2a2c74c20d022283fe","impliedFormat":1},{"version":"2ab096661c711e4a81cc464fa1e6feb929a54f5340b46b0a07ac6bbf857471f0","impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"8cdf8847677ac7d20486e54dd3fcf09eda95812ac8ace44b4418da1bbbab6eb8","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"df83c2a6c73228b625b0beb6669c7ee2a09c914637e2d35170723ad49c0f5cd4","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"87dc0f382502f5bbce5129bdc0aea21e19a3abbc19259e0b43ae038a9fc4e326","affectsGlobalScope":true,"impliedFormat":1},{"version":"b1cb28af0c891c8c96b2d6b7be76bd394fddcfdb4709a20ba05a7c1605eea0f9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true,"impliedFormat":1},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ece9f17b3866cc077099c73f4983bddbcb1dc7ddb943227f1ec070f529dedd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true,"impliedFormat":1},{"version":"1c9319a09485199c1f7b0498f2988d6d2249793ef67edda49d1e584746be9032","affectsGlobalScope":true,"impliedFormat":1},{"version":"e3a2a0cee0f03ffdde24d89660eba2685bfbdeae955a6c67e8c4c9fd28928eeb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"51ad4c928303041605b4d7ae32e0c1ee387d43a24cd6f1ebf4a2699e1076d4fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"60037901da1a425516449b9a20073aa03386cce92f7a1fd902d7602be3a7c2e9","affectsGlobalScope":true,"impliedFormat":1},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true,"impliedFormat":1},{"version":"22adec94ef7047a6c9d1af3cb96be87a335908bf9ef386ae9fd50eeb37f44c47","affectsGlobalScope":true,"impliedFormat":1},{"version":"196cb558a13d4533a5163286f30b0509ce0210e4b316c56c38d4c0fd2fb38405","affectsGlobalScope":true,"impliedFormat":1},{"version":"73f78680d4c08509933daf80947902f6ff41b6230f94dd002ae372620adb0f60","affectsGlobalScope":true,"impliedFormat":1},{"version":"c5239f5c01bcfa9cd32f37c496cf19c61d69d37e48be9de612b541aac915805b","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"21524e01f352b6f9d3e835d9ee01f14888746464959bbf18d35fdcf4075b0652","signature":"17432b7db89c1f48cf82c7ecf1ae9750aa7d4fe1d0ab02a1ee66fd731cf11d40"},{"version":"9a3e600fa37920bd071d819113ec1232b3d0c27e76cd818c22be9bb75beab05f","signature":"2beebd3829ea4902e758e5eda3ce7681e4b8f4327e8a5432211ec49017ec36ed"},"ff70d9bb166642a653426b9e6327550cee5813121372e8cbbf6e9d299b100df1",{"version":"d8750101c0f4631f1632897699ef075c5fc684df5eeee3832c993c948b334dbe","impliedFormat":1},{"version":"00b72e597dcd6ff7bf772918c78c41dc7c68e239af658cf452bff645ebdc485d","impliedFormat":1},{"version":"17b183b69a3dd3cca2505cee7ff70501c574343ad49a385c9acb5b5299e1ba73","impliedFormat":1},{"version":"65971ae48adee73c3f604209b64a4e34e319d7ce25c2ea452cc15b05a2b43db5","impliedFormat":1},{"version":"de8391b91c499acbc09df8d9ba114dc8c44456d54e81ed01211c32a1d6ad94fb","impliedFormat":99},{"version":"fa0825aaad64c246abccb0e5b0f92a6fe1c26df824b34042ae077972cf8fbeac","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"151ff381ef9ff8da2da9b9663ebf657eac35c4c9a19183420c05728f31a6761d","impliedFormat":1}],"root":[[81,83],89],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"checkJs":true,"composite":true,"experimentalDecorators":true,"module":200,"noFallthroughCasesInSwitch":true,"noImplicitOverride":true,"noUncheckedIndexedAccess":true,"noUncheckedSideEffectImports":true,"outDir":"./","rewriteRelativeImportExtensions":true,"skipLibCheck":true,"sourceMap":true,"strict":true,"target":9,"verbatimModuleSyntax":true},"referencedMap":[[88,1],[87,2],[86,3],[83,4],[82,5],[89,6]],"latestChangedDtsFile":"./test.d.ts","version":"5.9.3"}
|
|
1
|
+
{"fileNames":["../../../../../usr/lib/node_modules/typescript/lib/lib.es5.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2015.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2016.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2017.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2018.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2019.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2020.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2021.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2022.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2023.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2024.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2025.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.esnext.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.dom.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2023.array.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2023.collection.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2023.intl.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2024.collection.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2024.object.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2024.promise.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2024.string.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2025.collection.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2025.float16.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2025.intl.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2025.iterator.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2025.promise.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.es2025.regexp.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.esnext.array.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.esnext.collection.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.esnext.date.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.esnext.error.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.esnext.temporal.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.esnext.typedarrays.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.decorators.d.ts","../../../../../usr/lib/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/types.ts","../src/evaluation.ts","../src/optimization.ts","../src/opteva.ts","../src/exports.ts"],"fileIdsList":[[89],[89,90,91,92],[89,90,91]],"fileInfos":[{"version":"bcd24271a113971ba9eb71ff8cb01bc6b0f872a85c23fdbe5d93065b375933cd","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f88bedbeb09c6f5a6645cb24c7c55f1aa22d19ae96c8e6959cbd8b85a707bc6","impliedFormat":1},{"version":"7fe93b39b810eadd916be8db880dd7f0f7012a5cc6ffb62de8f62a2117fa6f1f","impliedFormat":1},{"version":"bb0074cc08b84a2374af33d8bf044b80851ccc9e719a5e202eacf40db2c31600","impliedFormat":1},{"version":"1a7daebe4f45fb03d9ec53d60008fbf9ac45a697fdc89e4ce218bc94b94f94d6","impliedFormat":1},{"version":"f94b133a3cb14a288803be545ac2683e0d0ff6661bcd37e31aaaec54fc382aed","impliedFormat":1},{"version":"f59d0650799f8782fd74cf73c19223730c6d1b9198671b1c5b3a38e1188b5953","impliedFormat":1},{"version":"8a15b4607d9a499e2dbeed9ec0d3c0d7372c850b2d5f1fb259e8f6d41d468a84","impliedFormat":1},{"version":"26e0fe14baee4e127f4365d1ae0b276f400562e45e19e35fd2d4c296684715e6","impliedFormat":1},{"version":"1e9332c23e9a907175e0ffc6a49e236f97b48838cc8aec9ce7e4cec21e544b65","impliedFormat":1},{"version":"3753fbc1113dc511214802a2342280a8b284ab9094f6420e7aa171e868679f91","impliedFormat":1},{"version":"999ca32883495a866aa5737fe1babc764a469e4cde6ee6b136a4b9ae68853e4b","impliedFormat":1},{"version":"17f13ecb98cbc39243f2eee1f16d45cd8ec4706b03ee314f1915f1a8b42f6984","impliedFormat":1},{"version":"d6b1eba8496bdd0eed6fc8a685768fe01b2da4a0388b5fe7df558290bffcf32f","affectsGlobalScope":true,"impliedFormat":1},{"version":"eadcffda2aa84802c73938e589b9e58248d74c59cb7fcbca6474e3435ac15504","affectsGlobalScope":true,"impliedFormat":1},{"version":"105ba8ff7ba746404fe1a2e189d1d3d2e0eb29a08c18dded791af02f29fb4711","affectsGlobalScope":true,"impliedFormat":1},{"version":"00343ca5b2e3d48fa5df1db6e32ea2a59afab09590274a6cccb1dbae82e60c7c","affectsGlobalScope":true,"impliedFormat":1},{"version":"ebd9f816d4002697cb2864bea1f0b70a103124e18a8cd9645eeccc09bdf80ab4","affectsGlobalScope":true,"impliedFormat":1},{"version":"2c1afac30a01772cd2a9a298a7ce7706b5892e447bb46bdbeef720f7b5da77ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"7b0225f483e4fa685625ebe43dd584bb7973bbd84e66a6ba7bbe175ee1048b4f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c0a4b8ac6ce74679c1da2b3795296f5896e31c38e888469a8e0f99dc3305de60","affectsGlobalScope":true,"impliedFormat":1},{"version":"3084a7b5f569088e0146533a00830e206565de65cae2239509168b11434cd84f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c5079c53f0f141a0698faa903e76cb41cd664e3efb01cc17a5c46ec2eb0bef42","affectsGlobalScope":true,"impliedFormat":1},{"version":"32cafbc484dea6b0ab62cf8473182bbcb23020d70845b406f80b7526f38ae862","affectsGlobalScope":true,"impliedFormat":1},{"version":"fca4cdcb6d6c5ef18a869003d02c9f0fd95df8cfaf6eb431cd3376bc034cad36","affectsGlobalScope":true,"impliedFormat":1},{"version":"b93ec88115de9a9dc1b602291b85baf825c85666bf25985cc5f698073892b467","affectsGlobalScope":true,"impliedFormat":1},{"version":"f5c06dcc3fe849fcb297c247865a161f995cc29de7aa823afdd75aaaddc1419b","affectsGlobalScope":true,"impliedFormat":1},{"version":"b77e16112127a4b169ef0b8c3a4d730edf459c5f25fe52d5e436a6919206c4d7","affectsGlobalScope":true,"impliedFormat":1},{"version":"fbffd9337146eff822c7c00acbb78b01ea7ea23987f6c961eba689349e744f8c","affectsGlobalScope":true,"impliedFormat":1},{"version":"a995c0e49b721312f74fdfb89e4ba29bd9824c770bbb4021d74d2bf560e4c6bd","affectsGlobalScope":true,"impliedFormat":1},{"version":"c7b3542146734342e440a84b213384bfa188835537ddbda50d30766f0593aff9","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce6180fa19b1cccd07ee7f7dbb9a367ac19c0ed160573e4686425060b6df7f57","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f02e2476bccb9dbe21280d6090f0df17d2f66b74711489415a8aa4df73c9675","affectsGlobalScope":true,"impliedFormat":1},{"version":"45e3ab34c1c013c8ab2dc1ba4c80c780744b13b5676800ae2e3be27ae862c40c","affectsGlobalScope":true,"impliedFormat":1},{"version":"805c86f6cca8d7702a62a844856dbaa2a3fd2abef0536e65d48732441dde5b5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"e42e397f1a5a77994f0185fd1466520691456c772d06bf843e5084ceb879a0ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"f4c2b41f90c95b1c532ecc874bd3c111865793b23aebcc1c3cbbabcd5d76ffb0","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab26191cfad5b66afa11b8bf935ef1cd88fabfcb28d30b2dfa6fad877d050332","affectsGlobalScope":true,"impliedFormat":1},{"version":"2088bc26531e38fb05eedac2951480db5309f6be3fa4a08d2221abb0f5b4200d","affectsGlobalScope":true,"impliedFormat":1},{"version":"cb9d366c425fea79716a8fb3af0d78e6b22ebbab3bd64d25063b42dc9f531c1e","affectsGlobalScope":true,"impliedFormat":1},{"version":"500934a8089c26d57ebdb688fc9757389bb6207a3c8f0674d68efa900d2abb34","affectsGlobalScope":true,"impliedFormat":1},{"version":"689da16f46e647cef0d64b0def88910e818a5877ca5379ede156ca3afb780ac3","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc21cc8b6fee4f4c2440d08035b7ea3c06b3511314c8bab6bef7a92de58a2593","affectsGlobalScope":true,"impliedFormat":1},{"version":"7ca53d13d2957003abb47922a71866ba7cb2068f8d154877c596d63c359fed25","affectsGlobalScope":true,"impliedFormat":1},{"version":"54725f8c4df3d900cb4dac84b64689ce29548da0b4e9b7c2de61d41c79293611","affectsGlobalScope":true,"impliedFormat":1},{"version":"e5594bc3076ac29e6c1ebda77939bc4c8833de72f654b6e376862c0473199323","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f3eb332c2d73e729f3364fcc0c2b375e72a121e8157d25a82d67a138c83a95c","affectsGlobalScope":true,"impliedFormat":1},{"version":"6f4427f9642ce8d500970e4e69d1397f64072ab73b97e476b4002a646ac743b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"48915f327cd1dea4d7bd358d9dc7732f58f9e1626a29cc0c05c8c692419d9bb7","affectsGlobalScope":true,"impliedFormat":1},{"version":"b7bf9377723203b5a6a4b920164df22d56a43f593269ba6ae1fdc97774b68855","affectsGlobalScope":true,"impliedFormat":1},{"version":"db9709688f82c9e5f65a119c64d835f906efe5f559d08b11642d56eb85b79357","affectsGlobalScope":true,"impliedFormat":1},{"version":"4b25b8c874acd1a4cf8444c3617e037d444d19080ac9f634b405583fd10ce1f7","affectsGlobalScope":true,"impliedFormat":1},{"version":"37be57d7c90cf1f8112ee2636a068d8fd181289f82b744160ec56a7dc158a9f5","affectsGlobalScope":true,"impliedFormat":1},{"version":"a917a49ac94cd26b754ab84e113369a75d1a47a710661d7cd25e961cc797065f","affectsGlobalScope":true,"impliedFormat":1},{"version":"6d3261badeb7843d157ef3e6f5d1427d0eeb0af0cf9df84a62cfd29fd47ac86e","affectsGlobalScope":true,"impliedFormat":1},{"version":"195daca651dde22f2167ac0d0a05e215308119a3100f5e6268e8317d05a92526","affectsGlobalScope":true,"impliedFormat":1},{"version":"8b11e4285cd2bb164a4dc09248bdec69e9842517db4ca47c1ba913011e44ff2f","affectsGlobalScope":true,"impliedFormat":1},{"version":"0508571a52475e245b02bc50fa1394065a0a3d05277fbf5120c3784b85651799","affectsGlobalScope":true,"impliedFormat":1},{"version":"8f9af488f510c3015af3cc8c267a9e9d96c4dd38a1fdff0e11dc5a544711415b","affectsGlobalScope":true,"impliedFormat":1},{"version":"fc611fea8d30ea72c6bbfb599c9b4d393ce22e2f5bfef2172534781e7d138104","affectsGlobalScope":true,"impliedFormat":1},{"version":"0bd714129fca875f7d4c477a1a392200b0bcd13fb2e80928cd334b63830ea047","affectsGlobalScope":true,"impliedFormat":1},{"version":"e2c9037ae6cd2c52d80ceef0b3c5ffdb488627d71529cf4f63776daf11161c9a","affectsGlobalScope":true,"impliedFormat":1},{"version":"135d5cf4d345f59f1a9caadfafcd858d3d9cc68290db616cc85797224448cccc","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc238c3f81c2984751932b6aab223cd5b830e0ac6cad76389e5e9d2ffc03287d","affectsGlobalScope":true,"impliedFormat":1},{"version":"4a07f9b76d361f572620927e5735b77d6d2101c23cdd94383eb5b706e7b36357","affectsGlobalScope":true,"impliedFormat":1},{"version":"7c4e8dc6ab834cc6baa0227e030606d29e3e8449a9f67cdf5605ea5493c4db29","affectsGlobalScope":true,"impliedFormat":1},{"version":"de7ba0fd02e06cd9a5bd4ab441ed0e122735786e67dde1e849cced1cd8b46b78","affectsGlobalScope":true,"impliedFormat":1},{"version":"6148e4e88d720a06855071c3db02069434142a8332cf9c182cda551adedf3156","affectsGlobalScope":true,"impliedFormat":1},{"version":"d63dba625b108316a40c95a4425f8d4294e0deeccfd6c7e59d819efa19e23409","affectsGlobalScope":true,"impliedFormat":1},{"version":"0568d6befee03dd435bed4fc25c4e46865b24bdcb8c563fdc21f580a2c301904","affectsGlobalScope":true,"impliedFormat":1},{"version":"30d62269b05b584741f19a5369852d5d34895aa2ac4fd948956f886d15f9cc0d","affectsGlobalScope":true,"impliedFormat":1},{"version":"f128dae7c44d8f35ee42e0a437000a57c9f06cc04f8b4fb42eebf44954d53dc8","affectsGlobalScope":true,"impliedFormat":1},{"version":"ffbe6d7b295306b2ba88030f65b74c107d8d99bdcf596ea99c62a02f606108b0","affectsGlobalScope":true,"impliedFormat":1},{"version":"996fb27b15277369c68a4ba46ed138b4e9e839a02fb4ec756f7997629242fd9f","affectsGlobalScope":true,"impliedFormat":1},{"version":"79b712591b270d4778c89706ca2cfc56ddb8c3f895840e477388f1710dc5eda9","affectsGlobalScope":true,"impliedFormat":1},{"version":"20884846cef428b992b9bd032e70a4ef88e349263f63aeddf04dda837a7dba26","affectsGlobalScope":true,"impliedFormat":1},{"version":"5fcab789c73a97cd43828ee3cc94a61264cf24d4c44472ce64ced0e0f148bdb2","affectsGlobalScope":true,"impliedFormat":1},{"version":"db59a81f070c1880ad645b2c0275022baa6a0c4f0acdc58d29d349c6efcf0903","affectsGlobalScope":true,"impliedFormat":1},{"version":"673294292640f5722b700e7d814e17aaf7d93f83a48a2c9b38f33cbc940ad8b0","affectsGlobalScope":true,"impliedFormat":1},{"version":"d786b48f934cbca483b3c6d0a798cb43bbb4ada283e76fb22c28e53ae05b9e69","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ecb8e347cb6b2a8927c09b86263663289418df375f5e68e11a0ae683776978f","affectsGlobalScope":true,"impliedFormat":1},{"version":"142efd4ce210576f777dc34df121777be89eda476942d6d6663b03dcb53be3ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"379bc41580c2d774f82e828c70308f24a005b490c25ba34d679d84bcf05c3d9d","affectsGlobalScope":true,"impliedFormat":1},{"version":"ed484fb2aa8a1a23d0277056ec3336e0a0b52f9b8d6a961f338a642faf43235d","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ffedae1d1c2d53fdbca1c96d3c7dda544281f7d262f99b6880634f8fd8d9820","affectsGlobalScope":true,"impliedFormat":1},{"version":"83a730b125d477dd264df8ba479afab27a3dae7152b005c214ab94dc7ee44fd3","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ce14b81c5cc821994aa8ec1d42b220dd41b27fcc06373bce3958af7421b77d4","affectsGlobalScope":true,"impliedFormat":1},{"version":"b3a048b3e9302ef9a34ef4ebb9aecfb28b66abb3bce577206a79fee559c230da","affectsGlobalScope":true,"impliedFormat":1},{"version":"faf3f95be4af1dd172d12de5a9ac37e9e743e0742924e0683910f4e2d46b0634","signature":"efa87fe22a45152cc7e335c9457e895f08d9b096a6066cf99637fabf728cda98"},{"version":"7fa5900ba1142a17de10a305e95473720d5682eced0de8e20f061166fdd23cb7","signature":"fc281f552af4cca9bade81ed1f97999638ca300b38d57cd05217aeb56bf90d33"},{"version":"b1c57b1a941783d8f96615442293cdcffe54560e512e6ff116dde4be65fa4ac1","signature":"46d7aeaa4a8743819adc87976cbeded3568f6ea7b75ba9d42f3d25885464637e"},{"version":"3f5eb02b96346d284d49fc3bd07e87f863f9a57eda015f6ed32de1e5aab1bee3","signature":"335efb4deddd221632e14cd86e5c421c78887b4cdc40fcfae59368c10902e56c"},"668bc06561b0103571f441a6426baad3a237ea99a670779774ee4796cd1b5408"],"root":[[89,93]],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"checkJs":true,"composite":true,"experimentalDecorators":true,"module":200,"noFallthroughCasesInSwitch":true,"noImplicitOverride":true,"noUncheckedIndexedAccess":true,"noUncheckedSideEffectImports":true,"outDir":"./","rewriteRelativeImportExtensions":true,"skipLibCheck":true,"sourceMap":true,"strict":true,"target":9,"verbatimModuleSyntax":true},"referencedMap":[[90,1],[93,2],[92,3],[91,1]],"latestChangedDtsFile":"./exports.d.ts","version":"6.0.2"}
|
package/build/types.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const NOMINAL: unique symbol;
|
|
2
|
+
export declare class Draft<T> {
|
|
3
|
+
protected value: T;
|
|
4
|
+
protected [NOMINAL]: never;
|
|
5
|
+
constructor(value: T);
|
|
6
|
+
[Symbol.toPrimitive](): never;
|
|
7
|
+
extract(): T;
|
|
8
|
+
}
|
|
9
|
+
export declare class Rejection<T> extends Error {
|
|
10
|
+
cause: T;
|
|
11
|
+
protected [NOMINAL]: never;
|
|
12
|
+
constructor(cause: T);
|
|
13
|
+
[Symbol.toPrimitive](): never;
|
|
14
|
+
extract(): T;
|
|
15
|
+
}
|
|
16
|
+
export declare class Opposition<T> extends Error {
|
|
17
|
+
cause: T;
|
|
18
|
+
protected [NOMINAL]: never;
|
|
19
|
+
constructor(cause: T);
|
|
20
|
+
[Symbol.toPrimitive](): never;
|
|
21
|
+
extract(): T;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
package/build/types.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const NOMINAL = Symbol();
|
|
2
|
+
export class Draft {
|
|
3
|
+
value;
|
|
4
|
+
constructor(value) {
|
|
5
|
+
this.value = value;
|
|
6
|
+
}
|
|
7
|
+
[Symbol.toPrimitive]() {
|
|
8
|
+
throw new Error();
|
|
9
|
+
}
|
|
10
|
+
extract() {
|
|
11
|
+
return this.value;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export class Rejection extends Error {
|
|
15
|
+
cause;
|
|
16
|
+
constructor(cause) {
|
|
17
|
+
super();
|
|
18
|
+
this.cause = cause;
|
|
19
|
+
}
|
|
20
|
+
[Symbol.toPrimitive]() {
|
|
21
|
+
throw new Error();
|
|
22
|
+
}
|
|
23
|
+
extract() {
|
|
24
|
+
return this.cause;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export class Opposition extends Error {
|
|
28
|
+
cause;
|
|
29
|
+
constructor(cause) {
|
|
30
|
+
super();
|
|
31
|
+
this.cause = cause;
|
|
32
|
+
}
|
|
33
|
+
[Symbol.toPrimitive]() {
|
|
34
|
+
throw new Error();
|
|
35
|
+
}
|
|
36
|
+
extract() {
|
|
37
|
+
return this.cause;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC;AAEzB,MAAM,OAAO,KAAK;IAEe;IAA7B,YAA6B,KAAQ;QAAR,UAAK,GAAL,KAAK,CAAG;IAAG,CAAC;IAClC,CAAC,MAAM,CAAC,WAAW,CAAC;QACvB,MAAM,IAAI,KAAK,EAAE,CAAC;IACtB,CAAC;IACM,OAAO;QACV,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;CACJ;AAED,MAAM,OAAO,SAAa,SAAQ,KAAK;IAEA;IAAnC,YAAmC,KAAQ;QACvC,KAAK,EAAE,CAAC;QADuB,UAAK,GAAL,KAAK,CAAG;IAE3C,CAAC;IACM,CAAC,MAAM,CAAC,WAAW,CAAC;QACvB,MAAM,IAAI,KAAK,EAAE,CAAC;IACtB,CAAC;IACM,OAAO;QACV,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;CACJ;AAED,MAAM,OAAO,UAAc,SAAQ,KAAK;IAED;IAAnC,YAAmC,KAAQ;QACvC,KAAK,EAAE,CAAC;QADuB,UAAK,GAAL,KAAK,CAAG;IAE3C,CAAC;IACM,CAAC,MAAM,CAAC,WAAW,CAAC;QACvB,MAAM,IAAI,KAAK,EAAE,CAAC;IACtB,CAAC;IACM,OAAO;QACV,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;CACJ"}
|
package/package.json
CHANGED
|
@@ -6,10 +6,13 @@
|
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/zimtsui/iterflow.git"
|
|
8
8
|
},
|
|
9
|
+
"engines": {
|
|
10
|
+
"node": ">=22"
|
|
11
|
+
},
|
|
9
12
|
"scripts": {
|
|
13
|
+
"test": "npm run build && ava ./test/test.ts",
|
|
10
14
|
"build": "tsc -b ./src/tsconfig.json",
|
|
11
15
|
"clean": "rm -rf ./build",
|
|
12
|
-
"test": "ava ./build/test.js",
|
|
13
16
|
"prepublishOnly": "npm run clean && npm run build"
|
|
14
17
|
},
|
|
15
18
|
"author": "Zim",
|
|
@@ -21,5 +24,5 @@
|
|
|
21
24
|
"ava": "^7.0.0",
|
|
22
25
|
"openai": "^6.29.0"
|
|
23
26
|
},
|
|
24
|
-
"version": "0.0.
|
|
27
|
+
"version": "0.0.9"
|
|
25
28
|
}
|
package/test/test.ts
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import {
|
|
3
|
+
Draft,
|
|
4
|
+
Evaluation,
|
|
5
|
+
opteva,
|
|
6
|
+
Opposition,
|
|
7
|
+
Optimization,
|
|
8
|
+
Rejection,
|
|
9
|
+
} from '../build/exports.js';
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
async function dispose(...values: AsyncDisposable[]): Promise<void> {
|
|
13
|
+
for (const value of values.reverse())
|
|
14
|
+
await value[Symbol.asyncDispose]();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
test('opteva throws rejection after optimizer produces a new draft', async t => {
|
|
19
|
+
const events: Array<[string, string]> = [];
|
|
20
|
+
|
|
21
|
+
async function* optimize(): Optimization.Generator<string, string, string> {
|
|
22
|
+
const rejection = yield new Draft('draft-1');
|
|
23
|
+
events.push(['optimizer.reject', rejection.extract()]);
|
|
24
|
+
let nextRejection = yield new Draft('draft-2');
|
|
25
|
+
for (;;)
|
|
26
|
+
nextRejection = yield new Draft(`draft-2:${nextRejection.extract()}`);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async function* evaluate(): Evaluation.Generator<string, string, string> {
|
|
30
|
+
const draft = yield;
|
|
31
|
+
events.push(['evaluation.submit', draft.extract()]);
|
|
32
|
+
let nextInput = yield new Rejection('needs-revision');
|
|
33
|
+
for (;;)
|
|
34
|
+
nextInput = yield;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const optimization = Optimization.from(optimize());
|
|
38
|
+
const evaluation = await Evaluation.from(evaluate());
|
|
39
|
+
|
|
40
|
+
try {
|
|
41
|
+
const thrown = await t.throwsAsync(opteva(optimization, evaluation), {
|
|
42
|
+
instanceOf: Rejection,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
t.is(thrown?.extract(), 'needs-revision');
|
|
46
|
+
t.is((await optimization.repeat()).extract(), 'draft-2');
|
|
47
|
+
t.deepEqual(events, [
|
|
48
|
+
['evaluation.submit', 'draft-1'],
|
|
49
|
+
['optimizer.reject', 'needs-revision'],
|
|
50
|
+
]);
|
|
51
|
+
} finally {
|
|
52
|
+
await dispose(evaluation, optimization);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
test('opteva continues when optimizer opposes a rejection and evaluator accepts', async t => {
|
|
58
|
+
const events: Array<[string, string]> = [];
|
|
59
|
+
|
|
60
|
+
async function* optimize(): Optimization.Generator<string, string, string> {
|
|
61
|
+
const rejection = yield new Draft('draft-1');
|
|
62
|
+
events.push(['optimizer.reject', rejection.extract()]);
|
|
63
|
+
let nextRejection = yield new Opposition('draft-1-is-correct');
|
|
64
|
+
for (;;)
|
|
65
|
+
nextRejection = yield new Draft(`draft-1:${nextRejection.extract()}`);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
async function* evaluate(): Evaluation.Generator<string, string, string> {
|
|
69
|
+
const draft = yield;
|
|
70
|
+
events.push(['evaluation.submit', draft.extract()]);
|
|
71
|
+
const opposition = yield new Rejection('prove-it');
|
|
72
|
+
events.push(['evaluation.oppose', opposition.extract()]);
|
|
73
|
+
let nextInput = yield;
|
|
74
|
+
for (;;)
|
|
75
|
+
nextInput = yield;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const optimization = Optimization.from(optimize());
|
|
79
|
+
const evaluation = await Evaluation.from(evaluate());
|
|
80
|
+
|
|
81
|
+
try {
|
|
82
|
+
await opteva(optimization, evaluation);
|
|
83
|
+
|
|
84
|
+
t.is((await optimization.repeat()).extract(), 'draft-1');
|
|
85
|
+
t.deepEqual(events, [
|
|
86
|
+
['evaluation.submit', 'draft-1'],
|
|
87
|
+
['optimizer.reject', 'prove-it'],
|
|
88
|
+
['evaluation.oppose', 'draft-1-is-correct'],
|
|
89
|
+
]);
|
|
90
|
+
} finally {
|
|
91
|
+
await dispose(evaluation, optimization);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
test('Optimization.map keeps the last mapped draft across opposition', async t => {
|
|
97
|
+
const mappedInputs: number[] = [];
|
|
98
|
+
|
|
99
|
+
async function* optimize(): Optimization.Generator<number, string, string> {
|
|
100
|
+
const firstRejection = yield new Draft(1);
|
|
101
|
+
const secondRejection = yield new Opposition(`oppose:${firstRejection.extract()}`);
|
|
102
|
+
let nextRejection = yield new Draft(secondRejection.extract().length);
|
|
103
|
+
for (;;)
|
|
104
|
+
nextRejection = yield new Draft(nextRejection.extract().length);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const source = Optimization.from(optimize());
|
|
108
|
+
const mapped = Optimization.map(source, async draft => {
|
|
109
|
+
mappedInputs.push(draft);
|
|
110
|
+
return `mapped:${draft}`;
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
try {
|
|
114
|
+
t.is((await mapped.repeat()).extract(), 'mapped:1');
|
|
115
|
+
|
|
116
|
+
const opposition = await mapped.reject(new Rejection('bad'));
|
|
117
|
+
t.true(opposition instanceof Opposition);
|
|
118
|
+
t.is(opposition.extract(), 'oppose:bad');
|
|
119
|
+
|
|
120
|
+
t.is((await mapped.repeat()).extract(), 'mapped:1');
|
|
121
|
+
t.deepEqual(mappedInputs, [1]);
|
|
122
|
+
|
|
123
|
+
const draft = await mapped.reject(new Rejection('worse'));
|
|
124
|
+
t.true(draft instanceof Draft);
|
|
125
|
+
t.is(draft.extract(), 'mapped:5');
|
|
126
|
+
t.deepEqual(mappedInputs, [1, 5]);
|
|
127
|
+
} finally {
|
|
128
|
+
await dispose(source);
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
test('Optimization.from requires the first yield to be a draft', async t => {
|
|
134
|
+
async function* optimize(): Optimization.Generator<string, string, string> {
|
|
135
|
+
yield new Opposition('not-a-draft');
|
|
136
|
+
throw new Error('unreachable');
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const optimization = Optimization.from(optimize());
|
|
140
|
+
|
|
141
|
+
try {
|
|
142
|
+
await t.throwsAsync(optimization.repeat(), { instanceOf: Error });
|
|
143
|
+
} finally {
|
|
144
|
+
await dispose(optimization);
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
test('Evaluation.from requires the first yield to be void', async t => {
|
|
150
|
+
async function* evaluate(): Evaluation.Generator<string, string, string> {
|
|
151
|
+
yield new Rejection('not-void');
|
|
152
|
+
throw new Error('unreachable');
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
await t.throwsAsync(Evaluation.from(evaluate()), { instanceOf: Error });
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
test('multiple evaluators restart from the first evaluator after a later rejection', async t => {
|
|
160
|
+
const events: string[] = [];
|
|
161
|
+
|
|
162
|
+
async function* optimize(): Optimization.Generator<number, string, string> {
|
|
163
|
+
let rejection = yield new Draft(1);
|
|
164
|
+
let draft = 2;
|
|
165
|
+
for (;;) {
|
|
166
|
+
events.push(`optimizer.reject:${rejection.extract()}`);
|
|
167
|
+
rejection = yield new Draft(draft++);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
async function* evaluateNumber(): Evaluation.Generator<number, string, string> {
|
|
172
|
+
let input = yield;
|
|
173
|
+
for (;;) {
|
|
174
|
+
if (input instanceof Draft) {} else throw new Error();
|
|
175
|
+
events.push(`number.submit:${input.extract()}`);
|
|
176
|
+
input = yield;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
async function* evaluateString(): Evaluation.Generator<string, string, string> {
|
|
181
|
+
let input = yield;
|
|
182
|
+
if (input instanceof Draft) {} else throw new Error();
|
|
183
|
+
events.push(`string.submit:${input.extract()}`);
|
|
184
|
+
input = yield new Rejection('string-reject');
|
|
185
|
+
for (;;) {
|
|
186
|
+
if (input instanceof Draft) {} else throw new Error();
|
|
187
|
+
events.push(`string.submit:${input.extract()}`);
|
|
188
|
+
input = yield;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
const optimization = Optimization.from(optimize());
|
|
193
|
+
const numberEvaluation = await Evaluation.from(evaluateNumber());
|
|
194
|
+
const stringEvaluation = await Evaluation.from(evaluateString());
|
|
195
|
+
|
|
196
|
+
try {
|
|
197
|
+
let finalDraft: Draft<string> | undefined;
|
|
198
|
+
|
|
199
|
+
for (;;) {
|
|
200
|
+
try {
|
|
201
|
+
const numberView = optimization;
|
|
202
|
+
await opteva(numberView, numberEvaluation);
|
|
203
|
+
const stringView: Optimization.View<string, string, string> = Optimization.map(numberView, async draft => {
|
|
204
|
+
events.push(`map:${draft}`);
|
|
205
|
+
return `value:${draft}`;
|
|
206
|
+
});
|
|
207
|
+
await opteva(stringView, stringEvaluation);
|
|
208
|
+
finalDraft = await stringView.repeat();
|
|
209
|
+
break;
|
|
210
|
+
} catch (e) {
|
|
211
|
+
if (e instanceof Rejection) {} else throw e;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
t.is(finalDraft?.extract(), 'value:2');
|
|
216
|
+
t.deepEqual(events, [
|
|
217
|
+
'number.submit:1',
|
|
218
|
+
'map:1',
|
|
219
|
+
'string.submit:value:1',
|
|
220
|
+
'optimizer.reject:string-reject',
|
|
221
|
+
'map:2',
|
|
222
|
+
'number.submit:2',
|
|
223
|
+
'map:2',
|
|
224
|
+
'string.submit:value:2',
|
|
225
|
+
]);
|
|
226
|
+
} finally {
|
|
227
|
+
await dispose(stringEvaluation, numberEvaluation, optimization);
|
|
228
|
+
}
|
|
229
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "preserve",
|
|
5
|
+
"moduleDetection": "force",
|
|
6
|
+
"lib": ["esnext"],
|
|
7
|
+
"sourceMap": true,
|
|
8
|
+
"strict": true,
|
|
9
|
+
"experimentalDecorators": true,
|
|
10
|
+
"noUncheckedIndexedAccess": true,
|
|
11
|
+
"noUncheckedSideEffectImports": true,
|
|
12
|
+
"allowSyntheticDefaultImports": true,
|
|
13
|
+
"rewriteRelativeImportExtensions": true,
|
|
14
|
+
"allowJs": true,
|
|
15
|
+
"noFallthroughCasesInSwitch": true,
|
|
16
|
+
"noImplicitOverride": true,
|
|
17
|
+
"resolveJsonModule": true,
|
|
18
|
+
"verbatimModuleSyntax": true,
|
|
19
|
+
"checkJs": true,
|
|
20
|
+
"composite": true,
|
|
21
|
+
"skipLibCheck": true
|
|
22
|
+
},
|
|
23
|
+
"include": [
|
|
24
|
+
"./**/*"
|
|
25
|
+
],
|
|
26
|
+
"references": [
|
|
27
|
+
{ "path": "../src/tsconfig.json" }
|
|
28
|
+
]
|
|
29
|
+
}
|
package/build/exceptions.d.ts
DELETED
package/build/exceptions.js
DELETED
package/build/exceptions.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exceptions.js","sourceRoot":"","sources":["../src/exceptions.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,UAAU;IACO;IAA1B,YAA0B,OAAe;QAAf,YAAO,GAAP,OAAO,CAAQ;IAAG,CAAC;CAChD;AACD,MAAM,OAAO,SAAS;IACQ;IAA1B,YAA0B,OAAe;QAAf,YAAO,GAAP,OAAO,CAAQ;IAAG,CAAC;CAChD"}
|
package/build/test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|