mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
31 lines
631 B
JavaScript
31 lines
631 B
JavaScript
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var flatMapMethod = Array.prototype.flatMap;
|
|
/* eslint-disable no-redeclare */
|
|
// $FlowFixMe
|
|
|
|
var flatMap = flatMapMethod ? function (list, fn) {
|
|
return flatMapMethod.call(list, fn);
|
|
} : function (list, fn) {
|
|
var result = [];
|
|
|
|
for (var _i2 = 0; _i2 < list.length; _i2++) {
|
|
var _item = list[_i2];
|
|
var value = fn(_item);
|
|
|
|
if (Array.isArray(value)) {
|
|
result = result.concat(value);
|
|
} else {
|
|
result.push(value);
|
|
}
|
|
}
|
|
|
|
return result;
|
|
};
|
|
var _default = flatMap;
|
|
exports.default = _default;
|