How to use the @politie/sherlock.unwrap function in @politie/sherlock

To help you get started, we’ve selected a few @politie/sherlock 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 politie / sherlock / extensions / sherlock-utils / src / template.ts View on Github external
return derive(() => {
        let s = '';
        for (let i = 0; i < parts.length; i++) {
            s += parts[i];
            if (i < args.length) {
                s += unwrap(args[i]);
            }
        }
        return s;
    });
}
github politie / sherlock / extensions / sherlock-utils / src / static-boolean-funcs.ts View on Github external
return (...args: Array | V>) => derive(() => {
        let value: V | undefined;
        for (const arg of args) {
            value = unwrap(arg);
            if (breakOn(value)) {
                break;
            }
        }
        return value!;
    });
}