diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index dd84ea78..00000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Desktop (please complete the following information):** - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - Version [e.g. 22] - -**Smartphone (please complete the following information):** - - Device: [e.g. iPhone6] - - OS: [e.g. iOS8.1] - - Browser [e.g. stock browser, safari] - - Version [e.g. 22] - -**Additional context** -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/custom.md b/.github/ISSUE_TEMPLATE/custom.md deleted file mode 100644 index 48d5f81f..00000000 --- a/.github/ISSUE_TEMPLATE/custom.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -name: Custom issue template -about: Describe this issue template's purpose here. -title: '' -labels: '' -assignees: '' - ---- - - diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index bbcbbe7d..00000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index 04079c3b..00000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,102 +0,0 @@ -name: ci -on: - push: - branches: - - develop - pull_request: - branches: - - develop - -jobs: - - test_node: - runs-on: ubuntu-latest - if: ${{ !github.event.created }} - strategy: - matrix: - node: [ '13', '12', '11', '10', '8' ] - name: Test with Node v${{ matrix.node }} - steps: - - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node }} - - run: npm ci - - run: npm run build - - run: npm run test:node - - test_deno: - runs-on: ubuntu-latest - if: ${{ !github.event.created }} - name: test with Deno - steps: - - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - - name: Cache - uses: actions/cache@v1 - with: - path: ~/.cache/deno - key: deno-${{ runner.os }}-${{ hashFiles('deno-lock.json') }} - restore-keys: | - deno-${{ runner.os }}-${{ hashFiles('deno-lock.json') }} - deno-${{ runner.os }}- - deno- - - uses: denolib/setup-deno@master - with: - deno-version: 1.x - - run: npm ci - - run: npm run build - - run: npm run test:deno - - trigger_publish: - name: Trigger publish.yaml workflow if package.json version updated ( and secrets.PAT is set ). - runs-on: ubuntu-latest - env: - PAT: ${{secrets.PAT}} - if: github.event_name == 'push' && github.event.head_commit.author.name != 'denoify_ci' - needs: - - test_node - - test_deno - steps: - - - name: Get version on master - id: v_master - uses: garronej/github_actions_toolkit@v1.2 - with: - action_name: get_package_json_version - owner: ${{github.repository_owner}} - repo: ${{github.event.repository.name}} - branch: master - compare_to_version: '0.0.0' - - - name: Get version on develop - id: v_develop - uses: garronej/github_actions_toolkit@v1.2 - with: - action_name: get_package_json_version - owner: ${{github.repository_owner}} - repo: ${{github.event.repository.name}} - branch: ${{ github.sha }} - compare_to_version: ${{steps.v_master.outputs.version || '0.0.0'}} - - - name: 'Trigger the ''publish'' workflow' - if: ${{ !!env.PAT && steps.v_develop.outputs.compare_result == '1' }} - uses: garronej/github_actions_toolkit@v1.2 - env: - GITHUB_TOKEN: ${{ secrets.PAT }} - with: - action_name: dispatch_event - owner: ${{github.repository_owner}} - repo: ${{github.event.repository.name}} - event_type: publish - client_payload_json: | - ${{ - format( - '{{"from_version":"{0}","to_version":"{1}","repo":"{2}"}}', - steps.v_master.outputs.version, - steps.v_develop.outputs.version, - github.event.repository.name - ) - }} diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml deleted file mode 100644 index 3edcdd28..00000000 --- a/.github/workflows/publish.yaml +++ /dev/null @@ -1,112 +0,0 @@ -on: - repository_dispatch: - types: publish - -jobs: - update_changelog_and_sync_package_lock_version: - name: Update CHANGELOG.md and make sure package.json and package-lock.json versions matches. - runs-on: ubuntu-latest - steps: - - name: Synchronize package.json and package-lock.json version if needed. - uses: garronej/github_actions_toolkit@v1.2 - env: - GITHUB_TOKEN: ${{ secrets.PAT }} - with: - action_name: sync_package_and_package_lock_version - owner: ${{github.repository_owner}} - repo: ${{github.event.client_payload.repo}} - branch: develop - commit_author_email: denoify_ci@github.com - - name: Update CHANGELOG.md - if: ${{ !!github.event.client_payload.from_version }} - uses: garronej/github_actions_toolkit@v1.2 - env: - GITHUB_TOKEN: ${{ secrets.PAT }} - with: - action_name: update_changelog - owner: ${{github.repository_owner}} - repo: ${{github.event.client_payload.repo}} - branch_behind: master - branch_ahead: develop - commit_author_email: denoify_ci@github.com - exclude_commit_from_author_names_json: '["denoify_ci"]' - - publish_npm: - runs-on: ubuntu-latest - needs: update_changelog_and_sync_package_lock_version - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - - run: npm ci - - run: npm run enable_short_import_path:npm - env: - DRY_RUN: "0" - - name: (DEBUG) Show how the files have been moved to enable short import - run: ls -lR - - name: Publishing on NPM - run: | - if [ "$(npm show $MODULE_NAME version)" = "$VERSION" ]; then - echo "This version is already published" - exit 0 - fi - if [ "$NPM_TOKEN" = "" ]; then - echo "Can't publish on NPM, You must first create a secret called NPM_TOKEN that contains your NPM auth token. https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets" - false - fi - echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc - npm publish - rm .npmrc - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - MODULE_NAME: ${{ github.event.client_payload.repo }} - VERSION: ${{ github.event.client_payload.to_version }} - publish_deno: - runs-on: ubuntu-latest - needs: update_changelog_and_sync_package_lock_version - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - ref: develop - - name: Remove .github directory, useless on 'master' branch - run: rm -r .github - - name: Remove branch 'master' - continue-on-error: true - run: | - git branch -d master || true - git push origin :master - - name: Create the new 'master' branch - run: | - git branch master - git checkout master - git push origin master - - uses: actions/setup-node@v1 - - run: npm ci - - run: npm run enable_short_import_path:deno - env: - DRY_RUN: "0" - - name: Commit changes - run: | - git config --local user.email "denoify_ci@github.com" - git config --local user.name "denoify_ci" - git add -A - git commit -am "Automatic structural changes for Deno" - - name: Push changes - uses: ad-m/github-push-action@v0.5.0 - with: - github_token: ${{ secrets.PAT }} - branch: master - - name: Create Release - uses: garronej/create-release@master - env: - GITHUB_TOKEN: ${{ secrets.PAT }} - with: - tag_name: ${{ github.event.client_payload.to_version }} - release_name: Release ${{ github.event.client_payload.to_version }} - branch: master - draft: false - prerelease: false - - - - diff --git a/.gitignore b/.gitignore index f5d2e8a6..13be271a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,47 +1,2 @@ -# Logs -logs -*.log -npm-debug.log* - -# Runtime data -pids -*.pid -*.seed - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules -jspm_packages - -# Optional npm cache directory -.npm - -# Optional REPL history -.node_repl_history - -dist/test -.vscode - -.DS_Store - - -/dist -/deno_dist -/mod.ts \ No newline at end of file + +/node_modules diff --git a/src/lib/Ctx.ts b/lib/Ctx.ts similarity index 83% rename from src/lib/Ctx.ts rename to lib/Ctx.ts index 6a6c3208..32ac9871 100644 --- a/src/lib/Ctx.ts +++ b/lib/Ctx.ts @@ -1,19 +1,19 @@ -import { Polyfill as Set } from "minimal-polyfills/Set"; -import { Polyfill as WeakMap } from "minimal-polyfills/WeakMap"; -import { assert } from "../tools/typeSafety/assert"; -import { typeGuard } from "../tools/typeSafety/typeGuard"; -import { LazyEvt } from "./LazyEvt"; -import { importProxy } from "./importProxy"; -import { Handler } from "./types/Handler"; -import { defineAccessors } from "../tools/typeSafety/defineAccessors"; -import { overwriteReadonlyProp } from "../tools/typeSafety/overwriteReadonlyProp"; - -type EvtLike = import("./types/helper/UnpackEvt").EvtLike; -type Evt = import("./types/interfaces").Evt; -type CtxLike = import("./types/interfaces").CtxLike; -type DoneOrAborted = import("./types/interfaces/Ctx").DoneOrAborted; - -export type Ctx = import("./types/interfaces").Ctx; +import { Polyfill as Set } from "https://raw.github.com/garronej/minimal_polyfills/2.0.1/Set.ts"; +import { Polyfill as WeakMap } from "https://raw.github.com/garronej/minimal_polyfills/2.0.1/WeakMap.ts"; +import { assert } from "../tools/typeSafety/assert.ts"; +import { typeGuard } from "../tools/typeSafety/typeGuard.ts"; +import { LazyEvt } from "./LazyEvt.ts"; +import { importProxy } from "./importProxy.ts"; +import { Handler } from "./types/Handler.ts"; +import { defineAccessors } from "../tools/typeSafety/defineAccessors.ts"; +import { overwriteReadonlyProp } from "../tools/typeSafety/overwriteReadonlyProp.ts"; + +type EvtLike = import("./types/helper/UnpackEvt.ts").EvtLike; +type Evt = import("./types/interfaces/index.ts").Evt; +type CtxLike = import("./types/interfaces/index.ts").CtxLike; +type DoneOrAborted = import("./types/interfaces/Ctx.ts").DoneOrAborted; + +export type Ctx = import("./types/interfaces/index.ts").Ctx; class CtxImpl implements Ctx{ diff --git a/src/lib/Evt.asNonPostable.ts b/lib/Evt.asNonPostable.ts similarity index 75% rename from src/lib/Evt.asNonPostable.ts rename to lib/Evt.asNonPostable.ts index 0fdba8cd..5972cebb 100644 --- a/src/lib/Evt.asNonPostable.ts +++ b/lib/Evt.asNonPostable.ts @@ -1,6 +1,6 @@ -import { ToNonPostableEvt } from "./types/helper/ToNonPostableEvt"; -type EvtLike= import("./types/helper/UnpackEvt").EvtLike; +import { ToNonPostableEvt } from "./types/helper/ToNonPostableEvt.ts"; +type EvtLike= import("./types/helper/UnpackEvt.ts").EvtLike; /** https://docs.evt.land/api/evt/asnonpostable */ export function asNonPostable>(evt: E): ToNonPostableEvt{ diff --git a/src/lib/Evt.asPostable.ts b/lib/Evt.asPostable.ts similarity index 63% rename from src/lib/Evt.asPostable.ts rename to lib/Evt.asPostable.ts index c696a8f7..948fff25 100644 --- a/src/lib/Evt.asPostable.ts +++ b/lib/Evt.asPostable.ts @@ -1,6 +1,6 @@ -import { ToPostableEvt } from "./types/helper/ToPostableEvt"; -type EvtLike= import("./types/helper/UnpackEvt").EvtLike; +import { ToPostableEvt } from "./types/helper/ToPostableEvt.ts"; +type EvtLike= import("./types/helper/UnpackEvt.ts").EvtLike; /** * https://docs.evt.land/api/evt/aspostable diff --git a/src/lib/Evt.create.ts b/lib/Evt.create.ts similarity index 70% rename from src/lib/Evt.create.ts rename to lib/Evt.create.ts index cff07706..34ff7133 100644 --- a/src/lib/Evt.create.ts +++ b/lib/Evt.create.ts @@ -1,9 +1,9 @@ -import { importProxy } from "./importProxy"; +import { importProxy } from "./importProxy.ts"; -type Evt = import("./types/interfaces").Evt; -type VoidEvt= import("./types/interfaces").VoidEvt; -type StatefulEvt = import("./types/interfaces").StatefulEvt; +type Evt = import("./types/interfaces/index.ts").Evt; +type VoidEvt= import("./types/interfaces/index.ts").VoidEvt; +type StatefulEvt = import("./types/interfaces/index.ts").StatefulEvt; /** * https://docs.evt.land/api/evt/create diff --git a/src/lib/Evt.factorize.ts b/lib/Evt.factorize.ts similarity index 63% rename from src/lib/Evt.factorize.ts rename to lib/Evt.factorize.ts index 21c2093b..d797b67c 100644 --- a/src/lib/Evt.factorize.ts +++ b/lib/Evt.factorize.ts @@ -1,7 +1,7 @@ -import { FactorizeEvt } from "./types/helper/FactorizeEvt"; +import { FactorizeEvt } from "./types/helper/FactorizeEvt.ts"; -type EvtLike = import("./types/helper/UnpackEvt").EvtLike; +type EvtLike = import("./types/helper/UnpackEvt.ts").EvtLike; /** https://docs.evt.land/api/evt/factorize */ export function factorize>( @@ -11,7 +11,7 @@ export function factorize>( } /* -import { Evt } from "./Evt"; +import { Evt } from "./Evt.ts"; const x: Evt = loosenType(new Evt()); x; const y: Evt = loosenType(new Evt()); y; */ \ No newline at end of file diff --git a/src/lib/Evt.from.ts b/lib/Evt.from.ts similarity index 91% rename from src/lib/Evt.from.ts rename to lib/Evt.from.ts index 21a7e1bb..52a0b2f4 100644 --- a/src/lib/Evt.from.ts +++ b/lib/Evt.from.ts @@ -1,15 +1,15 @@ -import { id } from "../tools/typeSafety/id"; -import { assert } from "../tools/typeSafety/assert"; -import { typeGuard } from "../tools/typeSafety/typeGuard"; -import { EventTargetLike } from "./types/EventTargetLike"; -import { mergeImpl } from "./Evt.merge"; -import { importProxy } from "./importProxy"; -import * as dom from "./types/lib.dom"; -type Evt= import("./types/interfaces/Evt").Evt; -type EvtLike = import("./types/helper/UnpackEvt").EvtLike; +import { id } from "../tools/typeSafety/id.ts"; +import { assert } from "../tools/typeSafety/assert.ts"; +import { typeGuard } from "../tools/typeSafety/typeGuard.ts"; +import { EventTargetLike } from "./types/EventTargetLike.ts"; +import { mergeImpl } from "./Evt.merge.ts"; +import { importProxy } from "./importProxy.ts"; +import * as dom from "./types/lib.dom.ts"; +type Evt= import("./types/interfaces/Evt.ts").Evt; +type EvtLike = import("./types/helper/UnpackEvt.ts").EvtLike; type OneOrMany = T | ArrayLike; -type CtxLike = import("./types/interfaces").CtxLike & { +type CtxLike = import("./types/interfaces/index.ts").CtxLike & { evtDoneOrAborted: EvtLike & { postCount: number; attachOnce(callback: ()=> void): void; }; }; diff --git a/src/lib/Evt.getCtx.ts b/lib/Evt.getCtx.ts similarity index 74% rename from src/lib/Evt.getCtx.ts rename to lib/Evt.getCtx.ts index c84ff310..b48d3901 100644 --- a/src/lib/Evt.getCtx.ts +++ b/lib/Evt.getCtx.ts @@ -1,6 +1,6 @@ -import { Polyfill as WeakMap } from "minimal-polyfills/WeakMap"; -import { importProxy } from "./importProxy"; -type VoidCtx = import("./types/interfaces").VoidCtx; +import { Polyfill as WeakMap } from "https://raw.github.com/garronej/minimal_polyfills/2.0.1/WeakMap.ts"; +import { importProxy } from "./importProxy.ts"; +type VoidCtx = import("./types/interfaces/index.ts").VoidCtx; /** * https://docs.evt.land/api/evt/getctx diff --git a/src/lib/Evt.loosenType.ts b/lib/Evt.loosenType.ts similarity index 63% rename from src/lib/Evt.loosenType.ts rename to lib/Evt.loosenType.ts index 4cd04356..3f83c6d9 100644 --- a/src/lib/Evt.loosenType.ts +++ b/lib/Evt.loosenType.ts @@ -1,7 +1,7 @@ -import { SwapEvtType } from "./types/helper/SwapEvtType"; -import { UnpackEvt } from "./types/helper/UnpackEvt"; +import { SwapEvtType } from "./types/helper/SwapEvtType.ts"; +import { UnpackEvt } from "./types/helper/UnpackEvt.ts"; -type EvtLike = import("./types/helper/UnpackEvt").EvtLike; +type EvtLike = import("./types/helper/UnpackEvt.ts").EvtLike; /** * https://docs.evt.land/api/evt/loosenType @@ -14,7 +14,7 @@ export function loosenType, SupersetOfT>( } /* -import { Evt } from "./Evt"; +import { Evt } from "./Evt.ts"; const x: Evt = loosenType(new Evt()); x; const y: Evt = loosenType(new Evt()); y; */ diff --git a/src/lib/Evt.merge.ts b/lib/Evt.merge.ts similarity index 79% rename from src/lib/Evt.merge.ts rename to lib/Evt.merge.ts index cad5f7f0..df85ea78 100644 --- a/src/lib/Evt.merge.ts +++ b/lib/Evt.merge.ts @@ -1,10 +1,10 @@ -import { UnpackEvt } from "./types/helper/UnpackEvt"; -import { importProxy } from "./importProxy"; +import { UnpackEvt } from "./types/helper/UnpackEvt.ts"; +import { importProxy } from "./importProxy.ts"; -type Evt= import("./types/interfaces").Evt; -type CtxLike = import("./types/interfaces").CtxLike; +type Evt= import("./types/interfaces/index.ts").Evt; +type CtxLike = import("./types/interfaces/index.ts").CtxLike; -type EvtLike = import("./types/helper/UnpackEvt").EvtLike & { +type EvtLike = import("./types/helper/UnpackEvt.ts").EvtLike & { attach(ctx: CtxLike, callback: (data: T)=> void): void; attach(callback: (data: T)=> void): void; }; diff --git a/src/lib/Evt.newCtx.ts b/lib/Evt.newCtx.ts similarity index 57% rename from src/lib/Evt.newCtx.ts rename to lib/Evt.newCtx.ts index a77a4b9c..6ef93054 100644 --- a/src/lib/Evt.newCtx.ts +++ b/lib/Evt.newCtx.ts @@ -1,7 +1,7 @@ -import { importProxy } from "./importProxy"; +import { importProxy } from "./importProxy.ts"; -type Ctx = import("./Ctx").Ctx; -type VoidCtx = import("./types/interfaces").VoidCtx; +type Ctx = import("./Ctx.ts").Ctx; +type VoidCtx = import("./types/interfaces/index.ts").VoidCtx; /** * https://docs.evt.land/api/evt/newctx diff --git a/src/lib/Evt.parsePropsFromArgs.ts b/lib/Evt.parsePropsFromArgs.ts similarity index 95% rename from src/lib/Evt.parsePropsFromArgs.ts rename to lib/Evt.parsePropsFromArgs.ts index e37b3cd2..241276f5 100644 --- a/src/lib/Evt.parsePropsFromArgs.ts +++ b/lib/Evt.parsePropsFromArgs.ts @@ -1,10 +1,10 @@ -import { Handler } from "./types/Handler" -import { Operator } from "./types/Operator" -import { id } from "../tools/typeSafety/id"; -import { compose } from "./util/compose"; -import { typeGuard } from "../tools/typeSafety/typeGuard" -type CtxLike = import("./types/interfaces").CtxLike; +import { Handler } from "./types/Handler.ts" +import { Operator } from "./types/Operator.ts" +import { id } from "../tools/typeSafety/id.ts"; +import { compose } from "./util/compose.ts"; +import { typeGuard } from "../tools/typeSafety/typeGuard.ts" +type CtxLike = import("./types/interfaces/index.ts").CtxLike; export function matchAll() { return true; } diff --git a/src/lib/Evt.ts b/lib/Evt.ts similarity index 93% rename from src/lib/Evt.ts rename to lib/Evt.ts index d7490360..38c9cc0f 100644 --- a/src/lib/Evt.ts +++ b/lib/Evt.ts @@ -1,33 +1,33 @@ -import "minimal-polyfills/Array.prototype.find"; -import { importProxy } from "./importProxy"; -import { create } from "./Evt.create"; -import { getCtxFactory } from "./Evt.getCtx"; -import { factorize } from "./Evt.factorize"; -import { merge } from "./Evt.merge"; -import { from } from "./Evt.from"; -import { useEffect } from "./Evt.useEffect"; -import { asPostable } from "./Evt.asPostable"; -import { asNonPostable } from "./Evt.asNonPostable"; -import { parsePropsFromArgs, matchAll } from "./Evt.parsePropsFromArgs"; -import { newCtx } from "./Evt.newCtx"; -import { LazyEvt } from "./LazyEvt"; -import { defineAccessors } from "../tools/typeSafety/defineAccessors"; -import { invokeOperator } from "./util/invokeOperator"; -import { Polyfill as Map, LightMap } from "minimal-polyfills/Map"; -import { Polyfill as WeakMap } from "minimal-polyfills/WeakMap"; -import * as runExclusive from "run-exclusive"; -import { EvtError } from "./types/EvtError"; -import { overwriteReadonlyProp } from "../tools/typeSafety/overwriteReadonlyProp"; -import { typeGuard } from "../tools/typeSafety/typeGuard"; -import { encapsulateOpState } from "./util/encapsulateOpState"; -import { Deferred } from "../tools/Deferred"; -import { loosenType } from "./Evt.loosenType"; -import { CtxLike } from "./types/interfaces/CtxLike"; - -import { Handler } from "./types/Handler"; -import { Operator } from "./types/Operator"; -type NonPostableEvt = import("./types/interfaces").NonPostableEvt; -type StatefulEvt = import("./types/interfaces").StatefulEvt; +import "https://raw.github.com/garronej/minimal_polyfills/2.0.1/Array.prototype.find.ts"; +import { importProxy } from "./importProxy.ts"; +import { create } from "./Evt.create.ts"; +import { getCtxFactory } from "./Evt.getCtx.ts"; +import { factorize } from "./Evt.factorize.ts"; +import { merge } from "./Evt.merge.ts"; +import { from } from "./Evt.from.ts"; +import { useEffect } from "./Evt.useEffect.ts"; +import { asPostable } from "./Evt.asPostable.ts"; +import { asNonPostable } from "./Evt.asNonPostable.ts"; +import { parsePropsFromArgs, matchAll } from "./Evt.parsePropsFromArgs.ts"; +import { newCtx } from "./Evt.newCtx.ts"; +import { LazyEvt } from "./LazyEvt.ts"; +import { defineAccessors } from "../tools/typeSafety/defineAccessors.ts"; +import { invokeOperator } from "./util/invokeOperator.ts"; +import { Polyfill as Map, LightMap } from "https://raw.github.com/garronej/minimal_polyfills/2.0.1/Map.ts"; +import { Polyfill as WeakMap } from "https://raw.github.com/garronej/minimal_polyfills/2.0.1/WeakMap.ts"; +import * as runExclusive from "https://raw.github.com/garronej/run_exclusive/2.1.18/mod.ts"; +import { EvtError } from "./types/EvtError.ts"; +import { overwriteReadonlyProp } from "../tools/typeSafety/overwriteReadonlyProp.ts"; +import { typeGuard } from "../tools/typeSafety/typeGuard.ts"; +import { encapsulateOpState } from "./util/encapsulateOpState.ts"; +import { Deferred } from "../tools/Deferred.ts"; +import { loosenType } from "./Evt.loosenType.ts"; +import { CtxLike } from "./types/interfaces/CtxLike.ts"; + +import { Handler } from "./types/Handler.ts"; +import { Operator } from "./types/Operator.ts"; +type NonPostableEvt = import("./types/interfaces/index.ts").NonPostableEvt; +type StatefulEvt = import("./types/interfaces/index.ts").StatefulEvt; //NOTE: Deno can't use NodeJS type def ( obviously ) type Timer= { _timerBrand: any; }; @@ -35,7 +35,7 @@ const safeSetTimeout = (callback: () => void, ms: number): Timer => setTimeout(c const safeClearTimeout = (timer: Timer): void => clearTimeout(timer as any); /** https://docs.evt.land/api/evt */ -export type Evt = import("./types/interfaces").Evt; +export type Evt = import("./types/interfaces/index.ts").Evt; class EvtImpl implements Evt { diff --git a/src/lib/Evt.useEffect.ts b/lib/Evt.useEffect.ts similarity index 100% rename from src/lib/Evt.useEffect.ts rename to lib/Evt.useEffect.ts diff --git a/src/lib/LazyEvt.ts b/lib/LazyEvt.ts similarity index 86% rename from src/lib/LazyEvt.ts rename to lib/LazyEvt.ts index ad49b666..62877746 100644 --- a/src/lib/LazyEvt.ts +++ b/lib/LazyEvt.ts @@ -1,7 +1,7 @@ -import { overwriteReadonlyProp } from "../tools/typeSafety/overwriteReadonlyProp"; -import { importProxy } from "./importProxy"; -type Evt = import("./types/interfaces").Evt; -import { defineAccessors } from "../tools/typeSafety/defineAccessors"; +import { overwriteReadonlyProp } from "../tools/typeSafety/overwriteReadonlyProp.ts"; +import { importProxy } from "./importProxy.ts"; +type Evt = import("./types/interfaces/index.ts").Evt; +import { defineAccessors } from "../tools/typeSafety/defineAccessors.ts"; export class LazyEvt { diff --git a/src/lib/LazyStatefulEvt.ts b/lib/LazyStatefulEvt.ts similarity index 88% rename from src/lib/LazyStatefulEvt.ts rename to lib/LazyStatefulEvt.ts index ac10f867..1874290b 100644 --- a/src/lib/LazyStatefulEvt.ts +++ b/lib/LazyStatefulEvt.ts @@ -1,7 +1,7 @@ -import { overwriteReadonlyProp } from "../tools/typeSafety/overwriteReadonlyProp"; -import { importProxy } from "./importProxy"; -type StatefulEvt = import("./types/interfaces").StatefulEvt; -import { defineAccessors } from "../tools/typeSafety/defineAccessors"; +import { overwriteReadonlyProp } from "../tools/typeSafety/overwriteReadonlyProp.ts"; +import { importProxy } from "./importProxy.ts"; +type StatefulEvt = import("./types/interfaces/index.ts").StatefulEvt; +import { defineAccessors } from "../tools/typeSafety/defineAccessors.ts"; export class LazyStatefulEvt { diff --git a/src/lib/StatefulEvt.ts b/lib/StatefulEvt.ts similarity index 81% rename from src/lib/StatefulEvt.ts rename to lib/StatefulEvt.ts index 730345d1..7f559e0d 100644 --- a/src/lib/StatefulEvt.ts +++ b/lib/StatefulEvt.ts @@ -1,19 +1,19 @@ -import "minimal-polyfills/Object.is"; -import { defineAccessors } from "../tools/typeSafety/defineAccessors"; -import { LazyEvt } from "./LazyEvt"; -import { LazyStatefulEvt } from "./LazyStatefulEvt"; -import { importProxy } from "./importProxy"; -import { invokeOperator } from "./util/invokeOperator"; -import { Operator } from "./types/Operator"; -import { parsePropsFromArgs } from "./Evt.parsePropsFromArgs"; -import { CtxLike } from "./types/interfaces/CtxLike"; -type Diff = import("./types/interfaces").Diff; -type NonPostableEvt = import("./types/interfaces").NonPostableEvt; -type StatefulReadonlyEvt= import("./types/interfaces").StatefulReadonlyEvt; -import { Evt } from "./Evt"; +import "https://raw.github.com/garronej/minimal_polyfills/2.0.1/Object.is.ts"; +import { defineAccessors } from "../tools/typeSafety/defineAccessors.ts"; +import { LazyEvt } from "./LazyEvt.ts"; +import { LazyStatefulEvt } from "./LazyStatefulEvt.ts"; +import { importProxy } from "./importProxy.ts"; +import { invokeOperator } from "./util/invokeOperator.ts"; +import { Operator } from "./types/Operator.ts"; +import { parsePropsFromArgs } from "./Evt.parsePropsFromArgs.ts"; +import { CtxLike } from "./types/interfaces/CtxLike.ts"; +type Diff = import("./types/interfaces/index.ts").Diff; +type NonPostableEvt = import("./types/interfaces/index.ts").NonPostableEvt; +type StatefulReadonlyEvt= import("./types/interfaces/index.ts").StatefulReadonlyEvt; +import { Evt } from "./Evt.ts"; /** https://docs.evt.land/api/statefulevt */ -export type StatefulEvt = import("./types/interfaces").StatefulEvt; +export type StatefulEvt = import("./types/interfaces/index.ts").StatefulEvt; class StatefulEvtImpl extends Evt implements StatefulEvt { diff --git a/lib/importProxy.ts b/lib/importProxy.ts new file mode 100644 index 00000000..f412bc0d --- /dev/null +++ b/lib/importProxy.ts @@ -0,0 +1,11 @@ + + +/** Manually handling circular import so React Native does not gives warning. */ +export const importProxy: { + Ctx: typeof import("./Ctx.ts").Ctx; + Evt: typeof import("./Evt.ts").Evt; + StatefulEvt: typeof import("./StatefulEvt.ts").StatefulEvt; +} = {} as any; + + + diff --git a/lib/index.ts b/lib/index.ts new file mode 100644 index 00000000..105b8e33 --- /dev/null +++ b/lib/index.ts @@ -0,0 +1,9 @@ + +export * from "./types/index.ts"; +export * from "./util/index.ts"; + +export { Ctx } from "./Ctx.ts"; +export { Evt } from "./Evt.ts"; +export { StatefulEvt } from "./StatefulEvt.ts"; + +export { matchVoid } from "../tools/typeSafety/matchVoid.ts"; diff --git a/src/lib/types/EventTargetLike.ts b/lib/types/EventTargetLike.ts similarity index 98% rename from src/lib/types/EventTargetLike.ts rename to lib/types/EventTargetLike.ts index d940ea2d..351e1961 100644 --- a/src/lib/types/EventTargetLike.ts +++ b/lib/types/EventTargetLike.ts @@ -1,5 +1,5 @@ -import { typeGuard } from "../../tools/typeSafety"; +import { typeGuard } from "../../tools/typeSafety/index.ts"; export type EventTargetLike = EventTargetLike.HasEventTargetAddRemove | diff --git a/src/lib/types/EvtError.ts b/lib/types/EvtError.ts similarity index 100% rename from src/lib/types/EvtError.ts rename to lib/types/EvtError.ts diff --git a/src/lib/types/Handler.ts b/lib/types/Handler.ts similarity index 89% rename from src/lib/types/Handler.ts rename to lib/types/Handler.ts index 33a62156..37147ebd 100644 --- a/src/lib/types/Handler.ts +++ b/lib/types/Handler.ts @@ -1,6 +1,6 @@ -import { Operator } from "./Operator"; -type EvtLike= import("../types/helper/UnpackEvt").EvtLike; -type CtxLike = import("../types/interfaces").CtxLike; +import { Operator } from "./Operator.ts"; +type EvtLike= import("../types/helper/UnpackEvt.ts").EvtLike; +type CtxLike = import("../types/interfaces/index.ts").CtxLike; /** https://docs.evt.land/api/handler */ export type Handler | undefined = CtxLike | undefined> = diff --git a/src/lib/types/Operator.ts b/lib/types/Operator.ts similarity index 96% rename from src/lib/types/Operator.ts rename to lib/types/Operator.ts index 7f5a0f8e..80160849 100644 --- a/src/lib/types/Operator.ts +++ b/lib/types/Operator.ts @@ -1,6 +1,6 @@ -import { typeGuard } from "../../tools/typeSafety"; -type CtxLike = import("./interfaces").CtxLike; -type VoidCtxLike = import("./interfaces").VoidCtxLike; +import { typeGuard } from "../../tools/typeSafety/index.ts"; +type CtxLike = import("./interfaces/index.ts").CtxLike; +type VoidCtxLike = import("./interfaces/index.ts").VoidCtxLike; /** https://docs.evt.land/api/operator */ diff --git a/src/lib/types/helper/FactorizeEvt.ts b/lib/types/helper/FactorizeEvt.ts similarity index 53% rename from src/lib/types/helper/FactorizeEvt.ts rename to lib/types/helper/FactorizeEvt.ts index 6b0d9611..7e128213 100644 --- a/src/lib/types/helper/FactorizeEvt.ts +++ b/lib/types/helper/FactorizeEvt.ts @@ -1,7 +1,7 @@ -import { SwapEvtType } from "./SwapEvtType"; -import { UnpackEvt } from "./UnpackEvt"; -type EvtLike= import("./UnpackEvt").EvtLike; +import { SwapEvtType } from "./SwapEvtType.ts"; +import { UnpackEvt } from "./UnpackEvt.ts"; +type EvtLike= import("./UnpackEvt.ts").EvtLike; /** https://docs.evt.land/api/helpertypes#swapevttype-less-than-e-t-greater-than */ export type FactorizeEvt> = SwapEvtType>; diff --git a/src/lib/types/helper/SwapEvtType.ts b/lib/types/helper/SwapEvtType.ts similarity index 53% rename from src/lib/types/helper/SwapEvtType.ts rename to lib/types/helper/SwapEvtType.ts index b9212a6f..2459c948 100644 --- a/src/lib/types/helper/SwapEvtType.ts +++ b/lib/types/helper/SwapEvtType.ts @@ -1,9 +1,9 @@ -type StatefulEvt = import("../interfaces").StatefulEvt; -type StatefulReadonlyEvt = import("../interfaces").StatefulReadonlyEvt; -type Evt = import("../interfaces").Evt; -type NonPostableEvt = import("../interfaces").NonPostableEvt; -type EvtLike = import("./UnpackEvt").EvtLike; -type VoidEvt = import("../interfaces").VoidEvt; +type StatefulEvt = import("../interfaces/index.ts").StatefulEvt; +type StatefulReadonlyEvt = import("../interfaces/index.ts").StatefulReadonlyEvt; +type Evt = import("../interfaces/index.ts").Evt; +type NonPostableEvt = import("../interfaces/index.ts").NonPostableEvt; +type EvtLike = import("./UnpackEvt.ts").EvtLike; +type VoidEvt = import("../interfaces/index.ts").VoidEvt; type UseVoidEvt = E extends Evt ? VoidEvt : E; diff --git a/src/lib/types/helper/ToNonPostableEvt.ts b/lib/types/helper/ToNonPostableEvt.ts similarity index 73% rename from src/lib/types/helper/ToNonPostableEvt.ts rename to lib/types/helper/ToNonPostableEvt.ts index 2b2c0436..0304a42e 100644 --- a/src/lib/types/helper/ToNonPostableEvt.ts +++ b/lib/types/helper/ToNonPostableEvt.ts @@ -1,8 +1,8 @@ -type EvtLike = import("./UnpackEvt").EvtLike; -type StatefulPostable = import("../interfaces").StatefulPostable; -type NonPostableEvt = import("../interfaces").NonPostableEvt; -type StatefulReadonlyEvt = import("../interfaces").StatefulReadonlyEvt; +type EvtLike = import("./UnpackEvt.ts").EvtLike; +type StatefulPostable = import("../interfaces/index.ts").StatefulPostable; +type NonPostableEvt = import("../interfaces/index.ts").NonPostableEvt; +type StatefulReadonlyEvt = import("../interfaces/index.ts").StatefulReadonlyEvt; //NOTE: Omit only introduced in 3.5 /** diff --git a/src/lib/types/helper/ToPostableEvt.ts b/lib/types/helper/ToPostableEvt.ts similarity index 57% rename from src/lib/types/helper/ToPostableEvt.ts rename to lib/types/helper/ToPostableEvt.ts index 596d07e5..d1e76660 100644 --- a/src/lib/types/helper/ToPostableEvt.ts +++ b/lib/types/helper/ToPostableEvt.ts @@ -1,11 +1,11 @@ -type EvtLike = import("./UnpackEvt").EvtLike; -type StatefulPostable = import("../interfaces").StatefulPostable; -type Postable = import("../interfaces").Postable; -type NonPostableEvt = import("../interfaces").NonPostableEvt; -type StatefulReadonlyEvt = import("../interfaces").StatefulReadonlyEvt; -type StatefulEvt = import("../interfaces").StatefulEvt; -type Evt = import("../interfaces").Evt; -type VoidEvt = import("../interfaces").VoidEvt; +type EvtLike = import("./UnpackEvt.ts").EvtLike; +type StatefulPostable = import("../interfaces/index.ts").StatefulPostable; +type Postable = import("../interfaces/index.ts").Postable; +type NonPostableEvt = import("../interfaces/index.ts").NonPostableEvt; +type StatefulReadonlyEvt = import("../interfaces/index.ts").StatefulReadonlyEvt; +type StatefulEvt = import("../interfaces/index.ts").StatefulEvt; +type Evt = import("../interfaces/index.ts").Evt; +type VoidEvt = import("../interfaces/index.ts").VoidEvt; type UseVoidEvt = E extends Evt ? VoidEvt : E; diff --git a/src/lib/types/helper/UnpackCtx.ts b/lib/types/helper/UnpackCtx.ts similarity index 100% rename from src/lib/types/helper/UnpackCtx.ts rename to lib/types/helper/UnpackCtx.ts diff --git a/src/lib/types/helper/UnpackEvt.ts b/lib/types/helper/UnpackEvt.ts similarity index 100% rename from src/lib/types/helper/UnpackEvt.ts rename to lib/types/helper/UnpackEvt.ts diff --git a/lib/types/helper/index.ts b/lib/types/helper/index.ts new file mode 100644 index 00000000..b690b7ee --- /dev/null +++ b/lib/types/helper/index.ts @@ -0,0 +1,6 @@ +export { FactorizeEvt } from "./FactorizeEvt.ts"; +export { SwapEvtType } from "./SwapEvtType.ts"; +export { ToPostableEvt } from "./ToPostableEvt.ts"; +export { ToNonPostableEvt } from "./ToNonPostableEvt.ts"; +export { UnpackCtx } from "./UnpackCtx.ts"; +export { UnpackEvt, EvtLike } from "./UnpackEvt.ts"; \ No newline at end of file diff --git a/lib/types/index.ts b/lib/types/index.ts new file mode 100644 index 00000000..6c55822e --- /dev/null +++ b/lib/types/index.ts @@ -0,0 +1,7 @@ +export * from "./helper/index.ts"; +export * from "./interfaces/index.ts"; +export { EventTargetLike } from "./EventTargetLike.ts"; +export { EvtError } from "./EvtError.ts"; +export { Handler } from "./Handler.ts"; +import * as dom from "./lib.dom.ts"; export { dom }; +export { Operator } from "./Operator.ts"; diff --git a/src/lib/types/interfaces/Ctx.ts b/lib/types/interfaces/Ctx.ts similarity index 93% rename from src/lib/types/interfaces/Ctx.ts rename to lib/types/interfaces/Ctx.ts index aede4899..242682ba 100644 --- a/src/lib/types/interfaces/Ctx.ts +++ b/lib/types/interfaces/Ctx.ts @@ -1,9 +1,9 @@ -import { Handler } from "../Handler"; +import { Handler } from "../Handler.ts"; -type EvtLike = import("../helper/UnpackEvt").EvtLike; -type Evt = import("./Evt").Evt; -type CtxLike = import("./CtxLike").CtxLike; +type EvtLike = import("../helper/UnpackEvt.ts").EvtLike; +type Evt = import("./Evt.ts").Evt; +type CtxLike = import("./CtxLike.ts").CtxLike; export type DoneOrAborted = DoneOrAborted.Done | DoneOrAborted.Aborted; diff --git a/src/lib/types/interfaces/CtxLike.ts b/lib/types/interfaces/CtxLike.ts similarity index 83% rename from src/lib/types/interfaces/CtxLike.ts rename to lib/types/interfaces/CtxLike.ts index ed79d94c..73d7a968 100644 --- a/src/lib/types/interfaces/CtxLike.ts +++ b/lib/types/interfaces/CtxLike.ts @@ -1,7 +1,7 @@ -import { Handler } from "../Handler"; -import { typeGuard } from "../../../tools/typeSafety/typeGuard"; -type EvtLike = import("../helper/UnpackEvt").EvtLike; +import { Handler } from "../Handler.ts"; +import { typeGuard } from "../../../tools/typeSafety/typeGuard.ts"; +type EvtLike = import("../helper/UnpackEvt.ts").EvtLike; /** * Minimal interface that an object must implement to be a valid context argument diff --git a/lib/types/interfaces/Evt.ts b/lib/types/interfaces/Evt.ts new file mode 100644 index 00000000..a6ce8b8e --- /dev/null +++ b/lib/types/interfaces/Evt.ts @@ -0,0 +1,5 @@ + +type Postable = import("./Postable.ts").Postable; +type NonPostableEvt = import("./NonPostableEvt.ts").NonPostableEvt; + +export interface Evt extends Postable, NonPostableEvt { } \ No newline at end of file diff --git a/src/lib/types/interfaces/NonPostableEvt.ts b/lib/types/interfaces/NonPostableEvt.ts similarity index 99% rename from src/lib/types/interfaces/NonPostableEvt.ts rename to lib/types/interfaces/NonPostableEvt.ts index db6f6226..a39316f3 100644 --- a/src/lib/types/interfaces/NonPostableEvt.ts +++ b/lib/types/interfaces/NonPostableEvt.ts @@ -1,9 +1,9 @@ -import { Handler } from "../Handler"; -import { Operator } from "../Operator"; +import { Handler } from "../Handler.ts"; +import { Operator } from "../Operator.ts"; -type StatefulEvt = import("./StatefulEvt").StatefulEvt; -type CtxLike = import("./CtxLike").CtxLike; -type Evt = import("./Evt").Evt; +type StatefulEvt = import("./StatefulEvt.ts").StatefulEvt; +type CtxLike = import("./CtxLike.ts").CtxLike; +type Evt = import("./Evt.ts").Evt; export interface NonPostableEvt { diff --git a/src/lib/types/interfaces/Postable.ts b/lib/types/interfaces/Postable.ts similarity index 100% rename from src/lib/types/interfaces/Postable.ts rename to lib/types/interfaces/Postable.ts diff --git a/lib/types/interfaces/StatefulEvt.ts b/lib/types/interfaces/StatefulEvt.ts new file mode 100644 index 00000000..b080e6ad --- /dev/null +++ b/lib/types/interfaces/StatefulEvt.ts @@ -0,0 +1,10 @@ + +type StatefulReadonlyEvt = import("./StatefulReadonlyEvt.ts").StatefulReadonlyEvt; +type StatefulPostable = import("./StatefulPostable.ts").StatefulPostable; + +export interface StatefulEvt extends StatefulReadonlyEvt, StatefulPostable { + + /** https://docs.evt.land/api/statefulevt#state */ + state: T; + +}; diff --git a/src/lib/types/interfaces/StatefulPostable.ts b/lib/types/interfaces/StatefulPostable.ts similarity index 78% rename from src/lib/types/interfaces/StatefulPostable.ts rename to lib/types/interfaces/StatefulPostable.ts index 4283dce1..6cc87f7c 100644 --- a/src/lib/types/interfaces/StatefulPostable.ts +++ b/lib/types/interfaces/StatefulPostable.ts @@ -1,5 +1,5 @@ -type Postable= import("./Postable").Postable; +type Postable= import("./Postable.ts").Postable; export interface StatefulPostable extends Postable { diff --git a/src/lib/types/interfaces/StatefulReadonlyEvt.ts b/lib/types/interfaces/StatefulReadonlyEvt.ts similarity index 94% rename from src/lib/types/interfaces/StatefulReadonlyEvt.ts rename to lib/types/interfaces/StatefulReadonlyEvt.ts index c3cd7794..07d39457 100644 --- a/src/lib/types/interfaces/StatefulReadonlyEvt.ts +++ b/lib/types/interfaces/StatefulReadonlyEvt.ts @@ -1,10 +1,10 @@ -import { Operator } from "../Operator"; +import { Operator } from "../Operator.ts"; -type NonPostableEvt = import("./NonPostableEvt").NonPostableEvt; -type CtxLike = import("./CtxLike").CtxLike; -type StatefulEvt = import("./StatefulEvt").StatefulEvt; -type Evt = import("./Evt").Evt; +type NonPostableEvt = import("./NonPostableEvt.ts").NonPostableEvt; +type CtxLike = import("./CtxLike.ts").CtxLike; +type StatefulEvt = import("./StatefulEvt.ts").StatefulEvt; +type Evt = import("./Evt.ts").Evt; export type StateDiff = { prevState: T, newState: T }; diff --git a/src/lib/types/interfaces/VoidCtx.ts b/lib/types/interfaces/VoidCtx.ts similarity index 72% rename from src/lib/types/interfaces/VoidCtx.ts rename to lib/types/interfaces/VoidCtx.ts index b129722c..f77c0847 100644 --- a/src/lib/types/interfaces/VoidCtx.ts +++ b/lib/types/interfaces/VoidCtx.ts @@ -1,7 +1,7 @@ -import { Handler } from "../Handler"; +import { Handler } from "../Handler.ts"; -type Ctx = import("./Ctx").Ctx; +type Ctx = import("./Ctx.ts").Ctx; /** * https://docs.evt.land/api/evt/ctx diff --git a/src/lib/types/interfaces/VoidEvt.ts b/lib/types/interfaces/VoidEvt.ts similarity index 89% rename from src/lib/types/interfaces/VoidEvt.ts rename to lib/types/interfaces/VoidEvt.ts index ca8aba53..e65583fd 100644 --- a/src/lib/types/interfaces/VoidEvt.ts +++ b/lib/types/interfaces/VoidEvt.ts @@ -1,5 +1,5 @@ -type Evt = import("./Evt").Evt; +type Evt = import("./Evt.ts").Evt; /** * https://docs.evt.land/api/evt/create#why-voidevt-and-not-evt-less-than-void-greater-than diff --git a/lib/types/interfaces/index.ts b/lib/types/interfaces/index.ts new file mode 100644 index 00000000..ed4c431e --- /dev/null +++ b/lib/types/interfaces/index.ts @@ -0,0 +1,10 @@ +export { Ctx, DoneOrAborted } from "./Ctx.ts"; +export { CtxLike, VoidCtxLike } from "./CtxLike.ts"; +export { Evt } from "./Evt.ts"; +export { NonPostableEvt } from "./NonPostableEvt.ts"; +export { Postable } from "./Postable.ts"; +export { StatefulEvt } from "./StatefulEvt.ts"; +export { StatefulReadonlyEvt, StateDiff as Diff } from "./StatefulReadonlyEvt.ts"; +export { StatefulPostable } from "./StatefulPostable.ts"; +export { VoidCtx } from "./VoidCtx.ts"; +export { VoidEvt } from "./VoidEvt.ts"; \ No newline at end of file diff --git a/src/lib/types/lib.dom.ts b/lib/types/lib.dom.ts similarity index 100% rename from src/lib/types/lib.dom.ts rename to lib/types/lib.dom.ts diff --git a/src/lib/util/compose.ts b/lib/util/compose.ts similarity index 95% rename from src/lib/util/compose.ts rename to lib/util/compose.ts index d5707eb0..3f2a327d 100644 --- a/src/lib/util/compose.ts +++ b/lib/util/compose.ts @@ -1,9 +1,9 @@ -import { encapsulateOpState } from "./encapsulateOpState"; -import { invokeOperator } from "./invokeOperator"; -import { Operator } from "../types/Operator"; -import { id } from "../../tools/typeSafety/id"; -import { assert } from "../../tools/typeSafety/assert"; -import { typeGuard } from "../../tools/typeSafety/typeGuard"; +import { encapsulateOpState } from "./encapsulateOpState.ts"; +import { invokeOperator } from "./invokeOperator.ts"; +import { Operator } from "../types/Operator.ts"; +import { id } from "../../tools/typeSafety/id.ts"; +import { assert } from "../../tools/typeSafety/assert.ts"; +import { typeGuard } from "../../tools/typeSafety/typeGuard.ts"; function f_o_g( op1: Operator, diff --git a/src/lib/util/encapsulateOpState.ts b/lib/util/encapsulateOpState.ts similarity index 85% rename from src/lib/util/encapsulateOpState.ts rename to lib/util/encapsulateOpState.ts index 8cfb7776..ec8a972f 100644 --- a/src/lib/util/encapsulateOpState.ts +++ b/lib/util/encapsulateOpState.ts @@ -1,5 +1,5 @@ -import { id } from "../../tools/typeSafety/id"; -import { Operator } from "../types/Operator"; +import { id } from "../../tools/typeSafety/id.ts"; +import { Operator } from "../types/Operator.ts"; export function encapsulateOpState( statefulFλOp: Operator.fλ.Stateful diff --git a/src/lib/util/genericOperators/chunksOf.ts b/lib/util/genericOperators/chunksOf.ts similarity index 96% rename from src/lib/util/genericOperators/chunksOf.ts rename to lib/util/genericOperators/chunksOf.ts index 8cfdfdee..f5d603ee 100644 --- a/src/lib/util/genericOperators/chunksOf.ts +++ b/lib/util/genericOperators/chunksOf.ts @@ -1,5 +1,5 @@ -import { compose } from "../compose"; -import { concatUint8Array } from "../../../tools/concatUint8Array"; +import { compose } from "../compose.ts"; +import { concatUint8Array } from "../../../tools/concatUint8Array.ts"; /** Output Uint8Array of fixed size*/ export const chunksOf = (byteLength: number) => { diff --git a/lib/util/genericOperators/index.ts b/lib/util/genericOperators/index.ts new file mode 100644 index 00000000..72ada717 --- /dev/null +++ b/lib/util/genericOperators/index.ts @@ -0,0 +1,2 @@ +export { throttleTime } from "./throttleTime.ts"; +export { to } from "./to.ts"; \ No newline at end of file diff --git a/src/lib/util/genericOperators/scan.ts b/lib/util/genericOperators/scan.ts similarity index 88% rename from src/lib/util/genericOperators/scan.ts rename to lib/util/genericOperators/scan.ts index 1be88838..c5a19e87 100644 --- a/src/lib/util/genericOperators/scan.ts +++ b/lib/util/genericOperators/scan.ts @@ -1,4 +1,4 @@ -import { compose } from "../compose"; +import { compose } from "../compose.ts"; export const scan = ( accumulator: (acc: U, value: T, index: number) => U, diff --git a/src/lib/util/genericOperators/throttleTime.ts b/lib/util/genericOperators/throttleTime.ts similarity index 91% rename from src/lib/util/genericOperators/throttleTime.ts rename to lib/util/genericOperators/throttleTime.ts index 6e9c80c9..6a397dfd 100644 --- a/src/lib/util/genericOperators/throttleTime.ts +++ b/lib/util/genericOperators/throttleTime.ts @@ -1,4 +1,4 @@ -import { compose } from "../compose"; +import { compose } from "../compose.ts"; export const throttleTime = (duration: number) => compose( diff --git a/src/lib/util/genericOperators/to.ts b/lib/util/genericOperators/to.ts similarity index 84% rename from src/lib/util/genericOperators/to.ts rename to lib/util/genericOperators/to.ts index 2080aa0f..152e9b49 100644 --- a/src/lib/util/genericOperators/to.ts +++ b/lib/util/genericOperators/to.ts @@ -1,4 +1,4 @@ -import { Operator } from "../../types/Operator"; +import { Operator } from "../../types/Operator.ts"; export const to = ( eventName: K diff --git a/lib/util/index.ts b/lib/util/index.ts new file mode 100644 index 00000000..98e42588 --- /dev/null +++ b/lib/util/index.ts @@ -0,0 +1,3 @@ +export * from "./genericOperators/index.ts"; +export { compose } from "./compose.ts"; +export { invokeOperator } from "./invokeOperator.ts"; \ No newline at end of file diff --git a/src/lib/util/invokeOperator.ts b/lib/util/invokeOperator.ts similarity index 94% rename from src/lib/util/invokeOperator.ts rename to lib/util/invokeOperator.ts index 64d1a809..83dab337 100644 --- a/src/lib/util/invokeOperator.ts +++ b/lib/util/invokeOperator.ts @@ -1,5 +1,5 @@ -import { Operator } from "../types/Operator"; +import { Operator } from "../types/Operator.ts"; /** Invoke any type of stateless operator and return as if it was a fλ*/ export function invokeOperator(op: Operator.fλ.Stateless, data: T, isPost?: true): Operator.fλ.Result; diff --git a/mod.ts b/mod.ts new file mode 100644 index 00000000..cee578a4 --- /dev/null +++ b/mod.ts @@ -0,0 +1,2 @@ +//Automatically generated by denoify. It is important not to edit this file. +export * from "./lib/index.ts"; \ No newline at end of file diff --git a/src/lib/importProxy.ts b/src/lib/importProxy.ts deleted file mode 100644 index 55fc58ac..00000000 --- a/src/lib/importProxy.ts +++ /dev/null @@ -1,11 +0,0 @@ - - -/** Manually handling circular import so React Native does not gives warning. */ -export const importProxy: { - Ctx: typeof import("./Ctx").Ctx; - Evt: typeof import("./Evt").Evt; - StatefulEvt: typeof import("./StatefulEvt").StatefulEvt; -} = {} as any; - - - diff --git a/src/lib/index.ts b/src/lib/index.ts deleted file mode 100644 index 2b52c6c1..00000000 --- a/src/lib/index.ts +++ /dev/null @@ -1,9 +0,0 @@ - -export * from "./types"; -export * from "./util"; - -export { Ctx } from "./Ctx"; -export { Evt } from "./Evt"; -export { StatefulEvt } from "./StatefulEvt"; - -export { matchVoid } from "../tools/typeSafety/matchVoid"; diff --git a/src/lib/types/helper/index.ts b/src/lib/types/helper/index.ts deleted file mode 100644 index 1f485991..00000000 --- a/src/lib/types/helper/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -export { FactorizeEvt } from "./FactorizeEvt"; -export { SwapEvtType } from "./SwapEvtType"; -export { ToPostableEvt } from "./ToPostableEvt"; -export { ToNonPostableEvt } from "./ToNonPostableEvt"; -export { UnpackCtx } from "./UnpackCtx"; -export { UnpackEvt, EvtLike } from "./UnpackEvt"; \ No newline at end of file diff --git a/src/lib/types/index.ts b/src/lib/types/index.ts deleted file mode 100644 index 648d1b0f..00000000 --- a/src/lib/types/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from "./helper"; -export * from "./interfaces"; -export { EventTargetLike } from "./EventTargetLike"; -export { EvtError } from "./EvtError"; -export { Handler } from "./Handler"; -import * as dom from "./lib.dom"; export { dom }; -export { Operator } from "./Operator"; diff --git a/src/lib/types/interfaces/Evt.ts b/src/lib/types/interfaces/Evt.ts deleted file mode 100644 index f19cae5d..00000000 --- a/src/lib/types/interfaces/Evt.ts +++ /dev/null @@ -1,5 +0,0 @@ - -type Postable = import("./Postable").Postable; -type NonPostableEvt = import("./NonPostableEvt").NonPostableEvt; - -export interface Evt extends Postable, NonPostableEvt { } \ No newline at end of file diff --git a/src/lib/types/interfaces/StatefulEvt.ts b/src/lib/types/interfaces/StatefulEvt.ts deleted file mode 100644 index f0cf412f..00000000 --- a/src/lib/types/interfaces/StatefulEvt.ts +++ /dev/null @@ -1,10 +0,0 @@ - -type StatefulReadonlyEvt = import("./StatefulReadonlyEvt").StatefulReadonlyEvt; -type StatefulPostable = import("./StatefulPostable").StatefulPostable; - -export interface StatefulEvt extends StatefulReadonlyEvt, StatefulPostable { - - /** https://docs.evt.land/api/statefulevt#state */ - state: T; - -}; diff --git a/src/lib/types/interfaces/index.ts b/src/lib/types/interfaces/index.ts deleted file mode 100644 index 346fe450..00000000 --- a/src/lib/types/interfaces/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -export { Ctx, DoneOrAborted } from "./Ctx"; -export { CtxLike, VoidCtxLike } from "./CtxLike"; -export { Evt } from "./Evt"; -export { NonPostableEvt } from "./NonPostableEvt"; -export { Postable } from "./Postable"; -export { StatefulEvt } from "./StatefulEvt"; -export { StatefulReadonlyEvt, StateDiff as Diff } from "./StatefulReadonlyEvt"; -export { StatefulPostable } from "./StatefulPostable"; -export { VoidCtx } from "./VoidCtx"; -export { VoidEvt } from "./VoidEvt"; \ No newline at end of file diff --git a/src/lib/util/genericOperators/index.ts b/src/lib/util/genericOperators/index.ts deleted file mode 100644 index 1a77267d..00000000 --- a/src/lib/util/genericOperators/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { throttleTime } from "./throttleTime"; -export { to } from "./to"; \ No newline at end of file diff --git a/src/lib/util/index.ts b/src/lib/util/index.ts deleted file mode 100644 index adec13de..00000000 --- a/src/lib/util/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./genericOperators"; -export { compose } from "./compose"; -export { invokeOperator } from "./invokeOperator"; \ No newline at end of file diff --git a/src/test/deno_index.ts b/src/test/deno_index.ts deleted file mode 100644 index b8a01295..00000000 --- a/src/test/deno_index.ts +++ /dev/null @@ -1,94 +0,0 @@ - -import "../tools/reducers/test"; - -import "./test1"; -import "./test2"; -import "./test3"; -import "./test4"; - - - -import "./test8"; -import "./test9"; -import "./test10"; -import "./test11"; - - -import "./test14"; -import "./test15"; -import "./test16"; -import "./test17"; -import "./test18"; -import "./test19"; - -import "./test21"; -import "./test22"; - -import "./test24"; -import "./test25"; -import "./test26"; -import "./test27"; -import "./test28"; -import "./test29"; -import "./test30"; -import "./test31"; - -import "./test33"; -import "./test34"; -import "./test35"; -import "./test36"; -import "./test37"; -import "./test38"; -import "./test39"; - - - - -import "./test44"; - - - - -import "./test49"; -import "./test50"; -import "./test51"; -import "./test52"; //May fail if test ran of slow host. -import "./test53"; -import "./test54"; -import "./test55"; - - - -import "./test59"; -import "./test60"; -import "./test61"; -import "./test62"; - -import "./test64"; -import "./test65"; -import "./test66"; -import "./test67"; -import "./test68"; -import "./test69"; -import "./test70"; -import "./test71"; -import "./test72"; -import "./test73"; - - -import "./test76"; - - -import "./test78"; -import "./test79"; -import "./test80"; -import "./test81"; -import "./test82"; -import "./test83"; -import "./test84"; -import "./test85"; -import "./test86"; -import "./test87"; -import "./test88"; -import "./test89"; -import "./test90"; \ No newline at end of file diff --git a/src/test/test85.ts b/src/test/test85.ts deleted file mode 100644 index ea7655cf..00000000 --- a/src/test/test85.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Evt, Ctx } from "../lib"; -import { assert } from "../tools/typeSafety/assert"; - -assert(Evt.name === "Evt"); -assert(Ctx.name === "Ctx"); - -console.log("PASS"); \ No newline at end of file diff --git a/src/tools/inDepth/index.ts b/src/tools/inDepth/index.ts deleted file mode 100644 index f3a6f522..00000000 --- a/src/tools/inDepth/index.ts +++ /dev/null @@ -1,3 +0,0 @@ - -export * from "./same"; -export * from "./copy"; \ No newline at end of file diff --git a/src/tools/reducers/index.ts b/src/tools/reducers/index.ts deleted file mode 100644 index 0a04731a..00000000 --- a/src/tools/reducers/index.ts +++ /dev/null @@ -1,28 +0,0 @@ - -import { allEquals, allEqualsFactory } from "./allEquals"; -import { allEqualsTo, allEqualsToFactory } from "./allEqualsTo"; -import { allUniq, allUniqFactory } from "./allUniq"; -import { and } from "./and"; -import { includes } from "./includes"; -import { count } from "./count"; -import { every } from "./every"; -import { or } from "./or"; -import { removeDuplicates, removeDuplicatesFactory } from "./removeDuplicates"; -import { sameAs, sameAsFactory } from "./sameAs"; -import { partition } from "./partition"; -import { diff } from "./diff"; - -export { - allEquals, allEqualsFactory, - allEqualsTo, allEqualsToFactory, - allUniq, allUniqFactory, - and, - includes, - count, - every, - or, - removeDuplicates, removeDuplicatesFactory, - sameAs, sameAsFactory, - partition, - diff -}; diff --git a/src/tools/testing/index.ts b/src/tools/testing/index.ts deleted file mode 100644 index 2b4805f4..00000000 --- a/src/tools/testing/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./getPromiseAssertionApi"; \ No newline at end of file diff --git a/src/tools/typeSafety/index.ts b/src/tools/typeSafety/index.ts deleted file mode 100644 index 08534cd4..00000000 --- a/src/tools/typeSafety/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -export { assert } from "./assert"; -export { AsyncReturnType } from "./AsyncReturnType"; -export { exclude } from "./exclude"; -export { id } from "./id"; -export { matchVoid } from "./matchVoid"; -export { objectKeys } from "./objectKeys"; -export { typeGuard } from "./typeGuard"; -export { UnpackPromise } from "./UnpackPromise"; -export { UnpackTypeGuard } from "./UnpackTypeGuard"; \ No newline at end of file diff --git a/test/deno_index.ts b/test/deno_index.ts new file mode 100644 index 00000000..9361aeed --- /dev/null +++ b/test/deno_index.ts @@ -0,0 +1,94 @@ + +import "../tools/reducers/test.ts"; + +import "./test1.ts"; +import "./test2.ts"; +import "./test3.ts"; +import "./test4.ts"; + + + +import "./test8.ts"; +import "./test9.ts"; +import "./test10.ts"; +import "./test11.ts"; + + +import "./test14.ts"; +import "./test15.ts"; +import "./test16.ts"; +import "./test17.ts"; +import "./test18.ts"; +import "./test19.ts"; + +import "./test21.ts"; +import "./test22.ts"; + +import "./test24.ts"; +import "./test25.ts"; +import "./test26.ts"; +import "./test27.ts"; +import "./test28.ts"; +import "./test29.ts"; +import "./test30.ts"; +import "./test31.ts"; + +import "./test33.ts"; +import "./test34.ts"; +import "./test35.ts"; +import "./test36.ts"; +import "./test37.ts"; +import "./test38.ts"; +import "./test39.ts"; + + + + +import "./test44.ts"; + + + + +import "./test49.ts"; +import "./test50.ts"; +import "./test51.ts"; +import "./test52.ts"; //May fail if test ran of slow host. +import "./test53.ts"; +import "./test54.ts"; +import "./test55.ts"; + + + +import "./test59.ts"; +import "./test60.ts"; +import "./test61.ts"; +import "./test62.ts"; + +import "./test64.ts"; +import "./test65.ts"; +import "./test66.ts"; +import "./test67.ts"; +import "./test68.ts"; +import "./test69.ts"; +import "./test70.ts"; +import "./test71.ts"; +import "./test72.ts"; +import "./test73.ts"; + + +import "./test76.ts"; + + +import "./test78.ts"; +import "./test79.ts"; +import "./test80.ts"; +import "./test81.ts"; +import "./test82.ts"; +import "./test83.ts"; +import "./test84.ts"; +import "./test85.ts"; +import "./test86.ts"; +import "./test87.ts"; +import "./test88.ts"; +import "./test89.ts"; +import "./test90.ts"; \ No newline at end of file diff --git a/src/test/getHandlerPr.ts b/test/getHandlerPr.ts similarity index 71% rename from src/test/getHandlerPr.ts rename to test/getHandlerPr.ts index 9cce9f20..72b7d1cc 100644 --- a/src/test/getHandlerPr.ts +++ b/test/getHandlerPr.ts @@ -1,7 +1,7 @@ -import { NonPostableEvt } from "../lib"; -import { arrDiff } from "../tools/reducers/diff"; -import { assert } from "../tools/typeSafety"; +import { NonPostableEvt } from "../lib/index.ts"; +import { arrDiff } from "../tools/reducers/diff.ts"; +import { assert } from "../tools/typeSafety/index.ts"; /** For tests that used the legacy attach returned Promise */ export function getHandlerPr(evt: NonPostableEvt, run: ()=> void): Promise{ diff --git a/src/test/index.ts b/test/index.ts similarity index 72% rename from src/test/index.ts rename to test/index.ts index 43b40569..4ac80309 100644 --- a/src/test/index.ts +++ b/test/index.ts @@ -1,3 +1,10 @@ +const __dirname = (()=>{ + const {url: urlStr}= import.meta; + const url= new URL(urlStr); + const __filename = url.protocol === "file:" ? url.pathname : urlStr; + return __filename.replace(/[/][^/]*$/, ''); +})(); + process.once("unhandledRejection", error => { @@ -10,8 +17,8 @@ console.assert = (condition: any, msg?: string) => { } }; -import { existsSync } from "fs"; -import { join } from "path"; +import { existsSync } from "https://deno.land/std/node/fs.ts"; +import { join } from "https://deno.land/std/node/path.ts"; (async ()=>{ diff --git a/src/test/test1.ts b/test/test1.ts similarity index 87% rename from src/test/test1.ts rename to test/test1.ts index 356a42d2..f20914c2 100644 --- a/src/test/test1.ts +++ b/test/test1.ts @@ -1,4 +1,4 @@ -import { Evt } from "../lib/index"; +import { Evt } from "../lib/index.ts"; let evt = new Evt(); diff --git a/src/test/test10.ts b/test/test10.ts similarity index 90% rename from src/test/test10.ts rename to test/test10.ts index 63fdc8d1..249653e5 100644 --- a/src/test/test10.ts +++ b/test/test10.ts @@ -1,4 +1,4 @@ -import { Evt } from "../lib/index"; +import { Evt } from "../lib/index.ts"; let evt = Evt.create(); diff --git a/src/test/test11.ts b/test/test11.ts similarity index 92% rename from src/test/test11.ts rename to test/test11.ts index 6d0de289..ece2c389 100644 --- a/src/test/test11.ts +++ b/test/test11.ts @@ -1,4 +1,4 @@ -import { Evt } from "../lib"; +import { Evt } from "../lib/index.ts"; let evt = Evt.create(); diff --git a/src/test/test12.ts b/test/test12.ts similarity index 88% rename from src/test/test12.ts rename to test/test12.ts index dd418e38..5916143d 100644 --- a/src/test/test12.ts +++ b/test/test12.ts @@ -1,4 +1,4 @@ -import { Evt } from "../lib"; +import { Evt } from "../lib/index.ts"; let evt = Evt.create(); diff --git a/src/test/test13.ts b/test/test13.ts similarity index 94% rename from src/test/test13.ts rename to test/test13.ts index 1122eac1..bad71299 100644 --- a/src/test/test13.ts +++ b/test/test13.ts @@ -1,6 +1,6 @@ import { Evt, EvtError -} from "../lib/index"; +} from "../lib/index.ts"; let pass= false; diff --git a/src/test/test14.ts b/test/test14.ts similarity index 92% rename from src/test/test14.ts rename to test/test14.ts index 448bb0e4..93302f14 100644 --- a/src/test/test14.ts +++ b/test/test14.ts @@ -1,5 +1,5 @@ -import { Evt } from "../lib"; +import { Evt } from "../lib/index.ts"; let success= false; diff --git a/src/test/test15.ts b/test/test15.ts similarity index 98% rename from src/test/test15.ts rename to test/test15.ts index b701d6fd..0aad5a60 100644 --- a/src/test/test15.ts +++ b/test/test15.ts @@ -1,6 +1,6 @@ import { Evt -} from "../lib/index"; +} from "../lib/index.ts"; let evt = new Evt(); diff --git a/src/test/test16.ts b/test/test16.ts similarity index 97% rename from src/test/test16.ts rename to test/test16.ts index 33c706b4..0f6919c3 100644 --- a/src/test/test16.ts +++ b/test/test16.ts @@ -1,6 +1,6 @@ import { Evt -} from "../lib/index"; +} from "../lib/index.ts"; interface Animal { type: "CAT" | "SPIDER"; diff --git a/src/test/test17.ts b/test/test17.ts similarity index 96% rename from src/test/test17.ts rename to test/test17.ts index ca75d27e..1d78c52a 100644 --- a/src/test/test17.ts +++ b/test/test17.ts @@ -1,4 +1,4 @@ -import { Evt } from "../lib/index"; +import { Evt } from "../lib/index.ts"; interface Animal { type: "CAT" | "SPIDER"; diff --git a/src/test/test18.ts b/test/test18.ts similarity index 92% rename from src/test/test18.ts rename to test/test18.ts index 027dde41..439fbbb4 100644 --- a/src/test/test18.ts +++ b/test/test18.ts @@ -1,4 +1,4 @@ -import { Evt } from "../lib"; +import { Evt } from "../lib/index.ts"; let count= 0; diff --git a/src/test/test19.ts b/test/test19.ts similarity index 87% rename from src/test/test19.ts rename to test/test19.ts index 2b6f0ad3..c8571f97 100644 --- a/src/test/test19.ts +++ b/test/test19.ts @@ -1,4 +1,4 @@ -import { Evt } from "../lib"; +import { Evt } from "../lib/index.ts"; let evt = new Evt<{ init: boolean}>(); diff --git a/src/test/test2.ts b/test/test2.ts similarity index 94% rename from src/test/test2.ts rename to test/test2.ts index fc7fe7fc..cd985de0 100644 --- a/src/test/test2.ts +++ b/test/test2.ts @@ -1,4 +1,4 @@ -import { Evt, Ctx } from "../lib/index"; +import { Evt, Ctx } from "../lib/index.ts"; type T = string; diff --git a/src/test/test20.ts b/test/test20.ts similarity index 84% rename from src/test/test20.ts rename to test/test20.ts index 3b467dee..d209fd54 100644 --- a/src/test/test20.ts +++ b/test/test20.ts @@ -1,4 +1,4 @@ -import { Evt, EvtError } from "../lib"; +import { Evt, EvtError } from "../lib/index.ts"; let evt= new Evt(); diff --git a/src/test/test21.ts b/test/test21.ts similarity index 86% rename from src/test/test21.ts rename to test/test21.ts index 65c1d9f5..2d8b697d 100644 --- a/src/test/test21.ts +++ b/test/test21.ts @@ -1,4 +1,4 @@ -import { Evt } from "../lib"; +import { Evt } from "../lib/index.ts"; let evt= new Evt(); diff --git a/src/test/test22.ts b/test/test22.ts similarity index 93% rename from src/test/test22.ts rename to test/test22.ts index 6907a15f..6a5c3ab2 100644 --- a/src/test/test22.ts +++ b/test/test22.ts @@ -1,7 +1,7 @@ -import { Evt } from "../lib"; -import { getPromiseAssertionApi } from "../tools/testing"; -import {getHandlerPr } from "./getHandlerPr"; +import { Evt } from "../lib/index.ts"; +import { getPromiseAssertionApi } from "../tools/testing/index.ts"; +import {getHandlerPr } from "./getHandlerPr.ts"; const { mustResolve, mustReject } = getPromiseAssertionApi(); let op = (object: Object): object is Array => object instanceof Array; diff --git a/src/test/test23.ts b/test/test23.ts similarity index 80% rename from src/test/test23.ts rename to test/test23.ts index 9673e1c9..54dea691 100644 --- a/src/test/test23.ts +++ b/test/test23.ts @@ -1,5 +1,5 @@ -import { Evt } from "../lib"; -import { EventEmitter } from "events"; +import { Evt } from "../lib/index.ts"; +import { EventEmitter } from "https://deno.land/std/node/events.ts"; let success = 0; diff --git a/src/test/test24.ts b/test/test24.ts similarity index 83% rename from src/test/test24.ts rename to test/test24.ts index 46156e45..cb10084e 100644 --- a/src/test/test24.ts +++ b/test/test24.ts @@ -1,4 +1,4 @@ -import { Evt } from "../lib"; +import { Evt } from "../lib/index.ts"; let evt= new Evt(); diff --git a/src/test/test25.ts b/test/test25.ts similarity index 86% rename from src/test/test25.ts rename to test/test25.ts index 1dd50463..70f654d7 100644 --- a/src/test/test25.ts +++ b/test/test25.ts @@ -1,4 +1,4 @@ -import { Evt, EvtError } from "../lib"; +import { Evt, EvtError } from "../lib/index.ts"; let evt = new Evt(); diff --git a/src/test/test26.ts b/test/test26.ts similarity index 78% rename from src/test/test26.ts rename to test/test26.ts index d182599c..9c72a87e 100644 --- a/src/test/test26.ts +++ b/test/test26.ts @@ -1,7 +1,7 @@ -import { Evt } from "../lib"; -import { UnpackEvt, ToNonPostableEvt } from "../lib/types/helper"; -type UnpackEvt_ = import("../lib/types/helper").UnpackEvt; +import { Evt } from "../lib/index.ts"; +import { UnpackEvt, ToNonPostableEvt } from "../lib/types/helper/index.ts"; +type UnpackEvt_ = import("../lib/types/helper/index.ts").UnpackEvt; { diff --git a/src/test/test27.ts b/test/test27.ts similarity index 82% rename from src/test/test27.ts rename to test/test27.ts index cd3dede3..fcf817d2 100644 --- a/src/test/test27.ts +++ b/test/test27.ts @@ -1,5 +1,5 @@ -import { Evt } from "../lib"; +import { Evt } from "../lib/index.ts"; let evt = new Evt(); diff --git a/src/test/test28.ts b/test/test28.ts similarity index 86% rename from src/test/test28.ts rename to test/test28.ts index aa8377b2..6ea1757c 100644 --- a/src/test/test28.ts +++ b/test/test28.ts @@ -1,5 +1,5 @@ -import { Evt } from "../lib"; +import { Evt } from "../lib/index.ts"; let evt = new Evt(); diff --git a/src/test/test29.ts b/test/test29.ts similarity index 87% rename from src/test/test29.ts rename to test/test29.ts index d10c237e..940dc57f 100644 --- a/src/test/test29.ts +++ b/test/test29.ts @@ -1,5 +1,5 @@ -import { Evt } from "../lib"; +import { Evt } from "../lib/index.ts"; let evt = new Evt(); diff --git a/src/test/test3.ts b/test/test3.ts similarity index 90% rename from src/test/test3.ts rename to test/test3.ts index f43a102e..bc9c976d 100644 --- a/src/test/test3.ts +++ b/test/test3.ts @@ -1,4 +1,4 @@ -import { Evt } from "../lib/index"; +import { Evt } from "../lib/index.ts"; type T= string; diff --git a/src/test/test30.ts b/test/test30.ts similarity index 91% rename from src/test/test30.ts rename to test/test30.ts index 894c837e..775d7be7 100644 --- a/src/test/test30.ts +++ b/test/test30.ts @@ -1,5 +1,5 @@ -import { Evt } from "../lib"; +import { Evt } from "../lib/index.ts"; let evt = new Evt(); diff --git a/src/test/test31.ts b/test/test31.ts similarity index 86% rename from src/test/test31.ts rename to test/test31.ts index f26725e4..423e7de7 100644 --- a/src/test/test31.ts +++ b/test/test31.ts @@ -1,5 +1,5 @@ -import { Evt } from "../lib"; +import { Evt } from "../lib/index.ts"; const evtText = new Evt(); diff --git a/src/test/test32.ts b/test/test32.ts similarity index 100% rename from src/test/test32.ts rename to test/test32.ts diff --git a/src/test/test33.ts b/test/test33.ts similarity index 94% rename from src/test/test33.ts rename to test/test33.ts index ff9bde02..bc53126f 100644 --- a/src/test/test33.ts +++ b/test/test33.ts @@ -1,6 +1,6 @@ -import { Evt } from "../lib"; -import { assert } from "../tools/typeSafety"; +import { Evt } from "../lib/index.ts"; +import { assert } from "../tools/typeSafety/index.ts"; type Circle = { type: "CIRCLE"; diff --git a/src/test/test34.ts b/test/test34.ts similarity index 80% rename from src/test/test34.ts rename to test/test34.ts index f5d51ceb..401960d9 100644 --- a/src/test/test34.ts +++ b/test/test34.ts @@ -1,7 +1,7 @@ -import { exclude } from "../tools/typeSafety/exclude"; -import { same } from "../tools/inDepth"; -import { assert } from "../tools/typeSafety/assert" +import { exclude } from "../tools/typeSafety/exclude.ts"; +import { same } from "../tools/inDepth/index.ts"; +import { assert } from "../tools/typeSafety/assert.ts" { diff --git a/src/test/test35.ts b/test/test35.ts similarity index 97% rename from src/test/test35.ts rename to test/test35.ts index 8c419690..f5d3d099 100644 --- a/src/test/test35.ts +++ b/test/test35.ts @@ -1,6 +1,6 @@ -import { Evt } from "../lib"; -import { id, assert } from "../tools/typeSafety"; +import { Evt } from "../lib/index.ts"; +import { id, assert } from "../tools/typeSafety/index.ts"; type Circle = { type: "CIRCLE"; diff --git a/src/test/test36.ts b/test/test36.ts similarity index 83% rename from src/test/test36.ts rename to test/test36.ts index df9717ab..0b078269 100644 --- a/src/test/test36.ts +++ b/test/test36.ts @@ -1,5 +1,5 @@ -import { Evt } from "../lib"; +import { Evt } from "../lib/index.ts"; const evt= Evt.create(); diff --git a/src/test/test37.ts b/test/test37.ts similarity index 97% rename from src/test/test37.ts rename to test/test37.ts index 5752196c..516bf450 100644 --- a/src/test/test37.ts +++ b/test/test37.ts @@ -1,8 +1,8 @@ -import { Evt } from "../lib"; -//import { Evt as EvtNext } from "../lib/Evt"; -import { id } from "../tools/typeSafety"; -import { getPromiseAssertionApi } from "../tools/testing"; -import { getHandlerPr } from "./getHandlerPr"; +import { Evt } from "../lib/index.ts"; +//import { Evt as EvtNext } from "../lib/Evt.ts"; +import { id } from "../tools/typeSafety/index.ts"; +import { getPromiseAssertionApi } from "../tools/testing/index.ts"; +import { getHandlerPr } from "./getHandlerPr.ts"; const { mustResolve, mustStayPending } = getPromiseAssertionApi(); diff --git a/src/test/test38.ts b/test/test38.ts similarity index 97% rename from src/test/test38.ts rename to test/test38.ts index 5484b151..0baa95fa 100644 --- a/src/test/test38.ts +++ b/test/test38.ts @@ -1,7 +1,7 @@ //NOTE: This test do not perform any actual check at runtime. -import { Evt } from "../lib"; -import { getHandlerPr } from "./getHandlerPr"; +import { Evt } from "../lib/index.ts"; +import { getHandlerPr } from "./getHandlerPr.ts"; type Circle = { type: "CIRCLE"; diff --git a/src/test/test39.ts b/test/test39.ts similarity index 97% rename from src/test/test39.ts rename to test/test39.ts index 9510615a..fb4b6e36 100644 --- a/src/test/test39.ts +++ b/test/test39.ts @@ -1,6 +1,6 @@ -import { Evt, ToNonPostableEvt } from "../lib"; -import { id, assert } from "../tools/typeSafety"; +import { Evt, ToNonPostableEvt } from "../lib/index.ts"; +import { id, assert } from "../tools/typeSafety/index.ts"; type Person = { name: string; diff --git a/src/test/test4.ts b/test/test4.ts similarity index 88% rename from src/test/test4.ts rename to test/test4.ts index f13be434..5b6f53fe 100644 --- a/src/test/test4.ts +++ b/test/test4.ts @@ -1,4 +1,4 @@ -import { Evt } from "../lib/index"; +import { Evt } from "../lib/index.ts"; type T= string; diff --git a/src/test/test44.ts b/test/test44.ts similarity index 88% rename from src/test/test44.ts rename to test/test44.ts index cbd4939d..ab818a09 100644 --- a/src/test/test44.ts +++ b/test/test44.ts @@ -1,4 +1,4 @@ -import { Evt } from "../lib"; +import { Evt } from "../lib/index.ts"; const evtText = new Evt<"TICK" | "END" >(); diff --git a/src/test/test49.ts b/test/test49.ts similarity index 87% rename from src/test/test49.ts rename to test/test49.ts index 47fe70d3..0ec36497 100644 --- a/src/test/test49.ts +++ b/test/test49.ts @@ -1,9 +1,9 @@ -import { Evt, Handler, Ctx } from "../lib"; -import { assert } from "../tools/typeSafety"; -import { getPromiseAssertionApi } from "../tools/testing"; -import { sameFactory } from "../tools/inDepth"; -import { getHandlerPr } from "./getHandlerPr"; +import { Evt, Handler, Ctx } from "../lib/index.ts"; +import { assert } from "../tools/typeSafety/index.ts"; +import { getPromiseAssertionApi } from "../tools/testing/index.ts"; +import { sameFactory } from "../tools/inDepth/index.ts"; +import { getHandlerPr } from "./getHandlerPr.ts"; const { same } = sameFactory({ "takeIntoAccountArraysOrdering": false }); diff --git a/src/test/test5.ts b/test/test5.ts similarity index 90% rename from src/test/test5.ts rename to test/test5.ts index 0148b0cc..9bc89052 100644 --- a/src/test/test5.ts +++ b/test/test5.ts @@ -1,4 +1,4 @@ -import { Evt } from "../lib/index"; +import { Evt } from "../lib/index.ts"; let evt = new Evt(); diff --git a/src/test/test50.ts b/test/test50.ts similarity index 71% rename from src/test/test50.ts rename to test/test50.ts index 758272a4..934b9174 100644 --- a/src/test/test50.ts +++ b/test/test50.ts @@ -1,6 +1,6 @@ -import { Evt } from "../lib"; -import { assert } from "../tools/typeSafety"; +import { Evt } from "../lib/index.ts"; +import { assert } from "../tools/typeSafety/index.ts"; const evtAge = new Evt(); diff --git a/src/test/test51.ts b/test/test51.ts similarity index 93% rename from src/test/test51.ts rename to test/test51.ts index b81ed7e8..e8b723f9 100644 --- a/src/test/test51.ts +++ b/test/test51.ts @@ -1,9 +1,9 @@ -import { Evt } from "../lib"; -import { assert } from "../tools/typeSafety/assert"; -import { scan } from "../lib/util/genericOperators/scan"; -import { getHandlerPr } from "./getHandlerPr"; -import { getPromiseAssertionApi } from "../tools/testing/getPromiseAssertionApi"; +import { Evt } from "../lib/index.ts"; +import { assert } from "../tools/typeSafety/assert.ts"; +import { scan } from "../lib/util/genericOperators/scan.ts"; +import { getHandlerPr } from "./getHandlerPr.ts"; +import { getPromiseAssertionApi } from "../tools/testing/getPromiseAssertionApi.ts"; const { mustResolve, mustStayPending } = getPromiseAssertionApi({ "takeIntoAccountArraysOrdering": true }); diff --git a/src/test/test52.ts b/test/test52.ts similarity index 82% rename from src/test/test52.ts rename to test/test52.ts index 03832784..02d94773 100644 --- a/src/test/test52.ts +++ b/test/test52.ts @@ -1,6 +1,6 @@ -import { Evt, throttleTime } from "../lib"; -import { assert } from "../tools/typeSafety"; +import { Evt, throttleTime } from "../lib/index.ts"; +import { assert } from "../tools/typeSafety/index.ts"; const evtCount = new Evt(); diff --git a/src/test/test53.ts b/test/test53.ts similarity index 67% rename from src/test/test53.ts rename to test/test53.ts index b094d363..7edf4e04 100644 --- a/src/test/test53.ts +++ b/test/test53.ts @@ -1,8 +1,8 @@ -import { Evt, Handler } from "../lib"; -import { assert } from "../tools/typeSafety"; -import { getHandlerPr } from "./getHandlerPr"; -import { getPromiseAssertionApi } from "../tools/testing"; +import { Evt, Handler } from "../lib/index.ts"; +import { assert } from "../tools/typeSafety/index.ts"; +import { getHandlerPr } from "./getHandlerPr.ts"; +import { getPromiseAssertionApi } from "../tools/testing/index.ts"; const { mustResolve } = getPromiseAssertionApi(); diff --git a/src/test/test54.ts b/test/test54.ts similarity index 74% rename from src/test/test54.ts rename to test/test54.ts index 36ba2fc9..1f7c0ce2 100644 --- a/src/test/test54.ts +++ b/test/test54.ts @@ -1,5 +1,5 @@ -import { Evt } from "../lib"; -import { assert } from "../tools/typeSafety"; +import { Evt } from "../lib/index.ts"; +import { assert } from "../tools/typeSafety/index.ts"; const evtText = new Evt(); diff --git a/src/test/test55.ts b/test/test55.ts similarity index 95% rename from src/test/test55.ts rename to test/test55.ts index 25fce380..56274fca 100644 --- a/src/test/test55.ts +++ b/test/test55.ts @@ -1,7 +1,7 @@ -import { Evt } from "../lib"; -import { assert } from "../tools/typeSafety"; -import { getPromiseAssertionApi } from "../tools/testing/getPromiseAssertionApi"; +import { Evt } from "../lib/index.ts"; +import { assert } from "../tools/typeSafety/index.ts"; +import { getPromiseAssertionApi } from "../tools/testing/getPromiseAssertionApi.ts"; (async () => { diff --git a/src/test/test56.ts b/test/test56.ts similarity index 83% rename from src/test/test56.ts rename to test/test56.ts index 10a7ec71..a00b1b90 100644 --- a/src/test/test56.ts +++ b/test/test56.ts @@ -1,8 +1,8 @@ -import { Evt } from "../lib"; -import { EventEmitter } from "events"; -import { getPromiseAssertionApi } from "../tools/testing"; -import { assert } from "../tools/typeSafety"; +import { Evt } from "../lib/index.ts"; +import { EventEmitter } from "https://deno.land/std/node/events.ts"; +import { getPromiseAssertionApi } from "../tools/testing/index.ts"; +import { assert } from "../tools/typeSafety/index.ts"; (async () => { diff --git a/src/test/test57.ts b/test/test57.ts similarity index 82% rename from src/test/test57.ts rename to test/test57.ts index fdadfe0f..4c5e56c4 100644 --- a/src/test/test57.ts +++ b/test/test57.ts @@ -1,7 +1,7 @@ -import { Evt } from "../lib"; -import { Subject } from "rxjs"; -import { getPromiseAssertionApi } from "../tools/testing"; -import { assert } from "../tools/typeSafety"; +import { Evt } from "../lib/index.ts"; +import { Subject } from "rxjs DENOIFY: DEPENDENCY UNMET (DEV DEPENDENCY)"; +import { getPromiseAssertionApi } from "../tools/testing/index.ts"; +import { assert } from "../tools/typeSafety/index.ts"; (async () => { diff --git a/src/test/test59.ts b/test/test59.ts similarity index 92% rename from src/test/test59.ts rename to test/test59.ts index cd1517a5..de169dc5 100644 --- a/src/test/test59.ts +++ b/test/test59.ts @@ -1,6 +1,6 @@ -import { Evt, to, dom } from "../lib"; -import { assert } from "../tools/typeSafety"; +import { Evt, to, dom } from "../lib/index.ts"; +import { assert } from "../tools/typeSafety/index.ts"; const evt = new Evt< ["text", string] | diff --git a/src/test/test6.ts b/test/test6.ts similarity index 92% rename from src/test/test6.ts rename to test/test6.ts index 1c066d1a..6ca591bb 100644 --- a/src/test/test6.ts +++ b/test/test6.ts @@ -1,4 +1,4 @@ -import { Evt } from "../lib/index"; +import { Evt } from "../lib/index.ts"; let evt = new Evt(); diff --git a/src/test/test60.ts b/test/test60.ts similarity index 78% rename from src/test/test60.ts rename to test/test60.ts index d4d74850..82ff6394 100644 --- a/src/test/test60.ts +++ b/test/test60.ts @@ -1,6 +1,6 @@ -import { Evt } from "../lib"; -import { assert } from "../tools/typeSafety"; +import { Evt } from "../lib/index.ts"; +import { assert } from "../tools/typeSafety/index.ts"; const obj1: never[] = [] as any; const obj2 = {}; diff --git a/src/test/test61.ts b/test/test61.ts similarity index 82% rename from src/test/test61.ts rename to test/test61.ts index 0d67163a..240e8219 100644 --- a/src/test/test61.ts +++ b/test/test61.ts @@ -1,7 +1,7 @@ -import { Evt } from "../lib"; -import { getHandlerPr } from "./getHandlerPr"; -import { getPromiseAssertionApi } from "../tools/testing/getPromiseAssertionApi"; -import { assert } from "../tools/typeSafety"; +import { Evt } from "../lib/index.ts"; +import { getHandlerPr } from "./getHandlerPr.ts"; +import { getPromiseAssertionApi } from "../tools/testing/getPromiseAssertionApi.ts"; +import { assert } from "../tools/typeSafety/index.ts"; const { mustResolve, mustReject } = getPromiseAssertionApi(); diff --git a/src/test/test62.ts b/test/test62.ts similarity index 94% rename from src/test/test62.ts rename to test/test62.ts index 683e7713..72c43795 100644 --- a/src/test/test62.ts +++ b/test/test62.ts @@ -1,14 +1,14 @@ -import { Evt, VoidEvt, EvtError } from "../lib"; -import { id, assert } from "../tools/typeSafety"; -import { every } from "../tools/reducers"; -import { getPromiseAssertionApi } from "../tools/testing/getPromiseAssertionApi"; -import { concatUint8Array } from "../tools/concatUint8Array"; +import { Evt, VoidEvt, EvtError } from "../lib/index.ts"; +import { id, assert } from "../tools/typeSafety/index.ts"; +import { every } from "../tools/reducers/index.ts"; +import { getPromiseAssertionApi } from "../tools/testing/getPromiseAssertionApi.ts"; +import { concatUint8Array } from "../tools/concatUint8Array.ts"; //const { mustReject, mustResolve } = getPromiseAssertionApi(); const { mustResolve, mustReject } = getPromiseAssertionApi({ "takeIntoAccountArraysOrdering": true }); -//import { Operator } from "../lib/types/Operator"; +//import { Operator } from "../lib/types/Operator.ts"; const MESSAGE_TOO_MUCH_BYTES = "Received to much data"; const MESSAGE_CANCEL = "Download canceled by user"; diff --git a/src/test/test63.ts b/test/test63.ts similarity index 94% rename from src/test/test63.ts rename to test/test63.ts index b1677fc6..394fb230 100644 --- a/src/test/test63.ts +++ b/test/test63.ts @@ -1,6 +1,6 @@ -import { Evt } from "../lib"; -import { EventEmitter } from "events"; -import { assert } from "../tools/typeSafety/assert"; +import { Evt } from "../lib/index.ts"; +import { EventEmitter } from "https://deno.land/std/node/events.ts"; +import { assert } from "../tools/typeSafety/assert.ts"; const log = global.console.log; diff --git a/src/test/test64.ts b/test/test64.ts similarity index 74% rename from src/test/test64.ts rename to test/test64.ts index 005200b5..c030e07b 100644 --- a/src/test/test64.ts +++ b/test/test64.ts @@ -1,9 +1,9 @@ -import { Evt } from "../lib"; +import { Evt } from "../lib/index.ts"; -import { chunksOf } from "../lib/util/genericOperators/chunksOf"; -import { same } from "../tools/inDepth"; -import { assert } from "../tools/typeSafety" +import { chunksOf } from "../lib/util/genericOperators/chunksOf.ts"; +import { same } from "../tools/inDepth/index.ts"; +import { assert } from "../tools/typeSafety/index.ts" { diff --git a/src/test/test65.ts b/test/test65.ts similarity index 93% rename from src/test/test65.ts rename to test/test65.ts index 3d243d14..d054a90f 100644 --- a/src/test/test65.ts +++ b/test/test65.ts @@ -1,6 +1,6 @@ -import { Evt, throttleTime } from "../lib"; -import * as dom from "../lib/types/lib.dom"; +import { Evt, throttleTime } from "../lib/index.ts"; +import * as dom from "../lib/types/lib.dom.ts"; declare const document: dom.Document; diff --git a/src/test/test66.ts b/test/test66.ts similarity index 84% rename from src/test/test66.ts rename to test/test66.ts index d77581f6..53617c5d 100644 --- a/src/test/test66.ts +++ b/test/test66.ts @@ -1,8 +1,8 @@ -import { Evt } from "../lib"; -import { getHandlerPr } from "./getHandlerPr"; -import { getPromiseAssertionApi } from "../tools/testing/getPromiseAssertionApi"; +import { Evt } from "../lib/index.ts"; +import { getHandlerPr } from "./getHandlerPr.ts"; +import { getPromiseAssertionApi } from "../tools/testing/getPromiseAssertionApi.ts"; const { mustStayPending } = getPromiseAssertionApi(); diff --git a/src/test/test67.ts b/test/test67.ts similarity index 93% rename from src/test/test67.ts rename to test/test67.ts index 79facc2d..12e358ea 100644 --- a/src/test/test67.ts +++ b/test/test67.ts @@ -1,7 +1,7 @@ -import { Evt, compose } from "../lib"; -import { assert } from "../tools/typeSafety"; -import { getPromiseAssertionApi } from "../tools/testing/getPromiseAssertionApi"; -import { getHandlerPr } from "./getHandlerPr"; +import { Evt, compose } from "../lib/index.ts"; +import { assert } from "../tools/typeSafety/index.ts"; +import { getPromiseAssertionApi } from "../tools/testing/getPromiseAssertionApi.ts"; +import { getHandlerPr } from "./getHandlerPr.ts"; const { mustResolve, mustStayPending } = getPromiseAssertionApi(); diff --git a/src/test/test68.ts b/test/test68.ts similarity index 94% rename from src/test/test68.ts rename to test/test68.ts index acbd3191..e4b31e07 100644 --- a/src/test/test68.ts +++ b/test/test68.ts @@ -1,5 +1,5 @@ -import { Evt } from "../lib"; -import { assert } from "../tools/typeSafety/assert"; +import { Evt } from "../lib/index.ts"; +import { assert } from "../tools/typeSafety/assert.ts"; let warn_str = ""; diff --git a/src/test/test69.ts b/test/test69.ts similarity index 80% rename from src/test/test69.ts rename to test/test69.ts index ddd00474..979ad883 100644 --- a/src/test/test69.ts +++ b/test/test69.ts @@ -1,5 +1,5 @@ //NOTE: Only test type -import { Evt } from "../lib"; +import { Evt } from "../lib/index.ts"; const ctx= Evt.newCtx(); diff --git a/src/test/test7.ts b/test/test7.ts similarity index 88% rename from src/test/test7.ts rename to test/test7.ts index b0d0ab41..fabaddac 100644 --- a/src/test/test7.ts +++ b/test/test7.ts @@ -1,4 +1,4 @@ -import { Evt } from "../lib/index"; +import { Evt } from "../lib/index.ts"; let evt = new Evt(); diff --git a/src/test/test70.ts b/test/test70.ts similarity index 98% rename from src/test/test70.ts rename to test/test70.ts index 31674b37..eeb4c298 100644 --- a/src/test/test70.ts +++ b/test/test70.ts @@ -1,4 +1,4 @@ -import { Evt, VoidEvt, UnpackCtx, UnpackEvt, Ctx, VoidCtx } from "../lib"; +import { Evt, VoidEvt, UnpackCtx, UnpackEvt, Ctx, VoidCtx } from "../lib/index.ts"; const evtText= new Evt(); diff --git a/src/test/test71.ts b/test/test71.ts similarity index 82% rename from src/test/test71.ts rename to test/test71.ts index c0d475f3..fa055ee8 100644 --- a/src/test/test71.ts +++ b/test/test71.ts @@ -1,7 +1,7 @@ -import { Evt } from "../lib"; -import { getPromiseAssertionApi } from "../tools/testing/getPromiseAssertionApi"; -import { getHandlerPr } from "./getHandlerPr"; +import { Evt } from "../lib/index.ts"; +import { getPromiseAssertionApi } from "../tools/testing/getPromiseAssertionApi.ts"; +import { getHandlerPr } from "./getHandlerPr.ts"; const { mustResolve } = getPromiseAssertionApi(); diff --git a/src/test/test72.ts b/test/test72.ts similarity index 91% rename from src/test/test72.ts rename to test/test72.ts index ed0eb78f..88097b0f 100644 --- a/src/test/test72.ts +++ b/test/test72.ts @@ -1,9 +1,9 @@ -import { Evt, UnpackEvt } from "../lib"; -import { UnpackPromise } from "../tools/typeSafety"; +import { Evt, UnpackEvt } from "../lib/index.ts"; +import { UnpackPromise } from "../tools/typeSafety/index.ts"; -import { assert } from "../tools/typeSafety/assert"; -import { same } from "../tools/inDepth"; +import { assert } from "../tools/typeSafety/assert.ts"; +import { same } from "../tools/inDepth/index.ts"; { diff --git a/src/test/test73.ts b/test/test73.ts similarity index 97% rename from src/test/test73.ts rename to test/test73.ts index 4887e844..23caaf96 100644 --- a/src/test/test73.ts +++ b/test/test73.ts @@ -1,6 +1,6 @@ -import { Evt } from "../lib"; -import { assert } from "../tools/typeSafety/assert"; +import { Evt } from "../lib/index.ts"; +import { assert } from "../tools/typeSafety/assert.ts"; { diff --git a/src/test/test76.ts b/test/test76.ts similarity index 90% rename from src/test/test76.ts rename to test/test76.ts index 6eb1457d..055dc9ea 100644 --- a/src/test/test76.ts +++ b/test/test76.ts @@ -1,8 +1,8 @@ -import { Evt } from "../lib"; -import * as inDepth from "../tools/inDepth"; -import { diff } from "../tools/reducers"; -import { assert } from "../tools/typeSafety"; +import { Evt } from "../lib/index.ts"; +import * as inDepth from "../tools/inDepth/index.ts"; +import { diff } from "../tools/reducers/index.ts"; +import { assert } from "../tools/typeSafety/index.ts"; { diff --git a/src/test/test78.ts b/test/test78.ts similarity index 95% rename from src/test/test78.ts rename to test/test78.ts index c6ef5286..84ef9faa 100644 --- a/src/test/test78.ts +++ b/test/test78.ts @@ -1,6 +1,6 @@ -import { Evt } from "../lib"; -import { getPromiseAssertionApi } from "../tools/testing/getPromiseAssertionApi"; +import { Evt } from "../lib/index.ts"; +import { getPromiseAssertionApi } from "../tools/testing/getPromiseAssertionApi.ts"; const { mustResolve, mustStayPending } = getPromiseAssertionApi(); diff --git a/src/test/test79.ts b/test/test79.ts similarity index 78% rename from src/test/test79.ts rename to test/test79.ts index c70912ab..d3ae918a 100644 --- a/src/test/test79.ts +++ b/test/test79.ts @@ -1,5 +1,5 @@ -import { Evt, StatefulReadonlyEvt } from "../lib"; -import { assert } from "../tools/typeSafety"; +import { Evt, StatefulReadonlyEvt } from "../lib/index.ts"; +import { assert } from "../tools/typeSafety/index.ts"; const evtCount = Evt.create(0); diff --git a/src/test/test8.ts b/test/test8.ts similarity index 97% rename from src/test/test8.ts rename to test/test8.ts index dcce400e..ab4cb9cd 100644 --- a/src/test/test8.ts +++ b/test/test8.ts @@ -1,4 +1,4 @@ -import { Evt } from "../lib/index"; +import { Evt } from "../lib/index.ts"; export interface Person { name: string; diff --git a/src/test/test80.ts b/test/test80.ts similarity index 72% rename from src/test/test80.ts rename to test/test80.ts index d8896a8c..ec88237b 100644 --- a/src/test/test80.ts +++ b/test/test80.ts @@ -1,6 +1,6 @@ -import { Evt } from "../lib"; -import { assert } from "../tools/typeSafety/assert"; +import { Evt } from "../lib/index.ts"; +import { assert } from "../tools/typeSafety/assert.ts"; const evtClick = Evt.create(); diff --git a/src/test/test81.ts b/test/test81.ts similarity index 96% rename from src/test/test81.ts rename to test/test81.ts index 53f0502b..92b6407e 100644 --- a/src/test/test81.ts +++ b/test/test81.ts @@ -1,5 +1,5 @@ //NOTE: Type only -import { Evt, StatefulEvt, ToPostableEvt, ToNonPostableEvt, VoidEvt, NonPostableEvt, StatefulReadonlyEvt } from "../lib"; +import { Evt, StatefulEvt, ToPostableEvt, ToNonPostableEvt, VoidEvt, NonPostableEvt, StatefulReadonlyEvt } from "../lib/index.ts"; { diff --git a/src/test/test82.ts b/test/test82.ts similarity index 96% rename from src/test/test82.ts rename to test/test82.ts index 66fd8f6c..a142092b 100644 --- a/src/test/test82.ts +++ b/test/test82.ts @@ -1,5 +1,5 @@ //NOTE: Test type only -import { Evt, StatefulEvt, StatefulReadonlyEvt, NonPostableEvt, SwapEvtType, VoidEvt } from "../lib"; +import { Evt, StatefulEvt, StatefulReadonlyEvt, NonPostableEvt, SwapEvtType, VoidEvt } from "../lib/index.ts"; type A = SwapEvtType, void>; const a: VoidEvt = null as any as A;a; diff --git a/src/test/test83.ts b/test/test83.ts similarity index 74% rename from src/test/test83.ts rename to test/test83.ts index 6ec8874a..1e0a0c84 100644 --- a/src/test/test83.ts +++ b/test/test83.ts @@ -1,6 +1,6 @@ -import { Evt, VoidEvt, matchVoid } from "../lib"; -import { assert } from "../tools/typeSafety"; +import { Evt, VoidEvt, matchVoid } from "../lib/index.ts"; +import { assert } from "../tools/typeSafety/index.ts"; const voidEvt = Evt.create(); diff --git a/src/test/test84.ts b/test/test84.ts similarity index 86% rename from src/test/test84.ts rename to test/test84.ts index cd84fc40..f2186349 100644 --- a/src/test/test84.ts +++ b/test/test84.ts @@ -1,6 +1,6 @@ //NOTE: type only -import { UnpackEvt, Evt } from "../lib"; +import { UnpackEvt, Evt } from "../lib/index.ts"; type A= UnpackEvt>; const a: number | void = null as any as A; a; diff --git a/test/test85.ts b/test/test85.ts new file mode 100644 index 00000000..5a8e17c7 --- /dev/null +++ b/test/test85.ts @@ -0,0 +1,7 @@ +import { Evt, Ctx } from "../lib/index.ts"; +import { assert } from "../tools/typeSafety/assert.ts"; + +assert(Evt.name === "Evt"); +assert(Ctx.name === "Ctx"); + +console.log("PASS"); \ No newline at end of file diff --git a/src/test/test86.ts b/test/test86.ts similarity index 86% rename from src/test/test86.ts rename to test/test86.ts index f4ea24c5..03270e1c 100644 --- a/src/test/test86.ts +++ b/test/test86.ts @@ -1,6 +1,6 @@ -import { Evt } from "../lib"; -import { assert } from "../tools/typeSafety/assert"; +import { Evt } from "../lib/index.ts"; +import { assert } from "../tools/typeSafety/assert.ts"; let std_out = ""; diff --git a/src/test/test87.ts b/test/test87.ts similarity index 83% rename from src/test/test87.ts rename to test/test87.ts index 36039d9f..cd0ad9b5 100644 --- a/src/test/test87.ts +++ b/test/test87.ts @@ -1,6 +1,6 @@ -import { Evt } from "../lib"; -import {assert} from "../tools/typeSafety"; +import { Evt } from "../lib/index.ts"; +import {assert} from "../tools/typeSafety/index.ts"; const evtIsBlue= Evt.create(false); const evtIsBig= Evt.create(false); diff --git a/src/test/test88.ts b/test/test88.ts similarity index 68% rename from src/test/test88.ts rename to test/test88.ts index 02ec4c92..0566c9c7 100644 --- a/src/test/test88.ts +++ b/test/test88.ts @@ -1,7 +1,7 @@ -import { Evt } from "../lib"; -import { assert } from "../tools/typeSafety"; +import { Evt } from "../lib/index.ts"; +import { assert } from "../tools/typeSafety/index.ts"; const evtText = Evt.create("foo"); diff --git a/src/test/test89.ts b/test/test89.ts similarity index 82% rename from src/test/test89.ts rename to test/test89.ts index a14a41da..992da05f 100644 --- a/src/test/test89.ts +++ b/test/test89.ts @@ -1,6 +1,6 @@ -import { Evt } from "../lib"; -import { assert } from "../tools/typeSafety"; +import { Evt } from "../lib/index.ts"; +import { assert } from "../tools/typeSafety/index.ts"; const evtText= Evt.create("foo"); diff --git a/src/test/test9.ts b/test/test9.ts similarity index 98% rename from src/test/test9.ts rename to test/test9.ts index f8ffcde3..4ac697fc 100644 --- a/src/test/test9.ts +++ b/test/test9.ts @@ -1,4 +1,4 @@ -import { Evt } from "../lib/index"; +import { Evt } from "../lib/index.ts"; export interface Person { name: string; diff --git a/src/test/test90.ts b/test/test90.ts similarity index 86% rename from src/test/test90.ts rename to test/test90.ts index a7f4a517..b6698aa9 100644 --- a/src/test/test90.ts +++ b/test/test90.ts @@ -1,6 +1,6 @@ -import { Evt } from "../lib"; -import { assert } from "../tools/typeSafety"; +import { Evt } from "../lib/index.ts"; +import { assert } from "../tools/typeSafety/index.ts"; const evtText = Evt.create("foo"); diff --git a/src/tools/Deferred.ts b/tools/Deferred.ts similarity index 98% rename from src/tools/Deferred.ts rename to tools/Deferred.ts index 3363c78d..714d4521 100644 --- a/src/tools/Deferred.ts +++ b/tools/Deferred.ts @@ -1,5 +1,5 @@ -import { overwriteReadonlyProp } from "./typeSafety/overwriteReadonlyProp"; +import { overwriteReadonlyProp } from "./typeSafety/overwriteReadonlyProp.ts"; export class Deferred { diff --git a/src/tools/concatUint8Array.ts b/tools/concatUint8Array.ts similarity index 100% rename from src/tools/concatUint8Array.ts rename to tools/concatUint8Array.ts diff --git a/src/tools/inDepth/copy.ts b/tools/inDepth/copy.ts similarity index 90% rename from src/tools/inDepth/copy.ts rename to tools/inDepth/copy.ts index 6a0d6770..a0a68b03 100644 --- a/src/tools/inDepth/copy.ts +++ b/tools/inDepth/copy.ts @@ -1,9 +1,9 @@ -import { assert } from "../typeSafety/assert"; -import { Polyfill as Map, LightMap } from "minimal-polyfills/Map"; -import { LightSet } from "minimal-polyfills/Set"; -import { MapLike, SetLike, ArrayLike, DateLike } from "./types"; -import { overwriteReadonlyProp } from "../typeSafety/overwriteReadonlyProp"; +import { assert } from "../typeSafety/assert.ts"; +import { Polyfill as Map, LightMap } from "https://raw.github.com/garronej/minimal_polyfills/2.0.1/Map.ts"; +import { LightSet } from "https://raw.github.com/garronej/minimal_polyfills/2.0.1/Set.ts"; +import { MapLike, SetLike, ArrayLike, DateLike } from "./types.ts"; +import { overwriteReadonlyProp } from "../typeSafety/overwriteReadonlyProp.ts"; /** Will work with: * Array diff --git a/src/tools/inDepth/getPrototypeChain.ts b/tools/inDepth/getPrototypeChain.ts similarity index 100% rename from src/tools/inDepth/getPrototypeChain.ts rename to tools/inDepth/getPrototypeChain.ts diff --git a/tools/inDepth/index.ts b/tools/inDepth/index.ts new file mode 100644 index 00000000..b59b755f --- /dev/null +++ b/tools/inDepth/index.ts @@ -0,0 +1,3 @@ + +export * from "./same.ts"; +export * from "./copy.ts"; \ No newline at end of file diff --git a/src/tools/inDepth/same.ts b/tools/inDepth/same.ts similarity index 95% rename from src/tools/inDepth/same.ts rename to tools/inDepth/same.ts index bde9b4b4..a071c9e3 100644 --- a/src/tools/inDepth/same.ts +++ b/tools/inDepth/same.ts @@ -1,7 +1,7 @@ -import { Polyfill as Set } from "minimal-polyfills/Set"; -import { MapLike, SetLike, DateLike, ArrayLike } from "./types"; -import { arrAllEquals } from "../reducers/allEquals"; -import "minimal-polyfills/Object.is"; +import { Polyfill as Set } from "https://raw.github.com/garronej/minimal_polyfills/2.0.1/Set.ts"; +import { MapLike, SetLike, DateLike, ArrayLike } from "./types.ts"; +import { arrAllEquals } from "../reducers/allEquals.ts"; +import "https://raw.github.com/garronej/minimal_polyfills/2.0.1/Object.is.ts"; /** * Function that perform a in depth comparison of two things of arbitrary type T diff --git a/src/tools/inDepth/test.ts b/tools/inDepth/test.ts similarity index 97% rename from src/tools/inDepth/test.ts rename to tools/inDepth/test.ts index f24b8108..7518125d 100644 --- a/src/tools/inDepth/test.ts +++ b/tools/inDepth/test.ts @@ -1,9 +1,9 @@ -import { sameFactory, same } from "./same"; -import { assert } from "../typeSafety/assert"; -import { copy } from "./copy"; -import * as util from "util"; +import { sameFactory, same } from "./same.ts"; +import { assert } from "../typeSafety/assert.ts"; +import { copy } from "./copy.ts"; +import * as util from "https://deno.land/std/node/util.ts"; { diff --git a/src/tools/inDepth/types.ts b/tools/inDepth/types.ts similarity index 92% rename from src/tools/inDepth/types.ts rename to tools/inDepth/types.ts index 4f75b464..b40d2aaf 100644 --- a/src/tools/inDepth/types.ts +++ b/tools/inDepth/types.ts @@ -1,5 +1,5 @@ -import { typeGuard } from "../typeSafety/typeGuard"; -import { getPrototypeChain } from "./getPrototypeChain"; +import { typeGuard } from "../typeSafety/typeGuard.ts"; +import { getPrototypeChain } from "./getPrototypeChain.ts"; type SetLike = { values: () => Iterable; diff --git a/src/tools/isCallableFunction.ts b/tools/isCallableFunction.ts similarity index 100% rename from src/tools/isCallableFunction.ts rename to tools/isCallableFunction.ts diff --git a/src/tools/reducers/allEquals.ts b/tools/reducers/allEquals.ts similarity index 92% rename from src/tools/reducers/allEquals.ts rename to tools/reducers/allEquals.ts index 9971ec37..ae110050 100644 --- a/src/tools/reducers/allEquals.ts +++ b/tools/reducers/allEquals.ts @@ -1,6 +1,6 @@ -import { allEqualsTo } from "./allEqualsTo"; -import { ReduceArguments, toReduceArguments } from "./reduceify"; +import { allEqualsTo } from "./allEqualsTo.ts"; +import { ReduceArguments, toReduceArguments } from "./reduceify.ts"; export function arrAllEquals( arr: readonly ArrOf[], diff --git a/src/tools/reducers/allEqualsTo.ts b/tools/reducers/allEqualsTo.ts similarity index 85% rename from src/tools/reducers/allEqualsTo.ts rename to tools/reducers/allEqualsTo.ts index 0d8718b6..554980ce 100644 --- a/src/tools/reducers/allEqualsTo.ts +++ b/tools/reducers/allEqualsTo.ts @@ -1,6 +1,6 @@ -import { toReduceArguments, ReduceArguments } from "./reduceify"; -import { every } from "./every"; +import { toReduceArguments, ReduceArguments } from "./reduceify.ts"; +import { every } from "./every.ts"; export function arrAllEqualsTo( diff --git a/src/tools/reducers/allUniq.ts b/tools/reducers/allUniq.ts similarity index 79% rename from src/tools/reducers/allUniq.ts rename to tools/reducers/allUniq.ts index d3fb5808..9275318c 100644 --- a/src/tools/reducers/allUniq.ts +++ b/tools/reducers/allUniq.ts @@ -1,6 +1,6 @@ -import { removeDuplicates } from "./removeDuplicates"; -import { allEquals } from "./allEquals"; -import { ReduceArguments, toReduceArguments } from "./reduceify"; +import { removeDuplicates } from "./removeDuplicates.ts"; +import { allEquals } from "./allEquals.ts"; +import { ReduceArguments, toReduceArguments } from "./reduceify.ts"; export function arrAllUniq( arr: readonly ArrOf[], diff --git a/src/tools/reducers/and.ts b/tools/reducers/and.ts similarity index 83% rename from src/tools/reducers/and.ts rename to tools/reducers/and.ts index 99fb2058..870b81aa 100644 --- a/src/tools/reducers/and.ts +++ b/tools/reducers/and.ts @@ -1,4 +1,4 @@ -import { ReduceArguments, toReduceArguments } from "./reduceify"; +import { ReduceArguments, toReduceArguments } from "./reduceify.ts"; export function arrAnd( arr: readonly ArrOf[], diff --git a/src/tools/reducers/contains.ts b/tools/reducers/contains.ts similarity index 85% rename from src/tools/reducers/contains.ts rename to tools/reducers/contains.ts index ab052730..96f554c7 100644 --- a/src/tools/reducers/contains.ts +++ b/tools/reducers/contains.ts @@ -1,5 +1,5 @@ -import { toReduceArguments, ReduceArguments } from "./reduceify"; +import { toReduceArguments, ReduceArguments } from "./reduceify.ts"; export function arrContains( arr: readonly ArrOf[], diff --git a/src/tools/reducers/count.ts b/tools/reducers/count.ts similarity index 84% rename from src/tools/reducers/count.ts rename to tools/reducers/count.ts index ca637df2..f83138be 100644 --- a/src/tools/reducers/count.ts +++ b/tools/reducers/count.ts @@ -1,4 +1,4 @@ -import { toReduceArguments, ReduceArguments } from "./reduceify"; +import { toReduceArguments, ReduceArguments } from "./reduceify.ts"; export function arrCount( arr: readonly ArrOf[], diff --git a/src/tools/reducers/diff.ts b/tools/reducers/diff.ts similarity index 86% rename from src/tools/reducers/diff.ts rename to tools/reducers/diff.ts index 41b4128f..2d0579f3 100644 --- a/src/tools/reducers/diff.ts +++ b/tools/reducers/diff.ts @@ -1,6 +1,6 @@ -import { ReduceArguments, toReduceArguments } from "./reduceify"; -import { contains } from "./contains"; -import { removeDuplicates } from "./removeDuplicates"; +import { ReduceArguments, toReduceArguments } from "./reduceify.ts"; +import { contains } from "./contains.ts"; +import { removeDuplicates } from "./removeDuplicates.ts"; export type ArrDiff = { added: readonly T[]; diff --git a/src/tools/reducers/every.ts b/tools/reducers/every.ts similarity index 84% rename from src/tools/reducers/every.ts rename to tools/reducers/every.ts index 28dd400b..fc8e684e 100644 --- a/src/tools/reducers/every.ts +++ b/tools/reducers/every.ts @@ -1,4 +1,4 @@ -import { ReduceArguments, toReduceArguments } from "./reduceify"; +import { ReduceArguments, toReduceArguments } from "./reduceify.ts"; export function arrEvery( arr: readonly ArrOf[], diff --git a/src/tools/reducers/includes.ts b/tools/reducers/includes.ts similarity index 77% rename from src/tools/reducers/includes.ts rename to tools/reducers/includes.ts index 6ca8266d..4d463bc5 100644 --- a/src/tools/reducers/includes.ts +++ b/tools/reducers/includes.ts @@ -1,5 +1,5 @@ -import { ReduceArguments, toReduceArguments } from "./reduceify"; +import { ReduceArguments, toReduceArguments } from "./reduceify.ts"; export function arrIncludes(arr: readonly ArrOf[], e: ArrOf): boolean { return arr.indexOf(e) >= 0; diff --git a/tools/reducers/index.ts b/tools/reducers/index.ts new file mode 100644 index 00000000..ff7cc805 --- /dev/null +++ b/tools/reducers/index.ts @@ -0,0 +1,28 @@ + +import { allEquals, allEqualsFactory } from "./allEquals.ts"; +import { allEqualsTo, allEqualsToFactory } from "./allEqualsTo.ts"; +import { allUniq, allUniqFactory } from "./allUniq.ts"; +import { and } from "./and.ts"; +import { includes } from "./includes.ts"; +import { count } from "./count.ts"; +import { every } from "./every.ts"; +import { or } from "./or.ts"; +import { removeDuplicates, removeDuplicatesFactory } from "./removeDuplicates.ts"; +import { sameAs, sameAsFactory } from "./sameAs.ts"; +import { partition } from "./partition.ts"; +import { diff } from "./diff.ts"; + +export { + allEquals, allEqualsFactory, + allEqualsTo, allEqualsToFactory, + allUniq, allUniqFactory, + and, + includes, + count, + every, + or, + removeDuplicates, removeDuplicatesFactory, + sameAs, sameAsFactory, + partition, + diff +}; diff --git a/src/tools/reducers/or.ts b/tools/reducers/or.ts similarity index 83% rename from src/tools/reducers/or.ts rename to tools/reducers/or.ts index 373915f0..491fe081 100644 --- a/src/tools/reducers/or.ts +++ b/tools/reducers/or.ts @@ -1,4 +1,4 @@ -import { ReduceArguments, toReduceArguments } from "./reduceify"; +import { ReduceArguments, toReduceArguments } from "./reduceify.ts"; export function arrOr( arr: readonly ArrOf[], diff --git a/src/tools/reducers/partition.ts b/tools/reducers/partition.ts similarity index 92% rename from src/tools/reducers/partition.ts rename to tools/reducers/partition.ts index adf43270..14f572e0 100644 --- a/src/tools/reducers/partition.ts +++ b/tools/reducers/partition.ts @@ -1,7 +1,7 @@ -import { assert, typeGuard } from "../typeSafety"; -import { ReduceArguments, toReduceArguments } from "./reduceify"; +import { assert, typeGuard } from "../typeSafety/index.ts"; +import { ReduceArguments, toReduceArguments } from "./reduceify.ts"; function arrPartitionImpl( arr: readonly ArrOf[], diff --git a/src/tools/reducers/reduceify.ts b/tools/reducers/reduceify.ts similarity index 100% rename from src/tools/reducers/reduceify.ts rename to tools/reducers/reduceify.ts diff --git a/src/tools/reducers/removeDuplicates.ts b/tools/reducers/removeDuplicates.ts similarity index 87% rename from src/tools/reducers/removeDuplicates.ts rename to tools/reducers/removeDuplicates.ts index f3c0ca4e..8fb06e4f 100644 --- a/src/tools/reducers/removeDuplicates.ts +++ b/tools/reducers/removeDuplicates.ts @@ -1,6 +1,6 @@ -import { allEqualsTo } from "./allEqualsTo"; -import { ReduceArguments, toReduceArguments } from "./reduceify"; +import { allEqualsTo } from "./allEqualsTo.ts"; +import { ReduceArguments, toReduceArguments } from "./reduceify.ts"; export function arrRemoveDuplicates( arr: readonly ArrOf[], diff --git a/src/tools/reducers/sameAs.ts b/tools/reducers/sameAs.ts similarity index 94% rename from src/tools/reducers/sameAs.ts rename to tools/reducers/sameAs.ts index 4bd800ee..64bf11a5 100644 --- a/src/tools/reducers/sameAs.ts +++ b/tools/reducers/sameAs.ts @@ -1,5 +1,5 @@ -import { allEquals } from "./allEquals"; -import { ReduceArguments, toReduceArguments } from "./reduceify"; +import { allEquals } from "./allEquals.ts"; +import { ReduceArguments, toReduceArguments } from "./reduceify.ts"; export function arrSameAs( arr: readonly ArrOf[], diff --git a/src/tools/reducers/test.ts b/tools/reducers/test.ts similarity index 96% rename from src/tools/reducers/test.ts rename to tools/reducers/test.ts index 35499d76..6cb7eaec 100644 --- a/src/tools/reducers/test.ts +++ b/tools/reducers/test.ts @@ -1,9 +1,9 @@ -import { assert } from "../typeSafety"; -import { every, allEqualsTo, allEquals, removeDuplicates, partition, allUniq, and, count, includes, or, sameAs, diff } from "./index"; -import { arrEvery } from "./every"; -import { arrPartition } from "./partition"; -import { same } from "../inDepth/same"; +import { assert } from "../typeSafety/index.ts"; +import { every, allEqualsTo, allEquals, removeDuplicates, partition, allUniq, and, count, includes, or, sameAs, diff } from "./index.ts"; +import { arrEvery } from "./every.ts"; +import { arrPartition } from "./partition.ts"; +import { same } from "../inDepth/same.ts"; assert(["foo", "foo", "foo"].reduce(...every(e => e === "foo")) === true); assert(["foo", "foo", "bar"].reduce(...every(e => e === "foo")) === false); diff --git a/src/tools/testing/getPromiseAssertionApi.ts b/tools/testing/getPromiseAssertionApi.ts similarity index 94% rename from src/tools/testing/getPromiseAssertionApi.ts rename to tools/testing/getPromiseAssertionApi.ts index a8b57ccc..c05242e1 100644 --- a/src/tools/testing/getPromiseAssertionApi.ts +++ b/tools/testing/getPromiseAssertionApi.ts @@ -1,6 +1,6 @@ -import { assert } from "../typeSafety"; -import { sameFactory } from "../inDepth/same"; +import { assert } from "../typeSafety/index.ts"; +import { sameFactory } from "../inDepth/same.ts"; export function getPromiseAssertionApi( params?: { takeIntoAccountArraysOrdering: boolean; } diff --git a/tools/testing/index.ts b/tools/testing/index.ts new file mode 100644 index 00000000..1236c671 --- /dev/null +++ b/tools/testing/index.ts @@ -0,0 +1 @@ +export * from "./getPromiseAssertionApi.ts"; \ No newline at end of file diff --git a/src/tools/typeSafety/AsyncReturnType.ts b/tools/typeSafety/AsyncReturnType.ts similarity index 100% rename from src/tools/typeSafety/AsyncReturnType.ts rename to tools/typeSafety/AsyncReturnType.ts diff --git a/src/tools/typeSafety/UnpackPromise.ts b/tools/typeSafety/UnpackPromise.ts similarity index 100% rename from src/tools/typeSafety/UnpackPromise.ts rename to tools/typeSafety/UnpackPromise.ts diff --git a/src/tools/typeSafety/UnpackTypeGuard.ts b/tools/typeSafety/UnpackTypeGuard.ts similarity index 100% rename from src/tools/typeSafety/UnpackTypeGuard.ts rename to tools/typeSafety/UnpackTypeGuard.ts diff --git a/src/tools/typeSafety/assert.ts b/tools/typeSafety/assert.ts similarity index 100% rename from src/tools/typeSafety/assert.ts rename to tools/typeSafety/assert.ts diff --git a/src/tools/typeSafety/defineAccessors.ts b/tools/typeSafety/defineAccessors.ts similarity index 100% rename from src/tools/typeSafety/defineAccessors.ts rename to tools/typeSafety/defineAccessors.ts diff --git a/src/tools/typeSafety/exclude.ts b/tools/typeSafety/exclude.ts similarity index 100% rename from src/tools/typeSafety/exclude.ts rename to tools/typeSafety/exclude.ts diff --git a/src/tools/typeSafety/id.ts b/tools/typeSafety/id.ts similarity index 100% rename from src/tools/typeSafety/id.ts rename to tools/typeSafety/id.ts diff --git a/tools/typeSafety/index.ts b/tools/typeSafety/index.ts new file mode 100644 index 00000000..08c16384 --- /dev/null +++ b/tools/typeSafety/index.ts @@ -0,0 +1,9 @@ +export { assert } from "./assert.ts"; +export { AsyncReturnType } from "./AsyncReturnType.ts"; +export { exclude } from "./exclude.ts"; +export { id } from "./id.ts"; +export { matchVoid } from "./matchVoid.ts"; +export { objectKeys } from "./objectKeys.ts"; +export { typeGuard } from "./typeGuard.ts"; +export { UnpackPromise } from "./UnpackPromise.ts"; +export { UnpackTypeGuard } from "./UnpackTypeGuard.ts"; \ No newline at end of file diff --git a/src/tools/typeSafety/matchVoid.ts b/tools/typeSafety/matchVoid.ts similarity index 100% rename from src/tools/typeSafety/matchVoid.ts rename to tools/typeSafety/matchVoid.ts diff --git a/src/tools/typeSafety/objectKeys.ts b/tools/typeSafety/objectKeys.ts similarity index 100% rename from src/tools/typeSafety/objectKeys.ts rename to tools/typeSafety/objectKeys.ts diff --git a/src/tools/typeSafety/overwriteReadonlyProp.ts b/tools/typeSafety/overwriteReadonlyProp.ts similarity index 100% rename from src/tools/typeSafety/overwriteReadonlyProp.ts rename to tools/typeSafety/overwriteReadonlyProp.ts diff --git a/src/tools/typeSafety/typeGuard.ts b/tools/typeSafety/typeGuard.ts similarity index 100% rename from src/tools/typeSafety/typeGuard.ts rename to tools/typeSafety/typeGuard.ts