@aidc-toolkit/utility 0.9.4 → 0.9.5
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/.github/workflows/build-publish.yml +20 -0
- package/dist/index.cjs +1714 -0
- package/dist/index.d.cts +909 -0
- package/dist/index.d.ts +909 -0
- package/dist/index.js +1674 -0
- package/package.json +5 -4
- package/src/iterator_proxy.ts +175 -187
- package/test/character_set.test.ts +4 -4
- package/test/iterator_proxy.test.ts +34 -2
- package/test/record.test.ts +1 -1
- package/test/reg_exp.test.ts +1 -1
- package/test/sequencer.test.ts +1 -1
- package/test/transformer.test.ts +3 -3
- package/.github/workflows/npm-publish.yml +0 -38
- package/.idea/runConfigurations/build_dev.xml +0 -12
package/test/sequencer.test.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { I18NEnvironment, i18nInit } from "@aidc-toolkit/core";
|
|
|
2
2
|
import { describe, expect, test } from "vitest";
|
|
3
3
|
import { IteratorProxy, Sequencer } from "../src/index.js";
|
|
4
4
|
|
|
5
|
-
await i18nInit(I18NEnvironment.CLI
|
|
5
|
+
await i18nInit(I18NEnvironment.CLI);
|
|
6
6
|
|
|
7
7
|
describe("Sequence", () => {
|
|
8
8
|
const sequencer1 = new Sequencer(10, 20);
|
package/test/transformer.test.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { I18NEnvironment, i18nInit } from "@aidc-toolkit/core";
|
|
2
2
|
import { describe, expect, test } from "vitest";
|
|
3
|
-
import { EncryptionTransformer, IdentityTransformer, Sequencer, Transformer } from "../src/index.js";
|
|
3
|
+
import { EncryptionTransformer, IdentityTransformer, IteratorProxy, Sequencer, Transformer } from "../src/index.js";
|
|
4
4
|
|
|
5
|
-
await i18nInit(I18NEnvironment.CLI
|
|
5
|
+
await i18nInit(I18NEnvironment.CLI);
|
|
6
6
|
|
|
7
7
|
function testTransformer(domain: number, tweak?: number, callback?: (value: bigint, forwardValue: bigint) => void): void {
|
|
8
8
|
const transformer = Transformer.get(domain, tweak);
|
|
@@ -11,7 +11,7 @@ function testTransformer(domain: number, tweak?: number, callback?: (value: bigi
|
|
|
11
11
|
|
|
12
12
|
const transformedValuesSet = new Set<bigint>();
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
IteratorProxy.from(transformer.forward(new Sequencer(0n, domain))).forEach((transformedValue, index) => {
|
|
15
15
|
const indexN = BigInt(index);
|
|
16
16
|
|
|
17
17
|
if (sequential && transformedValue !== indexN) {
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
2
|
-
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
|
|
3
|
-
|
|
4
|
-
name: Node.js Package
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
release:
|
|
8
|
-
types: [created]
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
build:
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
steps:
|
|
14
|
-
- uses: actions/checkout@v4
|
|
15
|
-
- uses: actions/setup-node@v4
|
|
16
|
-
with:
|
|
17
|
-
node-version: 22
|
|
18
|
-
- run: npm ci
|
|
19
|
-
# This is necessary to work around platform-specific optional dependencies bug (https://github.com/npm/cli/issues/4828).
|
|
20
|
-
# - run: npm i @rollup/rollup-linux-x64-gnu
|
|
21
|
-
# "vitest run" fails with:
|
|
22
|
-
# Error: failed to resolve "extends":"@aidc-toolkit/dev/tsconfig.json" in /home/runner/work/utility/utility/tsconfig.json
|
|
23
|
-
# Caused by: Error: Cannot find module '@aidc-toolkit/dev/tsconfig.json/tsconfig.json'
|
|
24
|
-
# - run: npm test
|
|
25
|
-
|
|
26
|
-
publish-npm:
|
|
27
|
-
needs: build
|
|
28
|
-
runs-on: ubuntu-latest
|
|
29
|
-
steps:
|
|
30
|
-
- uses: actions/checkout@v4
|
|
31
|
-
- uses: actions/setup-node@v4
|
|
32
|
-
with:
|
|
33
|
-
node-version: 22
|
|
34
|
-
registry-url: https://registry.npmjs.org/
|
|
35
|
-
- run: npm ci
|
|
36
|
-
- run: npm publish --access public
|
|
37
|
-
env:
|
|
38
|
-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<component name="ProjectRunConfigurationManager">
|
|
2
|
-
<configuration default="false" name="build-dev" type="js.build_tools.npm" nameIsGenerated="true">
|
|
3
|
-
<package-json value="$PROJECT_DIR$/package.json" />
|
|
4
|
-
<command value="run" />
|
|
5
|
-
<scripts>
|
|
6
|
-
<script value="build-dev" />
|
|
7
|
-
</scripts>
|
|
8
|
-
<node-interpreter value="project" />
|
|
9
|
-
<envs />
|
|
10
|
-
<method v="2" />
|
|
11
|
-
</configuration>
|
|
12
|
-
</component>
|