Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

datalist-interface

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

datalist-interface - npm Package Compare versions

Comparing version
2.0.0
to
2.1.0
+35
-11
index.d.ts

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

export class DatalistInterface {
/**
* A basic interface for a list.
*
* @template Item
*/
export class DatalistInterface<Item> {
/**

@@ -6,39 +11,58 @@ * Create a new data list.

*
* @constructor
* @param {Iterable} values
* @param {Item[]} values
*/
constructor(values: Iterable<any>)
constructor(values: Item[])
values: any[]
/**
* Add all arguments.
*
* @param {Item[]} values
* @return {this}
*/
add(...args: any[]): DatalistInterface
add(...values: Item[]): this
/**
* Remove all arguments.
*
* @param {Item[]} values
* @return {this}
*/
remove(...args: any[]): DatalistInterface
remove(...values: Item[]): this
/**
* Check whether `value` is in this list.
*
* @param {Item} value
* @return {boolean}
*/
is(value: any): boolean
is(value: Item): boolean
/**
* Check whether `value` is in this list.
*
* @param {Item} value
* @return {boolean}
*/
has(value: any): boolean
has(value: Item): boolean
/**
* Get all values.
*
* @return {Item[]}
*/
all(): any[]
all(): Item[]
/**
* Get all values.
*
* @return {Item[]}
*/
valueOf(): any[]
valueOf(): Item[]
/**
* Get all values.
*
* @return {Item[]}
*/
toJSON(): any[]
toJSON(): Item[]
/**
* Serialize all values.
*
* @return {string}
*/
toString(): string
}

@@ -0,1 +1,6 @@

/**
* A basic interface for a list.
*
* @template Item
*/
export class DatalistInterface {

@@ -6,4 +11,3 @@ /**

*
* @constructor
* @param {Iterable} values
* @param {Item[]} values
*/

@@ -17,5 +21,8 @@ constructor(values) {

* Add all arguments.
*
* @param {Item[]} values
* @return {this}
*/
add(/* values... */) {
this.values.push(...arguments)
add(...values) {
this.values.push(...values)
return this

@@ -26,9 +33,12 @@ }

* Remove all arguments.
*
* @param {Item[]} values
* @return {this}
*/
remove(/* values... */) {
var index = arguments.length
remove(...values) {
var index = values.length
var position
while (index--) {
position = this.values.indexOf(arguments[index])
position = this.values.indexOf(values[index])

@@ -45,2 +55,5 @@ if (position !== -1) {

* Check whether `value` is in this list.
*
* @param {Item} value
* @return {boolean}
*/

@@ -53,2 +66,5 @@ is(value) {

* Check whether `value` is in this list.
*
* @param {Item} value
* @return {boolean}
*/

@@ -61,2 +77,4 @@ has(value) {

* Get all values.
*
* @return {Item[]}
*/

@@ -69,2 +87,4 @@ all() {

* Get all values.
*
* @return {Item[]}
*/

@@ -77,2 +97,4 @@ valueOf() {

* Get all values.
*
* @return {Item[]}
*/

@@ -85,2 +107,4 @@ toJSON() {

* Serialize all values.
*
* @return {string}
*/

@@ -87,0 +111,0 @@ toString() {

{
"name": "datalist-interface",
"version": "2.0.0",
"version": "2.1.0",
"description": "Simple interface for a list functioning as a database",

@@ -5,0 +5,0 @@ "license": "MIT",