Installations
npm install @jacobbubu/yallist
Score
71.8
Supply Chain
98.9
Quality
75
Maintenance
100
Vulnerability
100
License
Developer
jacobbubu
Developer Guide
Module System
CommonJS
Min. Node Version
>=6.0.0
Typescript Support
No
Node Version
10.18.0
NPM Version
6.13.4
Statistics
2 Commits
2 Watching
18 Branches
1 Contributors
Updated on 28 Dec 2019
Languages
TypeScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
423
Last day
0%
1
Compared to previous day
Last week
0%
2
Compared to previous week
Last month
50%
3
Compared to previous month
Last year
-55.3%
46
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
31
@jacobbubu/yallist
Rewritten isaacs's yallist in typescript for learning purposes.
original readme with minor updates
Yet Another Linked List
There are many doubly-linked list implementations like it, but this one is mine.
For when an array would be too big, and a Map can't be iterated in reverse order.
basic usage
1import { Yallist } from '@jacobbubu/yallist' 2const myList = new Yallist.create([1, 2, 3]) 3myList.push('foo') 4myList.unshift('bar') 5// of course pop() and shift() are there, too 6console.log(myList.toArray()) // ['bar', 1, 2, 3, 'foo'] 7myList.forEach(function(k) { 8 // walk the list head to tail 9}) 10myList.forEachReverse(function(k, index, list) { 11 // walk the list tail to head 12}) 13const myDoubledList = myList.map(function(k) { 14 return k + k 15}) 16// now myDoubledList contains ['barbar', 2, 4, 6, 'foofoo'] 17// mapReverse is also a thing 18const myDoubledListReverse = myList.mapReverse(function(k) { 19 return k + k 20}) // ['foofoo', 6, 4, 2, 'barbar'] 21 22const reduced = myList.reduce(function(set, entry) { 23 set += entry 24 return set 25}, 'start') 26console.log(reduced) // 'startfoo123bar'
api
The whole API is considered "public".
Functions with the same name as an Array method work more or less the same way.
There's reverse versions of most things because that's the point.
Yallist
Call it with either a forEach-able (like an array) or a set of arguments, to initialize the list.
The Array-ish methods all act like you'd expect. No magic length, though, so if you change that it won't automatically prune or add empty spots.
yallist.head
The first node in the list
yallist.tail
The last node in the list
yallist.length
The number of nodes in the list. (Change this at your peril. It is not magic like Array length.)
yallist.toArray()
Convert the list to an array.
yallist.forEach(fn, [thisp])
Call a function on each item in the list.
yallist.forEachReverse(fn, [thisp])
Call a function on each item in the list, in reverse order.
yallist.get(n)
Get the data at position n
in the list. If you use this a lot,
probably better off just using an Array.
yallist.getReverse(n)
Get the data at position n
, counting from the tail.
yallist.map(fn, thisp)
Create a new Yallist with the result of calling the function on each item.
yallist.mapReverse(fn, thisp)
Same as map
, but in reverse.
yallist.pop()
Get the data from the list tail, and remove the tail from the list.
yallist.push(item, ...)
Insert one or more items to the tail of the list.
yallist.reduce(fn, initialValue)
Like Array.reduce.
yallist.reduceReverse
Like Array.reduce, but in reverse.
yallist.reverse
Reverse the list in place.
yallist.shift()
Get the data from the list head, and remove the head from the list.
yallist.slice([from], [to])
Just like Array.slice, but returns a new Yallist.
yallist.sliceReverse([from], [to])
Just like yallist.slice, but the result is returned in reverse.
yallist.toArray()
Create an array representation of the list.
yallist.toArrayReverse()
Create a reversed array representation of the list.
yallist.unshift(item, ...)
Insert one or more items to the head of the list.
yallist.unshiftNode(node)
Move a Node object to the front of the list. (That is, pull it out of wherever it lives, and make it the new head.)
If the node belongs to a different list, then that list will remove it first.
yallist.pushNode(node)
Move a Node object to the end of the list. (That is, pull it out of wherever it lives, and make it the new tail.)
If the node belongs to a list already, then that list will remove it first.
yallist.removeNode(node)
Remove a node from the list, preserving referential integrity of head and tail and other nodes.
Will throw an error if you try to have a list remove a node that doesn't belong to it.
Yallist.Node
The class that holds the data and is actually the list.
Call with var n = new Node(value, previousNode, nextNode)
Note that if you do direct operations on Nodes themselves, it's very easy to get into weird states where the list is broken. Be careful :)
node.next
The next node in the list.
node.prev
The previous node in the list.
node.value
The data the node contains.
node.list
The list to which this node belongs. (Null if it does not belong to any list.)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
Found 0/2 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
73 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-6chw-6frg-f759
- Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm
- Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3
- Warn: Project is vulnerable to: MAL-2023-462
- Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6
- Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97
- Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f
- Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p
- Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv
- Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8
- Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65
- Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh
- Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44
- Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988
- Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj
- Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j
- Warn: Project is vulnerable to: GHSA-x55w-vjjp-222r
- Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37
- Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp
- Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj
- Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf
- Warn: Project is vulnerable to: GHSA-4xcv-9jjx-gfj3
- Warn: Project is vulnerable to: GHSA-7wpw-2hjm-89gp
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m / GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-w7rc-rwvf-8q5r
- Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g
- Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p
- Warn: Project is vulnerable to: GHSA-px4h-xg32-q955
- Warn: Project is vulnerable to: GHSA-93f3-23rq-pjfp
- Warn: Project is vulnerable to: GHSA-jmqm-f2gx-4fjv
- Warn: Project is vulnerable to: GHSA-pw54-mh39-w3hc / GHSA-xgh6-85xh-479p
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-r2j6-p67h-q639
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-44c6-4v22-4mhx
- Warn: Project is vulnerable to: GHSA-4x5v-gmq8-25ch
- Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6
- Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj
- Warn: Project is vulnerable to: GHSA-vx3p-948g-6vhq
- Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9
- Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw
- Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc
- Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh
- Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v
- Warn: Project is vulnerable to: GHSA-38fc-wpqx-33j7
- Warn: Project is vulnerable to: GHSA-v4rh-8p82-6h5w
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
- Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
- Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh
- Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp
Score
1.7
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More