Skip to content

Commit caeead2

Browse files
authored
chore: re-export hooks utils to predicates & transformers (#17)
* chore: re-export hooks utils to predicates & transformers * chore: rm predicates from main export & add see url
1 parent ecf8474 commit caeead2

33 files changed

+96
-20
lines changed

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v22.19.0
1+
v24.13.0

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"@feathersjs/socketio-client": "^5.0.37",
9797
"@shikijs/vitepress-twoslash": "^3.21.0",
9898
"@tailwindcss/vite": "^4.1.18",
99-
"@tsconfig/node22": "^22.0.5",
99+
"@tsconfig/node24": "^24.0.4",
100100
"@types/lodash": "^4.17.23",
101101
"@types/markdown-it": "^14.1.2",
102102
"@types/node": "^25.0.10",
@@ -107,7 +107,7 @@
107107
"gray-matter": "^4.0.3",
108108
"lru-cache": "^11.2.5",
109109
"markdown-it": "^14.1.0",
110-
"npm-check-updates": "^19.3.1",
110+
"npm-check-updates": "^19.3.2",
111111
"prettier": "^3.8.1",
112112
"shx": "^0.4.0",
113113
"sift": "^17.1.3",

pnpm-lock.yaml

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/hooks/cache/cache.hook.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ export type CacheOptions = {
3131
transformParams: (params: Params) => Params
3232
}
3333

34+
/**
35+
* A hook to cache `get` and `find` method results based on `params`.
36+
*
37+
* @see https://utils.feathersjs.com/hooks/cache.html
38+
*/
3439
export const cache = <H extends HookContext = HookContext>(
3540
options: CacheOptions,
3641
) => {

src/hooks/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export * from './set-data/set-data.hook.js'
1616
export * from './set-field/set-field.hook.js'
1717
export * from './set-result/set-result.hook.js'
1818
export * from './set-slug/set-slug.hook.js'
19-
export * from './skippable/skippable.js'
19+
export * from './skippable/skippable.hook.js'
2020
export * from './soft-delete/soft-delete.hook.js'
2121
export * from './stash-before/stash-before.hook.js'
2222
export * from './throw-if-is-multi/throw-if-is-multi.hook.js'
File renamed without changes.

src/hooks/skippable/skippable.test.ts renamed to src/hooks/skippable/skippable.hook.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { shouldSkip } from '../../predicates/should-skip/should-skip.predicate.js'
2-
import { skippable } from './skippable.js'
2+
import { skippable } from './skippable.hook.js'
33

44
describe('skippable', () => {
55
it('runs hook when not skipped', async () => {
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import type { HookFunction, PredicateFn } from '../../types.js'
33

44
/**
55
* Wrap a hook to make it skippable
6+
*
7+
* @see https://utils.feathersjs.com/hooks/skippable.html
68
*/
79
export const skippable =
810
<H extends HookContext = HookContext>(

src/hooks/transform-query/transform-query.hook.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import type { TransformerFn } from '../../types.js'
33

44
/**
55
* Transforms the query object.
6+
*
7+
* @see https://utils.feathersjs.com/hooks/transform-query.html
68
*/
79
export const transformQuery = <
810
Q extends Query,

src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export * from './hooks/index.js'
22
export * from './utils/index.js'
3-
export * from './predicates/index.js'
43

54
export * from './types.js'
65
export * from './utility-types/index.js'

0 commit comments

Comments
 (0)