Permalink
Cannot retrieve contributors at this time
22 lines (18 sloc)
725 Bytes
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
codeql-action/node_modules/array.prototype.flat/implementation.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var ArraySpeciesCreate = require('es-abstract/2022/ArraySpeciesCreate'); | |
var FlattenIntoArray = require('es-abstract/2022/FlattenIntoArray'); | |
var Get = require('es-abstract/2022/Get'); | |
var ToIntegerOrInfinity = require('es-abstract/2022/ToIntegerOrInfinity'); | |
var ToLength = require('es-abstract/2022/ToLength'); | |
var ToObject = require('es-abstract/2022/ToObject'); | |
module.exports = function flat() { | |
var O = ToObject(this); | |
var sourceLen = ToLength(Get(O, 'length')); | |
var depthNum = 1; | |
if (arguments.length > 0 && typeof arguments[0] !== 'undefined') { | |
depthNum = ToIntegerOrInfinity(arguments[0]); | |
} | |
var A = ArraySpeciesCreate(O, 0); | |
FlattenIntoArray(A, O, sourceLen, 0, depthNum); | |
return A; | |
}; |