1.1.1 • Published 4 years ago

@isaacadams/extensions v1.1.1

Weekly downloads
7
License
ISC
Repository
github
Last release
4 years ago

extensions

Build Status Coverage Status

helpful extensions methods for javascript objects

Arrays

[ 1, 3, 5, 8, 21 ].take(3); // returns [ 1, 3, 5]
[ 1, 3, 5, 8, 21 ].takeFromEnd(2); // returns [ 8, 21 ]
[ 1, 3, 5, 8, 21 ].takeRandomly(4); // returns an array of length 4 with randomly selected items from the original array

Strings

"".isNullOrWhitespace(); // returns true
"   ".isNullOrWhitespace(); // returns true
"hello world".isNullOrWhitespace(); // returns false

fs

/// if the directory at the given path already exists, this function will return true
/// if the directory & subdirectories do not exist, this function will create them and return true
/// if anything goes wrong, it will return false
let result = fs.ensureDirectoryExists('./path/to/directory'); // returns true/false
1.1.1

4 years ago

1.1.0

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago