How to use the tiny-types.isString function in tiny-types

To help you get started, weā€™ve selected a few tiny-types 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 jan-molak / serenity-js / packages / core / src / model / Photo.ts View on Github external
constructor(public readonly value: Base64EncodedString) {
        super();
        ensure(Photo.name, value, isDefined(), isString(), looksLikeBase64Encoded());
    }
}
github jan-molak / serenity-js / packages / core / src / model / tags / Tag.ts View on Github external
static fromJSON(o: JSONObject) {
        const type: string = ensure('serialised tag type', o.type, isDefined(), isString()) as string;

        const found = Object.keys(TagTypes).find(t => TagTypes[t].Type === type) || TagTypes.ArbitraryTag.name;

        return new TagTypes[found](o.name);
    }