MOON
Server: Apache
System: Linux server.royaltuning.hu 4.18.0-425.13.1.el8_7.x86_64 #1 SMP Tue Feb 21 04:20:52 EST 2023 x86_64
User: royaltuning (1001)
PHP: 8.2.31
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/royaltuning/www/public/backoffice.royaltuning.hu/node_modules/type/array/is.js
"use strict";

var isPrototype = require("../prototype/is");

var isArray;
if (typeof Array.isArray === "function") {
	isArray = Array.isArray;
} else {
	var objectToString = Object.prototype.toString, objectTaggedString = objectToString.call([]);
	isArray = function (value) { return objectToString.call(value) === objectTaggedString; };
}

module.exports = function (value) {
	if (!isArray(value)) return false;

	// Sanity check (reject objects which do not expose common Array interface)
	if (!hasOwnProperty.call(value, "length")) return false;
	try {
		if (typeof value.length !== "number") return false;
		if (typeof value.push !== "function") return false;
		if (typeof value.splice !== "function") return false;
	} catch (error) {
		return false;
	}

	return !isPrototype(value);
};