UNPKG

pragmatic-fp-ts

Version:

Opinionated functional programming library with easy use in mind

14 lines (13 loc) 443 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.drop = void 0; const main_1 = require("./main"); function drop(n, coll) { if (arguments.length === 1) { return (theColl) => drop(n, theColl); } const theColl = (0, main_1.getValueOr)([], coll); const toDrop = (0, main_1.clamp)(0, theColl.length, (0, main_1.getValueOr)(0, n)); return theColl.slice(toDrop); } exports.drop = drop;