Applies stringTransform if the argument is a string, and otherTransform if it is not.
stringTransform
otherTransform
import * as G from "flurp/guard";import * as S from "flurp/string";import * as L from "flurp/logic";const lengthOrZero = G.ifIsString(S.length, L.always(0));lengthOrZero("50"); // 2lengthOrZero(50); // 0
Applies
stringTransform
if the argument is a string, andotherTransform
if it is not.Example