Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Ruby implementation of Doubly Linked List, following some Ruby idioms.
Add this line to your application's Gemfile:
gem 'linked-list'
And then execute:
$ bundle
Or install it yourself as:
$ gem install linked-list
object = Object.new # could be anything
list = LinkedList::List.new
list.push(object)
list << object # same as `push`
list.unshift(object)
list.pop
list.shift
list.insert(object, before: object)
list.insert(object, before: ->(n) { n == 'foo' })
list.insert(object, after: object)
list.insert(object, after: ->(n) { n == 'foo' })
list.insert_before(object, node)
list.insert_after(object, node)
list.reverse
list.reverse!
list.delete(object)
list.delete { |n| n == 'foo' }
list.delete_all(object)
list.delete_all { |n| n == 'foo' }
list.each # Enumerator object
list.each { |e| puts e }
list.reverse_each # Enumerator object
list.reverse_each { |e| puts e }
list.reverse_each_node # Enumerator object
list.reverse_each_node { |node| puts node.data }
list.first # head of the list
list.last # tail of the list
list.length
list.size # same as `length`
list.to_a
Another way to instantiate List
or Node
is to use conversion functions.
First, include LinkedList::Conversions
module to your class
class Foo
include LinkedList::Conversions
end
Now anywhere in your class you can use the following methods
Node(object) # will return new `Node` object
List(object) # will return new `List` object with one `Node` object
List([object, object]) # will return new `List` object with two `Node` objects
Please see LinkedList::List
, LinkedList::Node
, and
LinkedList::Conversions
for details.
Run test with
$ rake
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that linked-list demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.