MCPcopy Create free account
hub / github.com/conventional-changelog/commitlint / execute

Function execute

@commitlint/execute-rule/src/index.ts:9–19  ·  view source on GitHub ↗
(rule?: Rule<T>)

Source from the content-addressed store, hash-verified

7export default execute;
8
9export async function execute<T = unknown>(rule?: Rule<T>): Promise<ExecutedRule<T> | null> {
10 if (!Array.isArray(rule)) {
11 return null;
12 }
13
14 const [name, config] = rule;
15
16 const fn = executable(config) ? config : async () => config;
17
18 return [name, await fn()];
19}
20
21function executable<T>(config: Config<T>): config is ExectableConfig<T> {
22 return typeof config === "function";

Callers 1

index.test.tsFile · 0.85

Calls 2

executableFunction · 0.85
fnFunction · 0.85

Tested by

no test coverage detected