mirror of
https://github.com/swc-project/swc.git
synced 2024-12-26 15:12:08 +03:00
bbaf619f63
swc_bundler: - [x] Fix wrapped esms. (denoland/deno#9307) - [x] Make test secure.
35 lines
773 B
TypeScript
35 lines
773 B
TypeScript
// Loaded from https://deno.land/x/ramda@v0.27.2/source/internal/_concat.js
|
|
|
|
|
|
/**
|
|
* Private `concat` function to merge two array-like objects.
|
|
*
|
|
* @private
|
|
* @param {Array|Arguments} [set1=[]] An array-like object.
|
|
* @param {Array|Arguments} [set2=[]] An array-like object.
|
|
* @return {Array} A new, merged array.
|
|
* @example
|
|
*
|
|
* _concat([4, 5, 6], [1, 2, 3]); //=> [4, 5, 6, 1, 2, 3]
|
|
*/
|
|
export default function _concat(set1, set2) {
|
|
set1 = set1 || [];
|
|
set2 = set2 || [];
|
|
var idx;
|
|
var len1 = set1.length;
|
|
var len2 = set2.length;
|
|
var result = [];
|
|
|
|
idx = 0;
|
|
while (idx < len1) {
|
|
result[result.length] = set1[idx];
|
|
idx += 1;
|
|
}
|
|
idx = 0;
|
|
while (idx < len2) {
|
|
result[result.length] = set2[idx];
|
|
idx += 1;
|
|
}
|
|
return result;
|
|
}
|