How to use the array function from is

Find comprehensive JavaScript is.array code examples handpicked from public code repositorys.

79
80
81
82
83
84
85
86
87
88
if (target === copy) {
  continue;
}

// Recurse if we're merging plain objects or arrays
if (deep && copy && (is.hash(copy) || (copyIsArray = is.array(copy)))) {
  if (copyIsArray) {
    copyIsArray = false;
    clone = src && is.array(src) ? src : [];
  } else {
fork icon21
star icon128
watch icon12

+ 3 other calls in file

49
50
51
52
53
54
55
56
57
58
if (target === copy) {
  continue;
}

// Recurse if we're merging plain objects or arrays
if (deep && copy && (is.hash(copy) || (copy_is_array = is.array(copy)))) {
  if (copy_is_array) {
    copy_is_array = false;
    clone = src && is.array(src) ? src : [];
  } else {
fork icon12
star icon3
watch icon5

+ 15 other calls in file

22
23
24
25
26
27
28
29
30
31
var random = require('lodash.random');
var is = require('is');
var isNumber = is.number;
var isObject = is.object;
var isString = is.string;
var isArray = is.array;
var isNull = is.null;
var isFunction = is.function;

function Fuzzer() { }
fork icon557
star icon0
watch icon3

16
17
18
19
20
21
22
23
24
25
let pathArr = [ filepath, path.join(option.view || this.app.baseDir, filepath) ];
if (is.function(this.remoteAsset)) {
  pathArr.push(await this.remoteAsset(filepath));
}

if (option.extensions && is.array(option.extensions)) {
  const pathArrExt = [];

  pathArr.forEach(v => {
    option.extensions.forEach(
fork icon275
star icon0
watch icon97

+ 3 other calls in file

175
176
177
178
179
180
181
182
183
    var f = exports.string(opts);
    f.parse = function (raw_data) {
        if (typeof raw_data === 'undefined') {
            return [];
        }
        return is.array(raw_data) ? raw_data : [raw_data];
    };
    return f;
};
fork icon170
star icon0
watch icon29

+ 27 other calls in file

125
126
127
128
129
130
131
132
133
134
}

// Private
// -------
function createKey(self, id, ancestors, namespace) {
    const hasAncestors = typeof ancestors !== 'undefined' && ancestors !== null && is.array(ancestors);

    /*
    /* Create copy of ancestors to avoid mutating the Array
    */
fork icon49
star icon0
watch icon1

60
61
62
63
64
65
66
67
68
69
 * @private
 * @hideconstructor
 * @param {...string|string[]} segments - Sequence of parts of a path.
 */
constructor(segments) {
  segments = is.array(segments)
    ? segments
    : Array.prototype.slice.call(arguments);

  /**
fork icon151
star icon0
watch icon2

+ 3 other calls in file

58
59
60
61
62
63
64
65
66
67
case 'datetime':
    valid = isValidDate(value);
    ref = 'datetime.base';
    break;
case 'array':
    valid = is.array(value);
    ref = 'array.base';
    break;
case 'number':
case 'int': {
fork icon50
star icon0
watch icon1

50
51
52
53
54
55
56
57
58
59
filter(params, filterArr) {
    if (IS.object(params) && IS.array(filterArr)) {
        let data = {};
        filterArr.forEach(e => {
            let val = params[e];
            if (!IS.undefined(val) && !IS.null(val) && !IS.empty(val) || IS.array.empty(val)) {
                data[e] = val;
            }
        });
        return data;
fork icon25
star icon50
watch icon2

+ 3 other calls in file

30
31
32
33
34
35
36
37
38
39
} else if((args.length == 1 || args.length == 3 || args.length == 4) && is.number(args[0])) {
  for(i=0;i<args.length;i++) {
    if(!is.number(args[i])) throw new TypeError("Invalid argument type. Expected all to be numbers.");
    this.channels.push(args[i]);
  }
} else if(args.length == 1 && is.array(args[0])) {
  this.channels = slice(args[0]);
} else {
  console.log(args);
  throw new TypeError("Argument type unsupported for now");
fork icon0
star icon6
watch icon3

+ 3 other calls in file