Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@thi.ng/dcons

Package Overview
Dependencies
Maintainers
1
Versions
306
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@thi.ng/dcons - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

4

index.d.ts

@@ -1,2 +0,2 @@

import * as api from "@thi.ng/api";
import * as api from "@thi.ng/api/api";
export interface ConsCell<T> {

@@ -25,3 +25,3 @@ value: T;

insertAfterNth(n: number, x: T): DCons<T>;
insertSorted(value: T, compare?: (a: T, b: T) => number): DCons<T>;
insertSorted(value: T, cmp?: api.Comparator<T>): DCons<T>;
find(value: T): ConsCell<T>;

@@ -28,0 +28,0 @@ findWith(fn: (value: T) => boolean): ConsCell<T>;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const api = require("@thi.ng/api");
const checks_1 = require("@thi.ng/checks");
const compare_1 = require("@thi.ng/api/compare");
const equiv_1 = require("@thi.ng/api/equiv");
const is_arraylike_1 = require("@thi.ng/checks/is-arraylike");
class DCons {

@@ -42,3 +43,3 @@ constructor(src) {

while (ca && res == 0) {
res = api.compare(ca.value, cb.value);
res = compare_1.compare(ca.value, cb.value);
ca = ca.next;

@@ -51,6 +52,6 @@ cb = cb.next;

equiv(o) {
if ((o instanceof DCons || checks_1.isArrayLike(o)) && this._length === o.length) {
if ((o instanceof DCons || is_arraylike_1.isArrayLike(o)) && this._length === o.length) {
let cell = this.head;
for (let x of o) {
if (!api.equiv(cell.value, x)) {
if (!equiv_1.equiv(cell.value, x)) {
return false;

@@ -154,7 +155,7 @@ }

}
insertSorted(value, compare) {
compare = compare || api.compare;
insertSorted(value, cmp) {
cmp = cmp || compare_1.compare;
let cell = this.head;
while (cell) {
if (compare(value, cell.value) <= 0) {
if (cmp(value, cell.value) <= 0) {
return this.insertBefore(cell, value);

@@ -161,0 +162,0 @@ }

{
"name": "@thi.ng/dcons",
"version": "0.1.2",
"version": "0.1.3",
"description": "Comprehensive doubly linked list structure w/ iterator support",

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

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