From 85d44735d601fafa051f1694a78b4a329b1372e0 Mon Sep 17 00:00:00 2001 From: INeedJobToStartWork Date: Mon, 4 Nov 2024 21:56:12 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20=20Chore(packages):=20impl?= =?UTF-8?q?emetation=20o-internal-export=20package=20at=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/tsuprc/tsup.prod.ts | 4 +- eslint.config.js | 3 +- package.json | 1 + pnpm-lock.yaml | 93 ++++++++++++++++++++++++++++++--- src/functions/myErrorHandler.ts | 1 + src/index.ts | 15 ------ src/types/internal.ts | 11 +++- src/utils/isPromise.ts | 3 +- tsconfig.json | 3 +- 9 files changed, 106 insertions(+), 28 deletions(-) diff --git a/config/tsuprc/tsup.prod.ts b/config/tsuprc/tsup.prod.ts index 133666e..e8c6ae3 100644 --- a/config/tsuprc/tsup.prod.ts +++ b/config/tsuprc/tsup.prod.ts @@ -1,4 +1,5 @@ import { copy } from "esbuild-plugin-copy"; +import noInternalExportsPlugin from "@esplugins/no-internal-exports"; import config from "./tsup.base"; import { defineConfig } from "tsup"; @@ -19,6 +20,7 @@ export default defineConfig({ { from: "./.npmignore", to: "./.npmignore" }, { from: "./README.md", to: "./README.md" } ] - }) + }), + noInternalExportsPlugin ] }); diff --git a/eslint.config.js b/eslint.config.js index 1838a38..a3e9f9f 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -25,5 +25,6 @@ export default ineedj({ }).removeRules( "@typescript-eslint/no-throw-literal" /** Use custom Error */, "@EslintSecurity/detect-object-injection", - "MD010/no-hard-tabs" + "MD010/no-hard-tabs", + "@EslintTSDocs/syntax" ); diff --git a/package.json b/package.json index 77ab372..df8313d 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ }, "devDependencies": { "@changesets/cli": "^2.27.8", + "@esplugins/no-internal-exports": "^1.0.0", "@ineedj/eslintrc": "^1.2.2", "@ineedj/prettierrc": "^2.0.0", "@ineedj/tsconfig": "^1.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 739f429..88d8a02 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,6 +11,9 @@ importers: '@changesets/cli': specifier: ^2.27.8 version: 2.27.8 + '@esplugins/no-internal-exports': + specifier: ^1.0.0 + version: 1.0.0 '@ineedj/eslintrc': specifier: ^1.2.2 version: 1.2.2(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(tailwindcss@3.4.7)(typescript@5.3.2)(vitest@2.1.1(@types/node@20.16.10)(stylus@0.57.0))(vue-eslint-parser@9.4.3(eslint@8.57.0)) @@ -680,6 +683,9 @@ packages: resolution: {integrity: sha512-/qu+TWz8WwPWc7/HcIJKi+c+MOm46GdVaSlTTQcaqaL53+GsoA6MxWp5PtTx48qbSP7ylM1Kn7nhvkugfJvRSA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@esplugins/no-internal-exports@1.0.0': + resolution: {integrity: sha512-G6EqhUcXGvmCibvWMVT7+EQxR9lk828E9tfpagAJOWCQdd2o7bTFAb0jbCkfFaPEOetlFGpx7cK0LsmEFeDShQ==} + '@html-eslint/eslint-plugin@0.25.0': resolution: {integrity: sha512-5DlvqO8bbe90cKSfFDuEblyrEnhAdgNTjWxXeUxt/XXC2OuMC8CsxzLZjtK3+0X6yM8m4xcE3fymCPwg7zdcXQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -2305,6 +2311,11 @@ packages: engines: {node: '>=0.4.0'} hasBin: true + acorn@8.14.0: + resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==} + engines: {node: '>=0.4.0'} + hasBin: true + ajv@6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} @@ -4534,6 +4545,9 @@ packages: resolution: {integrity: sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==} engines: {node: '>=12'} + magic-regexp@0.8.0: + resolution: {integrity: sha512-lOSLWdE156csDYwCTIGiAymOLN7Epu/TU5e/oAnISZfU6qP+pgjkE+xbVjVn3yLPKN8n1G2yIAYTAM5KRk6/ow==} + magic-string@0.30.11: resolution: {integrity: sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==} @@ -4865,6 +4879,10 @@ packages: resolution: {integrity: sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==} engines: {node: '>= 0.4'} + oh-my-error@2.0.0-prerelease.0: + resolution: {integrity: sha512-+c+9jL0H+ZKmxkCdUMsnEhjKnNOfditA9ikCnbNLN4uCtl29hQg1UuU3+f/Hm/PmORA1RqtbYd2PgRzOjl8gbA==} + engines: {node: '>=18'} + once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} @@ -5891,6 +5909,9 @@ packages: resolution: {integrity: sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==} engines: {node: '>=14.16'} + type-level-regexp@0.1.17: + resolution: {integrity: sha512-wTk4DH3cxwk196uGLK/E9pE45aLfeKJacKmcEgEOA/q5dnPGNxXt0cfYdFxb57L+sEpf1oJH4Dnx/pnRcku9jg==} + typed-array-buffer@1.0.2: resolution: {integrity: sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==} engines: {node: '>= 0.4'} @@ -5915,6 +5936,11 @@ packages: engines: {node: '>=14.17'} hasBin: true + typescript@5.6.3: + resolution: {integrity: sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==} + engines: {node: '>=14.17'} + hasBin: true + uc.micro@2.1.0: resolution: {integrity: sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==} @@ -5979,6 +6005,15 @@ packages: resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} engines: {node: '>= 10.0.0'} + unplugin@1.15.0: + resolution: {integrity: sha512-jTPIs63W+DUEDW207ztbaoO7cQ4p5aVaB823LSlxpsFEU3Mykwxf3ZGC/wzxFJeZlASZYgVrWeo7LgOrqJZ8RA==} + engines: {node: '>=14.0.0'} + peerDependencies: + webpack-sources: ^3 + peerDependenciesMeta: + webpack-sources: + optional: true + update-browserslist-db@1.1.1: resolution: {integrity: sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==} hasBin: true @@ -6125,6 +6160,9 @@ packages: webidl-conversions@4.0.2: resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} + webpack-virtual-modules@0.6.2: + resolution: {integrity: sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==} + whatwg-url@7.1.0: resolution: {integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==} @@ -6875,6 +6913,14 @@ snapshots: '@eslint/js@9.11.1': {} + '@esplugins/no-internal-exports@1.0.0': + dependencies: + magic-regexp: 0.8.0 + oh-my-error: 2.0.0-prerelease.0 + typescript: 5.6.3 + transitivePeerDependencies: + - webpack-sources + '@html-eslint/eslint-plugin@0.25.0': {} '@html-eslint/parser@0.25.0': @@ -7196,6 +7242,8 @@ snapshots: putout: 35.37.1(eslint@8.57.0)(typescript@5.3.2) try-catch: 3.0.1 try-to-catch: 3.0.1 + transitivePeerDependencies: + - supports-color '@putout/engine-loader@14.0.0(putout@36.8.0(eslint@8.57.0)(typescript@5.3.2))': dependencies: @@ -7226,6 +7274,8 @@ snapshots: picomatch: 4.0.2 putout: 35.37.1(eslint@8.57.0)(typescript@5.3.2) try-to-catch: 3.0.1 + transitivePeerDependencies: + - supports-color '@putout/engine-processor@12.0.0(putout@36.8.0(eslint@8.57.0)(typescript@5.3.2))': dependencies: @@ -7244,6 +7294,8 @@ snapshots: putout: 35.37.1(eslint@8.57.0)(typescript@5.3.2) try-catch: 3.0.1 try-to-catch: 3.0.1 + transitivePeerDependencies: + - supports-color '@putout/engine-reporter@2.0.0(putout@36.8.0(eslint@8.57.0)(typescript@5.3.2))': dependencies: @@ -8564,7 +8616,7 @@ snapshots: eslint-config-prettier: 8.10.0(eslint@8.57.0) eslint-module-utils: 2.12.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint-plugin-import@2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) eslint-plugin-eslint-comments: 3.2.0(eslint@8.57.0) - eslint-plugin-import: 2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.0) + eslint-plugin-import: 2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint-plugin-import@2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) eslint-plugin-jest: 27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint@8.57.0)(typescript@5.3.2))(eslint@8.57.0)(typescript@5.3.2) eslint-plugin-jest-formatting: 3.1.0(eslint@8.57.0) eslint-plugin-jsx-a11y: 6.10.0(eslint@8.57.0) @@ -9123,6 +9175,8 @@ snapshots: acorn@8.12.1: {} + acorn@8.14.0: {} + ajv@6.12.6: dependencies: fast-deep-equal: 3.1.3 @@ -9899,7 +9953,7 @@ snapshots: '@typescript-eslint/parser': 6.21.0(eslint@8.57.0)(typescript@5.3.2) eslint: 8.57.0 eslint-config-prettier: 9.1.0(eslint@8.57.0) - eslint-import-resolver-alias: 1.1.2(eslint-plugin-import@2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint@8.57.0)) + eslint-import-resolver-alias: 1.1.2(eslint-plugin-import@2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint-plugin-import@2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0)) eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint-plugin-import@2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint@8.57.0))(eslint@8.57.0) eslint-plugin-array-func: 4.0.0(eslint@8.57.0) eslint-plugin-compat: 5.0.0(eslint@8.57.0) @@ -9908,7 +9962,7 @@ snapshots: eslint-plugin-etc: 2.0.3(eslint@8.57.0)(typescript@5.3.2) eslint-plugin-ext: 0.1.0 eslint-plugin-functional: 6.6.3(eslint@8.57.0)(typescript@5.3.2) - eslint-plugin-import: 2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.0) + eslint-plugin-import: 2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint-plugin-import@2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) eslint-plugin-jest: 28.8.3(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint@8.57.0)(typescript@5.3.2))(eslint@8.57.0)(typescript@5.3.2) eslint-plugin-jest-dom: 5.4.0(eslint@8.57.0) eslint-plugin-jest-formatting: 3.1.0(eslint@8.57.0) @@ -9992,9 +10046,9 @@ snapshots: '@types/eslint': 9.6.1 pathe: 1.1.2 - eslint-import-resolver-alias@1.1.2(eslint-plugin-import@2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint@8.57.0)): + eslint-import-resolver-alias@1.1.2(eslint-plugin-import@2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint-plugin-import@2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0)): dependencies: - eslint-plugin-import: 2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.0) + eslint-plugin-import: 2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint-plugin-import@2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) eslint-import-resolver-node@0.3.9: dependencies: @@ -10016,7 +10070,7 @@ snapshots: is-bun-module: 1.2.1 is-glob: 4.0.3 optionalDependencies: - eslint-plugin-import: 2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.0) + eslint-plugin-import: 2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint-plugin-import@2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) transitivePeerDependencies: - '@typescript-eslint/parser' - eslint-import-resolver-node @@ -10204,7 +10258,7 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-plugin-import@2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.0): + eslint-plugin-import@2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint-plugin-import@2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.2))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.8 @@ -11791,6 +11845,18 @@ snapshots: lru-cache@7.18.3: {} + magic-regexp@0.8.0: + dependencies: + estree-walker: 3.0.3 + magic-string: 0.30.11 + mlly: 1.7.1 + regexp-tree: 0.1.27 + type-level-regexp: 0.1.17 + ufo: 1.5.4 + unplugin: 1.15.0 + transitivePeerDependencies: + - webpack-sources + magic-string@0.30.11: dependencies: '@jridgewell/sourcemap-codec': 1.5.0 @@ -12320,6 +12386,8 @@ snapshots: define-properties: 1.2.1 es-object-atoms: 1.0.0 + oh-my-error@2.0.0-prerelease.0: {} + once@1.4.0: dependencies: wrappy: 1.0.2 @@ -13852,6 +13920,8 @@ snapshots: type-fest@3.13.1: {} + type-level-regexp@0.1.17: {} + typed-array-buffer@1.0.2: dependencies: call-bind: 1.0.7 @@ -13888,6 +13958,8 @@ snapshots: typescript@5.3.2: {} + typescript@5.6.3: {} + uc.micro@2.1.0: {} ufo@1.5.4: {} @@ -13999,6 +14071,11 @@ snapshots: universalify@2.0.1: {} + unplugin@1.15.0: + dependencies: + acorn: 8.14.0 + webpack-virtual-modules: 0.6.2 + update-browserslist-db@1.1.1(browserslist@4.24.0): dependencies: browserslist: 4.24.0 @@ -14171,6 +14248,8 @@ snapshots: webidl-conversions@4.0.2: {} + webpack-virtual-modules@0.6.2: {} + whatwg-url@7.1.0: dependencies: lodash.sortby: 4.7.0 diff --git a/src/functions/myErrorHandler.ts b/src/functions/myErrorHandler.ts index a8c989f..f923b99 100644 --- a/src/functions/myErrorHandler.ts +++ b/src/functions/myErrorHandler.ts @@ -2,6 +2,7 @@ import { myError, myErrorWrapperAsync } from "@/functions"; import type { TMyErrorList } from "@/types"; +/** @internal */ const ErrorList = { noKeyInList: { code: "EH001", diff --git a/src/index.ts b/src/index.ts index 7fdcbef..32a611b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,17 +1,2 @@ export * from "@/functions"; export * from "@/types"; -// export type { -// TMyErrorList, -// IMyError, -// IMyErrorAPI, -// IMyErrorRateLimit, -// IMyErrorValidation, -// TCauseError, -// TDetails, -// TBaseError, -// TBaseErrorExt, -// TValidationError, -// TApiError, -// TApiRateLimit, -// TAllMyErrorTypes -// } from "@/types"; diff --git a/src/types/internal.ts b/src/types/internal.ts index e1d22e7..ca10648 100644 --- a/src/types/internal.ts +++ b/src/types/internal.ts @@ -4,14 +4,16 @@ import type { IMyError, TMyErrorList } from "@/types"; * `any` - But only allowed in development. * @internal */ -export type TODO = any; // eslint-disable-line @typescript-eslint/no-explicit-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export type TODO = any; /** - * @internal + * @dontexport */ export type Prettify = { [K in keyof T]: NonNullable; }; +/** @dontexport */ export type arrowFunction) => ReturnType> = ( ...arguments_: Parameters ) => ReturnType; @@ -24,8 +26,11 @@ export type ErrorTypesCatched = | SyntaxErrorConstructor | TypeErrorConstructor; +/** @dontexport */ export type TDataReturn = [T, false]; +/** @dontexport */ export type TErrorReturn> = [CustomError & IMyError, true]; +/** @dontexport */ export type TFunctionReturn = Prettify> | Prettify; // export type TMyErrorList> = Record>>; @@ -43,4 +48,6 @@ export type TMyHandler< // [K in T[keyof T]["code"]]: (...args: K[]) => TFunctionReturn; // }>; // eslint-disable-next-line @typescript-eslint/no-explicit-any +/** @dontexport */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any export type NoInfer = [T][T extends any ? 0 : never]; diff --git a/src/utils/isPromise.ts b/src/utils/isPromise.ts index f2baa63..a036366 100644 --- a/src/utils/isPromise.ts +++ b/src/utils/isPromise.ts @@ -1,5 +1,6 @@ +/** @internal */ // eslint-disable-next-line @typescript-eslint/ban-types -export function isPromise(value: Function): Boolean { +export function isPromise(value: Function): boolean { return value.constructor.name == "AsyncFuncton"; } export default isPromise; diff --git a/tsconfig.json b/tsconfig.json index 47cbe62..bd08406 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,7 +5,8 @@ "baseUrl": "./src", "paths": { "@/*": ["*", "*/index.ts", "*.ts"] - } + }, + "stripInternal": true }, "extends": "@ineedj/tsconfig/base.json" }