UNPKG

@codeparticle/formal

Version:

A <2kb library for validating data of any kind

1 lines 622 B
{"version":3,"sources":["../src/rules/is-equal-to.ts"],"sourcesContent":["/**\n * Validator to ensure that this value is equivalent to another that may or may not be available\n * at time of definition.\n */\n\nimport { createRule } from '../rule'\n\nconst isEqualTo = (value) =>\n createRule({\n condition: (val) =>\n typeof value === `function` ? val === value() : val === value,\n message: () => `Values must be equal`,\n })\n\nexport { isEqualTo }\n"],"mappings":";;;;;AAOA,IAAM,YAAY,CAAC,UACjB,WAAW;AAAA,EACT,WAAW,CAAC,QACV,OAAO,UAAU,aAAa,QAAQ,MAAM,IAAI,QAAQ;AAAA,EAC1D,SAAS,MAAM;AACjB,CAAC;","names":[]}