How to use the krl-stdlib/types.isFunction function in krl-stdlib

To help you get started, we’ve selected a few krl-stdlib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Picolab / pico-engine / packages / pico-engine-core / src / index.js View on Github external
var applyFn = cocb.wrap(function*(fn, ctx, args){
    if(ktypes.isAction(fn)){
        throw new Error("actions can only be called in the rule action block");
    }
    if( ! ktypes.isFunction(fn)){
        throw new Error("Not a function");
    }
    return yield fn(ctx, args);
});
github Picolab / pico-engine / packages / pico-engine-core / src / index.js View on Github external
var applyFn = cocb.wrap(function*(fn, ctx, args){
    if(ktypes.isAction(fn)){
        throw new Error("actions can only be called in the rule action block");
    }
    if( ! ktypes.isFunction(fn)){
        throw new Error("Not a function");
    }
    return yield fn(ctx, args);
});