UNPKG

dashp

Version:

Utilities for monadic promises.

22 lines (18 loc) 517 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _is = require("./is"); // Flattens an array of arrays into an array. It only flattens one level deep, // which is what is required by flatmap. var _default = xxs => { const result = []; if (xxs == null) return result; xxs.forEach(xs => { if ((0, _is.isArray)(xs)) result.push(...xs);else result.push(xs); }); return result; }; exports.default = _default; //# sourceMappingURL=flatten.js.map