How to use isarray - 5 common examples

To help you get started, we’ve selected a few isarray 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 matthewwithanm / react-controllables / src / index.js View on Github external
function createStateManager(propsOrStateManager) {
  // We've already got them!
  if (!isArray(propsOrStateManager)) return propsOrStateManager;

  // Build them from an array of controllable props.
  return {
    reducers: propsOrStateManager.reduce((reducers, prop) => {
      const callbackName = toCallbackName(prop);
      reducers[callbackName] = (currentState, value) => ({[prop]: value});
      return reducers;
    }, {}),
  };
}
github liferay / liferay-amd-loader / src / packages / isobject@1.0.0 / index.js View on Github external
exports.default = function(x) {
		console.log('Calling isObject 1.0.0');
		return x != null && typeof x === 'object' && !isArray(x);
	};
});
github liferay / liferay-amd-loader / src / demo / packages / isobject@1.0.0 / index.js View on Github external
exports.default = function(x) {
		console.log('Calling isObject 1.0.0');
		return x != null && typeof x === 'object' && !isArray(x);
	};
});
github liferay / liferay-blade-samples / gradle / apps / npm / simple-npm-portlet / src / main / resources / META-INF / resources / lib / index.es.js View on Github external
export default function() {
	var t;

	out.innerHTML += 'Calling isArray([])';
	t = isArray([]);
	out.innerHTML += ' -> returns ' + t + '.\n';

	out.innerHTML += 'Calling isArray({})';
	t = isArray({});
	out.innerHTML += ' -> returns ' + t + '.\n';
}
github iopipe / iopipe-js-trace / src / plugins / https.js View on Github external
Object.keys(data.headers || {}).forEach(k => {
    if (isArray(data.headers[k])) {
      data.headers[k].forEach((innerHeaderValue, index) => {
        data.headers[`${k}.${index}`] = innerHeaderValue;
      });
    }
  });

isarray

Array#isArray for older browsers

MIT
Latest version published 5 years ago

Package Health Score

78 / 100
Full package analysis

Popular isarray functions