0.2.0 • Published 2 years ago

@me5on/to v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

TO

something

A small utility library for converting values from something TO something else

Examples

const emptyString = TO.str(null);
const oneAsString = TO.string(1);

const number = TO.number('1234');
const infinity = TO.num(Infinity);
const nan = TO.num('invalid');

const numBool = TO.bool(number);
const infBool = TO.bul(infinity);
const nanBool = TO.boolean(nan);

console.log(
  emptyString,          // ""
  oneAsString,          // "1"
  typeof oneAsString,   // "string"

  number,               // 1234
  typeof number,        // "number"
  nan,                  // NaN
  infinity,             // Infinity

  numBool,              // true
  infBool,              // true
  nanBool,              // false
);
0.2.0

2 years ago

0.1.0

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago