Files
utilities/README.md
T
2020-03-06 08:38:41 +01:00

280 B

Utilities

General helper functions

const util = require('@scode/utilities');

// cut off decimal places to a specified point
util.truncate_decimal(12.345678, 2);
// returns 12.34

// will return null instead of throwing on invalid json
util.try_parse_json('{{foo');