New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@datastructures-js/linked-list

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@datastructures-js/linked-list - npm Package Compare versions

Comparing version 1.0.1 to 1.0.3

10

index.js

@@ -19,2 +19,7 @@ /**

/**
* @return {string|number}
*/
const getValue = () => value;
/**
* @param {object} - node

@@ -27,7 +32,2 @@ */

/**
* @return {string|number}
*/
const getValue = () => value;
/**
* @return {object} - node

@@ -34,0 +34,0 @@ */

@@ -44,5 +44,4 @@ const { expect } = require('chai');

describe('.count()', () =>
it('should get the count of nodes in the list', () => {
expect(ll.count()).to.equal(8);
}));
it('should get the count of nodes in the list', () =>
expect(ll.count()).to.equal(8)));

@@ -54,3 +53,3 @@ describe('.head()', () =>

describe('.toArray()', () =>
it('should convert the linkedList to array in same order', () => {
it('should convert the linkedList to array in same order', () =>
expect(ll.toArray()).to.deep.equal([

@@ -65,4 +64,3 @@ 'test 8',

'test 4'
]);
}));
])));

@@ -69,0 +67,0 @@ describe('.traverse(cb)', () =>

{
"name": "@datastructures-js/linked-list",
"version": "1.0.1",
"version": "1.0.3",
"description": "linked list implementation in javascript",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -7,4 +7,6 @@ # @datastrucures-js/linked-list

elements data type: number, string, boolean, null, undefined.
node's data type: **number**, **string**, **boolean**, **null**, **undefined**.
<img width="429" alt="ll" src="https://user-images.githubusercontent.com/6517308/35762715-5d00c9bc-0861-11e8-88f7-6e503a1fa3af.png">
## Usage

@@ -18,11 +20,10 @@ ```js

<img width="429" alt="ll" src="https://user-images.githubusercontent.com/6517308/35762715-5d00c9bc-0861-11e8-88f7-6e503a1fa3af.png">
**.node(value)**
**.node(value)**
creates a linked list node with a given value. The node object exposes the following functions:
* .setNext(node) sets the next linkedListNode object.
* .getNext() gets the next linkedListNode object.
* .setValue(value) sets the value of the node.
* .getValue() gets the value of the node
* **.setNext(node)** sets the next linkedListNode object.
* **.getNext()** gets the next linkedListNode object.
* **.setValue(value)** sets the value of the node.
* **.getValue() gets** the value of the node

@@ -78,3 +79,3 @@ ```javascript

```javascript
let n3 = linkedList.find('n3');
const n3 = linkedList.find('n3');
console.log(n3.getValue()); // n3

@@ -88,3 +89,3 @@ console.log(n3.getNext().getValue()); // n4

```javascript
let head = linkedList.head();
const head = linkedList.head();
console.log(head.getValue()); // n1

@@ -91,0 +92,0 @@ ```

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc