%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/share/nodejs/arrify/
Upload File :
Create Path :
Current File : //usr/share/nodejs/arrify/index.js

'use strict';

const arrify = value => {
	if (value === null || value === undefined) {
		return [];
	}

	if (Array.isArray(value)) {
		return value;
	}

	if (typeof value === 'string') {
		return [value];
	}

	if (typeof value[Symbol.iterator] === 'function') {
		return [...value];
	}

	return [value];
};

module.exports = arrify;

Zerion Mini Shell 1.0