makePolicyDefinition
makePolicyDefinition<
C>(args):PolicyDefinition<C>
Defined in: makePolicy.ts:252
Creates a PolicyDefinition from the provided arguments.
Type Parameters
Section titled “Type Parameters”C = undefined
Parameters
Section titled “Parameters”Policy metadata, handler, optional resolver, and defaults.
Returns
Section titled “Returns”A file-policy definition.
Example
Section titled “Example”const MyPolicy = makePolicyDefinition({ name: "MyPolicy", description: "Ensures files follow conventions", match: /\.ts$/, handler: async ({ file }) => true,});