Socket
Book a DemoInstallSign in
Socket

yield-list

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yield-list

creat a doubly linked list, using a simple comands. and have a iterator map too!

0.7.0
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

yield-list

creat a doubly linked list, using a simple comands. and have a iterator map too!

I will help if you have any difficulty =)

Contact me by github:heyderpd. I'll be glad to help you.

Thanks for npm~lucasmreis

Example:

import yieldList from 'yield-list'

// create from array
const Arr = [1, 2, 3]
const list = yieldList(Arr)

// create using push
const a = {a: 1}
const b = {b: 2}
const c = {c: 2}
const list = yieldList()
list
  .push(a)
  .push(b)
  .push(c)

// maps!
// [{a: 1}, {b: 2}, {c: 3}]
const arr = list.map()
// [{c: 3}, {b: 2}, {a: 1}] // No need reverse the array! It's a direct map.
const arr = list.map.reverse()

// return a generator function
// function will apply by item
// do a map useind 'yield' by item
iterator = list.map.yield()

iterator.next().value // {a: 1}
iterator.next().value // {b: 2}
iterator.next().value // {c: 3}

// can make a circular array!
iterator = list.map.yield.circular()

Keywords

list

FAQs

Package last updated on 18 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.