js-nykros-utils

Nykros´s JavaScript general purpose helper utilities.

Usage no npm install needed!

<script type="module">
  import jsNykrosUtils from 'https://cdn.skypack.dev/js-nykros-utils';
</script>

README

js-nykros-utils

Nykros´s JavaScript general purpose helper utilities.

Instalation

npm install js-nykros-utils --save

Contains

  • isEmpty(value): Returns true when the given value is empty, (it is null, undefined, "" or {}).
  • isObject(value): Returns true if the value is a JavaScript object
  • isTrue(value): Returns true if value is the "true" string
  • omitKeys(obj, keysToOmit): Given an object and an array of strings, return a new object where the properties named like the strings are gone.
  • filterKeys(obj, predicate): Filter the properties of an object according a predicate over the property name.
  • moveItemUp(array, index): Moves the i-th item of the array to position (i-1).
  • moveItemDown(array, index): Moves the i-th item of the array to position (i+1).
  • range(min, max, step = 1): Generates an array [min.. max] with the given step.
  • delay(ms): Awaits for ms miliseconds.