JSV icon indicating copy to clipboard operation
JSV copied to clipboard

Add type coercion option

Open sgoumaz opened this issue 11 years ago • 1 comments

New environment option "typeCoercionFns" accepting an object with functions for coercing values to expected types (typically converting strings to booleans or numbers). The functions' names must match their corresponding type (e.g. "boolean" or "number").

See "Type Coercion Option" test at the end of tests/tests3.js for example usage.

This actually implements https://github.com/garycourt/JSV/issues/5.

sgoumaz avatar Apr 29 '13 10:04 sgoumaz

Note: please use ?w=1 in the URL when checking out the diff to ignore whitespace differences (some lines ending with spaces have been trimmed).

sgoumaz avatar Apr 29 '13 10:04 sgoumaz