- Complete React app with 7 developer tools - JSON Tool with visual structured editor - Serialize Tool with visual structured editor - URL, Base64, CSV/JSON, Beautifier, Diff tools - Responsive navigation with dropdown menu - Dark/light mode toggle - Mobile-responsive design with sticky header - All tools working with copy/paste functionality
24 lines
773 B
JavaScript
24 lines
773 B
JavaScript
'use strict';
|
|
var isArray = require('../internals/is-array');
|
|
var isConstructor = require('../internals/is-constructor');
|
|
var isObject = require('../internals/is-object');
|
|
var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
|
|
var SPECIES = wellKnownSymbol('species');
|
|
var $Array = Array;
|
|
|
|
// a part of `ArraySpeciesCreate` abstract operation
|
|
// https://tc39.es/ecma262/#sec-arrayspeciescreate
|
|
module.exports = function (originalArray) {
|
|
var C;
|
|
if (isArray(originalArray)) {
|
|
C = originalArray.constructor;
|
|
// cross-realm fallback
|
|
if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined;
|
|
else if (isObject(C)) {
|
|
C = C[SPECIES];
|
|
if (C === null) C = undefined;
|
|
}
|
|
} return C === undefined ? $Array : C;
|
|
};
|