diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 1b3e933..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "deno.enable": true, - "deno.lint": true, - "deno.config": "deno.json", - "deno.codeLens.implementations": true, - "deno.codeLens.references": true, - "deno.codeLens.referencesAllFunctions": true, - "deno.unstable": true -} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 23c287f..bb1a006 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.7.6](https://github.com/feathersjs/hooks/compare/v0.7.5...v0.7.6) (2022-12-08) + + +### Bug Fixes + +* restore `context.type` ([#104](https://github.com/feathersjs/hooks/issues/104)) ([1d934ae](https://github.com/feathersjs/hooks/commit/1d934aee85276b4585268dcaf4e6360d7b1137dc)) + + + + + ## [0.7.5](https://github.com/feathersjs/hooks/compare/v0.7.4...v0.7.5) (2022-06-04) diff --git a/deno.lock b/deno.lock new file mode 100644 index 0000000..5ae2b31 --- /dev/null +++ b/deno.lock @@ -0,0 +1,114 @@ +{ + "version": "2", + "remote": { + "https://deno.land/std@0.106.0/_util/assert.ts": "2f868145a042a11d5ad0a3c748dcf580add8a0dbc0e876eaa0026303a5488f58", + "https://deno.land/std@0.106.0/_util/os.ts": "dfb186cc4e968c770ab6cc3288bd65f4871be03b93beecae57d657232ecffcac", + "https://deno.land/std@0.106.0/fs/_util.ts": "f2ce811350236ea8c28450ed822a5f42a0892316515b1cd61321dec13569c56b", + "https://deno.land/std@0.106.0/fs/ensure_dir.ts": "b7c103dc41a3d1dbbb522bf183c519c37065fdc234831a4a0f7d671b1ed5fea7", + "https://deno.land/std@0.106.0/fs/expand_glob.ts": "73e7b13f01097b04ed782b3d63863379b718417417758ba622e282b1e5300b91", + "https://deno.land/std@0.106.0/fs/walk.ts": "b91c655c60d048035f9cae0e6177991ab3245e786e3ab7d20a5b60012edf2126", + "https://deno.land/std@0.106.0/path/_constants.ts": "1247fee4a79b70c89f23499691ef169b41b6ccf01887a0abd131009c5581b853", + "https://deno.land/std@0.106.0/path/_interface.ts": "1fa73b02aaa24867e481a48492b44f2598cd9dfa513c7b34001437007d3642e4", + "https://deno.land/std@0.106.0/path/_util.ts": "2e06a3b9e79beaf62687196bd4b60a4c391d862cfa007a20fc3a39f778ba073b", + "https://deno.land/std@0.106.0/path/common.ts": "eaf03d08b569e8a87e674e4e265e099f237472b6fd135b3cbeae5827035ea14a", + "https://deno.land/std@0.106.0/path/glob.ts": "3b84af55c53febacf6afe214c095624b22a56b6f57d7312157479cc783a0de65", + "https://deno.land/std@0.106.0/path/mod.ts": "4465dc494f271b02569edbb4a18d727063b5dbd6ed84283ff906260970a15d12", + "https://deno.land/std@0.106.0/path/posix.ts": "b81974c768d298f8dcd2c720229639b3803ca4a241fa9a355c762fa2bc5ef0c1", + "https://deno.land/std@0.106.0/path/separator.ts": "8fdcf289b1b76fd726a508f57d3370ca029ae6976fcde5044007f062e643ff1c", + "https://deno.land/std@0.106.0/path/win32.ts": "f4a3d4a3f2c9fe894da046d5eac48b5e789a0ebec5152b2c0985efe96a9f7ae1", + "https://deno.land/std@0.111.0/_util/assert.ts": "2f868145a042a11d5ad0a3c748dcf580add8a0dbc0e876eaa0026303a5488f58", + "https://deno.land/std@0.111.0/_util/os.ts": "dfb186cc4e968c770ab6cc3288bd65f4871be03b93beecae57d657232ecffcac", + "https://deno.land/std@0.111.0/bytes/bytes_list.ts": "3bff6a09c72b2e0b1e92e29bd3b135053894196cca07a2bba842901073efe5cb", + "https://deno.land/std@0.111.0/bytes/equals.ts": "69f55fdbd45c71f920c1a621e6c0865dc780cd8ae34e0f5e55a9497b70c31c1b", + "https://deno.land/std@0.111.0/bytes/mod.ts": "fedb80b8da2e7ad8dd251148e65f92a04c73d6c5a430b7d197dc39588c8dda6f", + "https://deno.land/std@0.111.0/fmt/colors.ts": "8368ddf2d48dfe413ffd04cdbb7ae6a1009cf0dccc9c7ff1d76259d9c61a0621", + "https://deno.land/std@0.111.0/fs/_util.ts": "f2ce811350236ea8c28450ed822a5f42a0892316515b1cd61321dec13569c56b", + "https://deno.land/std@0.111.0/fs/ensure_dir.ts": "b7c103dc41a3d1dbbb522bf183c519c37065fdc234831a4a0f7d671b1ed5fea7", + "https://deno.land/std@0.111.0/hash/sha256.ts": "bd85257c68d1fdd9da8457284c4fbb04efa9f4f2229b5f41a638d5b71a3a8d5c", + "https://deno.land/std@0.111.0/io/buffer.ts": "fdf93ba9e5d20ff3369e2c42443efd89131f8a73066f7f59c033cc588a0e2cfe", + "https://deno.land/std@0.111.0/io/types.d.ts": "89a27569399d380246ca7cdd9e14d5e68459f11fb6110790cc5ecbd4ee7f3215", + "https://deno.land/std@0.111.0/path/_constants.ts": "1247fee4a79b70c89f23499691ef169b41b6ccf01887a0abd131009c5581b853", + "https://deno.land/std@0.111.0/path/_interface.ts": "1fa73b02aaa24867e481a48492b44f2598cd9dfa513c7b34001437007d3642e4", + "https://deno.land/std@0.111.0/path/_util.ts": "2e06a3b9e79beaf62687196bd4b60a4c391d862cfa007a20fc3a39f778ba073b", + "https://deno.land/std@0.111.0/path/common.ts": "f41a38a0719a1e85aa11c6ba3bea5e37c15dd009d705bd8873f94c833568cbc4", + "https://deno.land/std@0.111.0/path/glob.ts": "ea87985765b977cc284b92771003b2070c440e0807c90e1eb0ff3e095911a820", + "https://deno.land/std@0.111.0/path/mod.ts": "4465dc494f271b02569edbb4a18d727063b5dbd6ed84283ff906260970a15d12", + "https://deno.land/std@0.111.0/path/posix.ts": "34349174b9cd121625a2810837a82dd8b986bbaaad5ade690d1de75bbb4555b2", + "https://deno.land/std@0.111.0/path/separator.ts": "8fdcf289b1b76fd726a508f57d3370ca029ae6976fcde5044007f062e643ff1c", + "https://deno.land/std@0.111.0/path/win32.ts": "11549e8c6df8307a8efcfa47ad7b2a75da743eac7d4c89c9723a944661c8bd2e", + "https://deno.land/std@0.111.0/streams/conversion.ts": "fe0059ed9d3c53eda4ba44eb71a6a9acb98c5fdb5ba1b6c6ab28004724c7641b", + "https://deno.land/std@0.114.0/fmt/colors.ts": "8368ddf2d48dfe413ffd04cdbb7ae6a1009cf0dccc9c7ff1d76259d9c61a0621", + "https://deno.land/std@0.114.0/testing/_diff.ts": "95578951cd3c9977fd3822c64e9831c739ae8d2a5faece71d3f21bfb553f6275", + "https://deno.land/std@0.114.0/testing/asserts.ts": "550c71c634c608cffabf9e50520435cf03ff4bbd1db1253b0ade4debb444b131", + "https://deno.land/std@0.115.1/_util/assert.ts": "2f868145a042a11d5ad0a3c748dcf580add8a0dbc0e876eaa0026303a5488f58", + "https://deno.land/std@0.115.1/_util/os.ts": "dfb186cc4e968c770ab6cc3288bd65f4871be03b93beecae57d657232ecffcac", + "https://deno.land/std@0.115.1/path/_constants.ts": "1247fee4a79b70c89f23499691ef169b41b6ccf01887a0abd131009c5581b853", + "https://deno.land/std@0.115.1/path/_interface.ts": "1fa73b02aaa24867e481a48492b44f2598cd9dfa513c7b34001437007d3642e4", + "https://deno.land/std@0.115.1/path/_util.ts": "2e06a3b9e79beaf62687196bd4b60a4c391d862cfa007a20fc3a39f778ba073b", + "https://deno.land/std@0.115.1/path/common.ts": "f41a38a0719a1e85aa11c6ba3bea5e37c15dd009d705bd8873f94c833568cbc4", + "https://deno.land/std@0.115.1/path/glob.ts": "ea87985765b977cc284b92771003b2070c440e0807c90e1eb0ff3e095911a820", + "https://deno.land/std@0.115.1/path/mod.ts": "4465dc494f271b02569edbb4a18d727063b5dbd6ed84283ff906260970a15d12", + "https://deno.land/std@0.115.1/path/posix.ts": "34349174b9cd121625a2810837a82dd8b986bbaaad5ade690d1de75bbb4555b2", + "https://deno.land/std@0.115.1/path/separator.ts": "8fdcf289b1b76fd726a508f57d3370ca029ae6976fcde5044007f062e643ff1c", + "https://deno.land/std@0.115.1/path/win32.ts": "11549e8c6df8307a8efcfa47ad7b2a75da743eac7d4c89c9723a944661c8bd2e", + "https://deno.land/std@0.119.0/_util/assert.ts": "2f868145a042a11d5ad0a3c748dcf580add8a0dbc0e876eaa0026303a5488f58", + "https://deno.land/std@0.119.0/_util/os.ts": "dfb186cc4e968c770ab6cc3288bd65f4871be03b93beecae57d657232ecffcac", + "https://deno.land/std@0.119.0/fmt/colors.ts": "8368ddf2d48dfe413ffd04cdbb7ae6a1009cf0dccc9c7ff1d76259d9c61a0621", + "https://deno.land/std@0.119.0/fs/empty_dir.ts": "5f08b263dd064dc7917c4bbeb13de0f5505a664b9cdfe312fa86e7518cfaeb84", + "https://deno.land/std@0.119.0/fs/expand_glob.ts": "f6f64ef54addcc84c9012d6dfcf66d39ecc2565e40c4d2b7644d585fe4d12a04", + "https://deno.land/std@0.119.0/fs/walk.ts": "31464d75099aa3fc7764212576a8772dfabb2692783e6eabb910f874a26eac54", + "https://deno.land/std@0.119.0/path/_constants.ts": "1247fee4a79b70c89f23499691ef169b41b6ccf01887a0abd131009c5581b853", + "https://deno.land/std@0.119.0/path/_interface.ts": "1fa73b02aaa24867e481a48492b44f2598cd9dfa513c7b34001437007d3642e4", + "https://deno.land/std@0.119.0/path/_util.ts": "2e06a3b9e79beaf62687196bd4b60a4c391d862cfa007a20fc3a39f778ba073b", + "https://deno.land/std@0.119.0/path/common.ts": "f41a38a0719a1e85aa11c6ba3bea5e37c15dd009d705bd8873f94c833568cbc4", + "https://deno.land/std@0.119.0/path/glob.ts": "ea87985765b977cc284b92771003b2070c440e0807c90e1eb0ff3e095911a820", + "https://deno.land/std@0.119.0/path/mod.ts": "4465dc494f271b02569edbb4a18d727063b5dbd6ed84283ff906260970a15d12", + "https://deno.land/std@0.119.0/path/posix.ts": "34349174b9cd121625a2810837a82dd8b986bbaaad5ade690d1de75bbb4555b2", + "https://deno.land/std@0.119.0/path/separator.ts": "8fdcf289b1b76fd726a508f57d3370ca029ae6976fcde5044007f062e643ff1c", + "https://deno.land/std@0.119.0/path/win32.ts": "11549e8c6df8307a8efcfa47ad7b2a75da743eac7d4c89c9723a944661c8bd2e", + "https://deno.land/x/code_block_writer@11.0.0/comment_char.ts": "22b66890bbdf7a2d59777ffd8231710c1fda1c11fadada67632a596937a1a314", + "https://deno.land/x/code_block_writer@11.0.0/mod.ts": "dc43d56c3487bae02886a09754fb09c607da4ea866817e80f3e60632f3391d70", + "https://deno.land/x/code_block_writer@11.0.0/utils/string_utils.ts": "60cb4ec8bd335bf241ef785ccec51e809d576ff8e8d29da43d2273b69ce2a6ff", + "https://deno.land/x/deno_cache@0.2.1/auth_tokens.ts": "01b94d25abd974153a3111653998b9a43c66d84a0e4b362fc5f4bbbf40a6e0f7", + "https://deno.land/x/deno_cache@0.2.1/cache.ts": "67e301c20161546fea45405316314f4c3d85cc7a367b2fb72042903f308f55b7", + "https://deno.land/x/deno_cache@0.2.1/deno_dir.ts": "e4dc68da5641aa337bcc06fb1df28fcb086b366dcbea7d8aaed7ac7c853fedb1", + "https://deno.land/x/deno_cache@0.2.1/deps.ts": "2ebaba0ad86fff8b9027c6afd4c3909a17cd8bf8c9e263151c980c15c56a18ee", + "https://deno.land/x/deno_cache@0.2.1/dirs.ts": "e07003fabed7112375d4a50040297aae768f9d06bb6c2655ca46880653b576b4", + "https://deno.land/x/deno_cache@0.2.1/disk_cache.ts": "d7a361f0683a032bcca28513a7bbedc28c77cfcc6719e6f6cea156c0ff1108df", + "https://deno.land/x/deno_cache@0.2.1/file_fetcher.ts": "352702994c190c45215f3b8086621e117e88bc2174b020faefb5eca653d71d6a", + "https://deno.land/x/deno_cache@0.2.1/http_cache.ts": "af1500149496e2d0acadec24569e2a9c86a3f600cceef045dcf6f5ce8de72b3a", + "https://deno.land/x/deno_cache@0.2.1/mod.ts": "709ab9d1068be5fd77b020b33e7a9394f1e9b453553b1e2336b72c90283cf3c0", + "https://deno.land/x/deno_cache@0.2.1/util.ts": "652479928551259731686686ff2df6f26bc04e8e4d311137b2bf3bc10f779f48", + "https://deno.land/x/deno_graph@0.6.0/lib/deno_graph.generated.js": "3e1cccd6376d4ad0ea789d66aa0f6b19f737fa8da37b5e6185ef5c269c974f54", + "https://deno.land/x/deno_graph@0.6.0/lib/loader.ts": "13a11c1dea0d85e0ad211be77217b8c06138bbb916afef6f50a04cca415084a9", + "https://deno.land/x/deno_graph@0.6.0/lib/media_type.ts": "36be751aa63d6ae36475b90dca5fae8fd7c3a77cf13684c48cf23a85ee607b31", + "https://deno.land/x/deno_graph@0.6.0/lib/snippets/deno_graph-1c138d6136337537/src/deno_apis.js": "f13f2678d875372cf8489ceb7124623a39fa5bf8de8ee1ec722dbb2ec5ec7845", + "https://deno.land/x/deno_graph@0.6.0/lib/types.d.ts": "68cb232e02a984658b40ffaf6cafb979a06fbfdce7f5bd4c7a83ed1a32a07687", + "https://deno.land/x/deno_graph@0.6.0/mod.ts": "8fe3d39bdcb273adfb41a0bafbbaabec4c6fe6c611b47fed8f46f218edb37e8e", + "https://deno.land/x/dnt@0.17.0/lib/compiler.ts": "b741c149adaa3ed87877324ce4365fbb66e8ecbfb5bc417495dcb1ac2936f9ff", + "https://deno.land/x/dnt@0.17.0/lib/compiler_transforms.ts": "b14a398776f08d57a3a011c8c4b5a6a557032c4b125264f86f7877d3f0eef657", + "https://deno.land/x/dnt@0.17.0/lib/mod.deps.ts": "d6c6eb09013c471584bc271261ed896d9f0f6552620ac7d1d65cb46e57841236", + "https://deno.land/x/dnt@0.17.0/lib/npm_ignore.ts": "36fe32008cd71e995bc08569d2b43e8fba816cbada82fa37d1fe52358d5a2e17", + "https://deno.land/x/dnt@0.17.0/lib/package_json.ts": "c8ea56c948fa2379de2a1cf76d335d1b1c70a8c122e1d11932a84f4b70905275", + "https://deno.land/x/dnt@0.17.0/lib/pkg/dnt_wasm.js": "fc7ae54f777566ef7769825491cb868da9f92ec4453326c075ce1b3b2bdf06f3", + "https://deno.land/x/dnt@0.17.0/lib/pkg/dnt_wasm_bg.ts": "51742660365970445ca1e010d340085c7b1188166cc7cdb0d2ba72b3328f276d", + "https://deno.land/x/dnt@0.17.0/lib/pkg/snippets/dnt-wasm-a15ef721fa5290c5/helpers.js": "2f623f83602d4fbb30caa63444b10e35b45e9c2b267e49585ec9bb790a4888d8", + "https://deno.land/x/dnt@0.17.0/lib/shims.ts": "f9f7defa1cadaec4f04f47ac62757ffa47f83b4a5825fe68cbbfcf14086fcce7", + "https://deno.land/x/dnt@0.17.0/lib/test_runner/get_test_runner_code.ts": "5fe5543c8479b5f17c58db4d994de3f3d573e3ca7e4c32c7cf8e338e8e900ba7", + "https://deno.land/x/dnt@0.17.0/lib/test_runner/test_runner.ts": "fc93277907a49bdc098237619da7ff6898547f6f25b71c026375a81efbc8907b", + "https://deno.land/x/dnt@0.17.0/lib/transform.deps.ts": "0b86d5ad77af5b53ad72308fbf5b694abea1f0593652a662be7529ae60c540cb", + "https://deno.land/x/dnt@0.17.0/lib/types.ts": "8506b5ced3921a6ac2a1d5a2bb381bfdbf818c68207f14a1a1fffbf48ee95886", + "https://deno.land/x/dnt@0.17.0/lib/utils.ts": "d2681d634dfa6bd4ad2a32ad15bd419f6f1f895e06c0bf479455fbf1c5f49cd9", + "https://deno.land/x/dnt@0.17.0/mod.ts": "1cd16a64fa1861d624d6e9e02eaa0dfa733f8e2101686fb90e05bbb96ce5221d", + "https://deno.land/x/dnt@0.17.0/transform.ts": "0b1dc1fdf860b594fb50a3aee54bc8c22220f4601f1d227f4113b9b4c0c5166f", + "https://deno.land/x/ts_morph@13.0.0/bootstrap/mod.ts": "b53aad517f106c4079971fcd4a81ab79fadc40b50061a3ab2b741a09119d51e9", + "https://deno.land/x/ts_morph@13.0.0/bootstrap/ts_morph_bootstrap.d.ts": "1dd46307a28a8e689ce214cb0fe260a280e7ecbaceb6fbae3cbcaa8a25a9fd3f", + "https://deno.land/x/ts_morph@13.0.0/bootstrap/ts_morph_bootstrap.js": "5b0c39c5a35d1445bfccfda2a31bf6235e269aacc304b2c6f21ec6fb3c346b26", + "https://deno.land/x/ts_morph@13.0.0/common/DenoRuntime.ts": "b9ac7200ac980c1aea503cf8302e6581c8ddcdc3dbca850d0dd5a43969d7d16e", + "https://deno.land/x/ts_morph@13.0.0/common/mod.ts": "01985d2ee7da8d1caee318a9d07664774fbee4e31602bc2bb6bb62c3489555ed", + "https://deno.land/x/ts_morph@13.0.0/common/ts_morph_common.d.ts": "32345569d0356af0870227ca7cbc61a25d7f5e9e6b47ec2b3dca267f8f711840", + "https://deno.land/x/ts_morph@13.0.0/common/ts_morph_common.js": "7a63dede12ac30195099f42a07f8ae139799738351ed66e34d872e842d2ca687", + "https://deno.land/x/ts_morph@13.0.0/common/typescript.d.ts": "bbfbfa714a8f9fdf10e9483b4abd82ccb546fc0fc069ad80d0a254fa40930e98", + "https://deno.land/x/ts_morph@13.0.0/common/typescript.js": "dca27ae23ee7eaa46a03e7e7216755186a4c5aff76273e0a66d30358be0e121b" + } +} diff --git a/lerna.json b/lerna.json index 5761cd3..23576d1 100644 --- a/lerna.json +++ b/lerna.json @@ -3,7 +3,7 @@ "packages": [ "packages/*" ], - "version": "0.7.5", + "version": "0.7.6", "granularPathspec": false, "forcePublish": true, "command": { diff --git a/main/hooks/src/base.ts b/main/hooks/src/base.ts index 971938a..6abfb9c 100644 --- a/main/hooks/src/base.ts +++ b/main/hooks/src/base.ts @@ -10,7 +10,7 @@ export type HookContextData = { [key: string]: any }; */ export class BaseHookContext { self?: C; - [key: string]: any + [key: string]: any; constructor(data: HookContextData = {}) { Object.assign(this, data); diff --git a/main/hooks/src/regular.ts b/main/hooks/src/regular.ts index 64b2f9c..b03d4c5 100644 --- a/main/hooks/src/regular.ts +++ b/main/hooks/src/regular.ts @@ -22,12 +22,11 @@ export const runHook = (hook: RegularMiddleware, context: any, type?: string) => }); }; -export const runHooks = (hooks: RegularMiddleware[]) => - (context: any) => - hooks.reduce( - (promise, hook) => promise.then(() => runHook(hook, context)), - Promise.resolve(context), - ); +export const runHooks = (hooks: RegularMiddleware[]) => (context: any) => + hooks.reduce( + (promise, hook) => promise.then(() => runHook(hook, context)), + Promise.resolve(context), + ); export function fromBeforeHook(hook: RegularMiddleware) { return (context: any, next: any) => { diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..0261706 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,10 @@ +{ + "name": "@feathersjs/hooks", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "@feathersjs/hooks" + } + } +}