Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 511 Bytes

README.md

File metadata and controls

24 lines (16 loc) · 511 Bytes

cloak documentation

FAQs/Pitfalls

What happens if I never called cloak.when?

The default condition for all cloaking functions is true.

Why am I getting an error about the callstack being exceeded?

This happens when you reference the cloaked function in your cloaking function, causing a circular reference. Example of this error:

function myLogFn(){
    console.log('Hi');
}

cloak(console, 'log').cloakWith(myLogFn);

console.log('test');