npm i sagittarius-core
const random isEmpty =// Or install needed utils separately// const random = require('sagittarius-random')// check if argument is emptyconsole // true// get a random nrconsole
Or use via cdn:
See more utils in description below
- random: Random number generation from range
- uniqueId: Generates a unique ID. If
prefixis given, the ID is appended to it.
- range: Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. A step of -1 is used if a negative start is specified without an end or step. If end is not specified, it's set to start with start then set to 0.
- isEmpty: Check if provided argument is empty
- has: Checks if path is a direct property of provided argument.
- toNumber: Transform provided argument to number
- toPath: Transform provided argument to a property path array
- uniq: Filter and return uniq values from an array
- get: Gets the value at path of provided argument. If the resolved value is undefined, the defaultValue is returned in its place.
- difference: Compare 2 arguments and return the difference. The order and references of result values are determined by the first argument.
- debounce: Creates a debounced function that delays invoking
waitmilliseconds have elapsed since the last time the debounced function was invoked.
- set: Sets the value at path of provided argument. If a portion of path doesn't exist, it's created. Return true or false if value is set with success.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D