# @sullux/fp-light-skip

> A lightweight functional library for functional composition and object composition.

Latest version **0.0.1** (published 2019-02-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install @sullux/fp-light-skip
pnpm add @sullux/fp-light-skip
yarn add @sullux/fp-light-skip
bun add @sullux/fp-light-skip
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2019-02-25 |
| First published | 2019-02-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.* |
| Dependencies | 0 |
| Unpacked size | 2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Charles Sullivan |
| Maintainers | sullux |
| Keywords | fp, functional, skip |

## Links

- npm: https://www.npmjs.com/package/@sullux/fp-light-skip
- Repository: https://github.com/sullux/fp-light
- Homepage: https://github.com/Sullux/fp-light/blob/master/lib/skip/README.md
- Issues: https://github.com/sullux/fp-light/issues
- npm.io page: https://npm.io/package/@sullux/fp-light-skip

## Recent versions

- 0.0.1 (latest) — 2019-02-25

## README

[home](https://github.com/Sullux/fp-light/blob/master/README.md)

## fp-light-skip

`npm i @sullux/fp-light-skip`
[source](https://github.com/Sullux/fp-light/blob/master/lib/skip/skip.js)
[test](https://github.com/Sullux/fp-light/blob/master/lib/skip/skip.spec.js)

Creates an iterable that skips the first _n_ items of the given iterable.

* [skip](#skip)

### skip

`skip<T>(count: number, iterable: Iterable<T>): Iterable<T>`

If `count` is less than 1, yields all items; otherwise, skips `count` items. If count is greater than the number of items in the iterable, returns an empty iterable.

```javascript
const { skip } = require('./skip')
const { deepStrictEqual } = require('assert')

describe('skip', () => {
  it('should skip zero', () => deepStrictEqual(
    [...skip(0, [1, 2, 3])],
    [1, 2, 3]
  ))
  it('should skip zero with negative skip', () => deepStrictEqual(
    [...skip(-1, [1, 2, 3])],
    [1, 2, 3]
  ))
  it('should skip n values', () => deepStrictEqual(
    [...skip(1, [1, 2, 3])],
    [2, 3]
  ))
  it('should return empty skipping length', () => deepStrictEqual(
    [...skip(3, [1, 2, 3])],
    []
  ))
  it('should return empty skipping greater than length', () => deepStrictEqual(
    [...skip(4, [1, 2, 3])],
    []
  ))
})
```

---
_Source: https://npm.io/package/@sullux/fp-light-skip · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
