MCPcopy
hub / github.com/smapiot/piral / withPiralRule

Function withPiralRule

src/tooling/piral-cli/src/api.ts:103–113  ·  view source on GitHub ↗
(name: string, run: RuleRunner<PiralRuleContext>)

Source from the content-addressed store, hash-verified

101}
102
103export function withPiralRule(name: string, run: RuleRunner<PiralRuleContext>) {
104 if (typeof name !== 'string') {
105 log('apiValidateNameInvalid_0202', 'Piral');
106 } else if (typeof run !== 'function') {
107 log('apiValidateRunInvalid_0203', 'Piral');
108 } else {
109 addPiralRule({ name, run });
110 }
111
112 return this;
113}
114
115export function withPiletRule(name: string, run: RuleRunner<PiletRuleContext>) {
116 if (typeof name !== 'string') {

Callers

nothing calls this directly

Calls 2

logFunction · 0.90
addPiralRuleFunction · 0.90

Tested by

no test coverage detected