declapract
Version:
A tool to declaratively define best practices, maintainable evolve them, and scalably enforce them.
27 lines (26 loc) • 1.09 kB
TypeScript
/**
* .what = checks if a version string is a linked dependency version
* .why = linked versions (link:.) indicate the repo IS the package,
* so they satisfy any minVersion check by definition
*/
export declare const isLinkedDependencyVersion: (input: {
value: unknown;
}) => boolean;
/**
* grabs the `x.y.z` part from strings that match the shape `@declapract{check.minVersion('x.y.z')}`
*
* returns null if no match
*/
export declare const getMinVersionFromCheckMinVersionExpression: (value: string) => string | null;
/**
* checks whether the string matches the form "@declapract{check.minVersion('x.y.z')}" (with nothing before and nothing after, too)
*/
export declare const isCheckMinVersionExpression: (value: string) => boolean;
/**
* .what = evaluates a foundValue against a minVersion, to check if it passes it or not
* .why = enables validation of package versions against minimum requirements
*/
export declare const checkDoesFoundValuePassesMinVersionCheck: ({ foundValue, minVersion, }: {
foundValue: any;
minVersion: string;
}) => boolean;