How to use the typical.isArrayLike function in typical

To help you get started, we’ve selected a few typical 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 75lb / array-tools / dist / array-tools.js View on Github external
function arrayify(any){
    if (any === undefined){
        return [];
    } else if (t.isArrayLike(any)){
        return Array.prototype.slice.call(any);
    } else {
        return Array.isArray(any) ? any : [ any ];
    }
}
github 75lb / array-back / index.js View on Github external
function arrayify (input) {
  const t = require('typical')
  if (Array.isArray(input)) {
    return input
  } else {
    if (input === undefined) {
      return []
    } else if (t.isArrayLike(input)) {
      return Array.prototype.slice.call(input)
    } else {
      return [ input ]
    }
  }
}
github 75lb / array-tools / dist / array-tools.js View on Github external
function arrayify(any){
    if (any === null || any === undefined){
        return [];
    } else if (t.isArrayLike(any)){
        return Array.prototype.slice.call(any);
    } else {
        return Array.isArray(any) ? any : [ any ];
    }
}

typical

Isomorphic, functional type-checking for Javascript

MIT
Latest version published 2 months ago

Package Health Score

74 / 100
Full package analysis