How to use the is-lite.array function in is-lite

To help you get started, we’ve selected a few is-lite examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gilbarbara / react-joyride / src / modules / helpers.js View on Github external
export function hasValidKeys(value: Object, keys: Array): boolean {
  if (!is.plainObject(value) || !is.array(keys)) {
    return false;
  }

  return Object.keys(value).every(d => keys.includes(d));
}
github gilbarbara / react-joyride / src / modules / step.js View on Github external
export function validateSteps(steps: Array, debug: boolean = false): boolean {
  if (!is.array(steps)) {
    log({
      title: 'validateSteps',
      data: 'steps must be an array',
      warn: true,
      debug,
    });

    return false;
  }

  return steps.every(d => validateStep(d, debug));
}

is-lite

A tiny javascript type testing tool

MIT
Latest version published 5 months ago

Package Health Score

69 / 100
Full package analysis