Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 | 1x 251x 251x 251x 1x | import { HookContext } from "@feathersjs/feathers"; const getModelName = (modelName: string | ((context: HookContext) => string), context: HookContext): string => { Iif (modelName === undefined) { return context.path; } Iif (typeof modelName === "string") { return modelName; } Eif (typeof modelName === "function") { return modelName(context); } throw new Error("feathers-casl: 'modelName' is not a string or function"); }; export default getModelName; |