2020-03-10 10:51:01 +01:00
2020-03-04 12:13:28 +01:00
2020-03-14 14:12:44 +01:00
2020-03-04 12:13:28 +01:00
2020-03-10 10:46:12 +01:00
2020-03-04 12:13:28 +01:00
2020-03-04 12:13:28 +01:00
2020-03-14 14:12:44 +01:00
2020-03-10 10:46:12 +01:00
2020-03-14 14:12:44 +01:00
2020-03-24 09:40:03 +01:00

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');

// copy an object to prevent modification of the original
const obj = {foo:'bar'};
const copy = util.copy_object(obj);
copy.foo = 'baz';
console.log(obj.foo); // bar
Description
No description provided
Readme 357 KiB
Languages
JavaScript 100%