Insane number of adds to setup env and packages
This commit is contained in:
8
node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/RandomIterator.d.ts
generated
vendored
Normal file
8
node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/RandomIterator.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { ContainerIterator } from "../../ContainerBase";
|
||||
export declare abstract class RandomIterator<T> extends ContainerIterator<T> {
|
||||
pre: () => this;
|
||||
next: () => this;
|
||||
get pointer(): T;
|
||||
set pointer(newValue: T);
|
||||
equals(obj: RandomIterator<T>): boolean;
|
||||
}
|
||||
87
node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/RandomIterator.js
generated
vendored
Normal file
87
node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/RandomIterator.js
generated
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
var __extends = this && this.t || function() {
|
||||
var extendStatics = function(t, r) {
|
||||
extendStatics = Object.setPrototypeOf || {
|
||||
__proto__: []
|
||||
} instanceof Array && function(t, r) {
|
||||
t.__proto__ = r;
|
||||
} || function(t, r) {
|
||||
for (var n in r) if (Object.prototype.hasOwnProperty.call(r, n)) t[n] = r[n];
|
||||
};
|
||||
return extendStatics(t, r);
|
||||
};
|
||||
return function(t, r) {
|
||||
if (typeof r !== "function" && r !== null) throw new TypeError("Class extends value " + String(r) + " is not a constructor or null");
|
||||
extendStatics(t, r);
|
||||
function __() {
|
||||
this.constructor = t;
|
||||
}
|
||||
t.prototype = r === null ? Object.create(r) : (__.prototype = r.prototype, new __);
|
||||
};
|
||||
}();
|
||||
|
||||
import { ContainerIterator } from "../../ContainerBase";
|
||||
|
||||
var RandomIterator = function(t) {
|
||||
__extends(RandomIterator, t);
|
||||
function RandomIterator(r, n, e, i, o) {
|
||||
var a = t.call(this, o) || this;
|
||||
a.D = r;
|
||||
a.I = n;
|
||||
a.g = e;
|
||||
a.R = i;
|
||||
if (a.iteratorType === 0) {
|
||||
a.pre = function() {
|
||||
if (this.D === 0) {
|
||||
throw new RangeError("Random iterator access denied!");
|
||||
}
|
||||
this.D -= 1;
|
||||
return this;
|
||||
};
|
||||
a.next = function() {
|
||||
if (this.D === this.I()) {
|
||||
throw new RangeError("Random Iterator access denied!");
|
||||
}
|
||||
this.D += 1;
|
||||
return this;
|
||||
};
|
||||
} else {
|
||||
a.pre = function() {
|
||||
if (this.D === this.I() - 1) {
|
||||
throw new RangeError("Random iterator access denied!");
|
||||
}
|
||||
this.D += 1;
|
||||
return this;
|
||||
};
|
||||
a.next = function() {
|
||||
if (this.D === -1) {
|
||||
throw new RangeError("Random iterator access denied!");
|
||||
}
|
||||
this.D -= 1;
|
||||
return this;
|
||||
};
|
||||
}
|
||||
return a;
|
||||
}
|
||||
Object.defineProperty(RandomIterator.prototype, "pointer", {
|
||||
get: function() {
|
||||
if (this.D < 0 || this.D > this.I() - 1) {
|
||||
throw new RangeError;
|
||||
}
|
||||
return this.g(this.D);
|
||||
},
|
||||
set: function(t) {
|
||||
if (this.D < 0 || this.D > this.I() - 1) {
|
||||
throw new RangeError;
|
||||
}
|
||||
this.R(this.D, t);
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
RandomIterator.prototype.equals = function(t) {
|
||||
return this.D === t.D;
|
||||
};
|
||||
return RandomIterator;
|
||||
}(ContainerIterator);
|
||||
|
||||
export { RandomIterator };
|
||||
44
node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/index.d.ts
generated
vendored
Normal file
44
node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
import { Container } from "../../ContainerBase";
|
||||
declare abstract class SequentialContainer<T> extends Container<T> {
|
||||
/**
|
||||
* @description Push the element to the back.
|
||||
* @param element The element you want to push.
|
||||
*/
|
||||
abstract pushBack(element: T): void;
|
||||
/**
|
||||
* @description Removes the last element.
|
||||
*/
|
||||
abstract popBack(): void;
|
||||
/**
|
||||
* @description Sets element by position.
|
||||
* @param pos The position you want to change.
|
||||
* @param element The element's value you want to update.
|
||||
*/
|
||||
abstract setElementByPos(pos: number, element: T): void;
|
||||
/**
|
||||
* @description Removes the elements of the specified value.
|
||||
* @param value The value you want to remove.
|
||||
*/
|
||||
abstract eraseElementByValue(value: T): void;
|
||||
/**
|
||||
* @description Insert several elements after the specified position.
|
||||
* @param pos The position you want to insert.
|
||||
* @param element The element you want to insert.
|
||||
* @param num The number of elements you want to insert (default 1).
|
||||
*/
|
||||
abstract insert(pos: number, element: T, num?: number): void;
|
||||
/**
|
||||
* @description Reverses the container.
|
||||
*/
|
||||
abstract reverse(): void;
|
||||
/**
|
||||
* @description Removes the duplication of elements in the container.
|
||||
*/
|
||||
abstract unique(): void;
|
||||
/**
|
||||
* @description Sort the container.
|
||||
* @param cmp Comparison function.
|
||||
*/
|
||||
abstract sort(cmp?: (x: T, y: T) => number): void;
|
||||
}
|
||||
export default SequentialContainer;
|
||||
32
node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/index.js
generated
vendored
Normal file
32
node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/index.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
var __extends = this && this.t || function() {
|
||||
var extendStatics = function(n, t) {
|
||||
extendStatics = Object.setPrototypeOf || {
|
||||
__proto__: []
|
||||
} instanceof Array && function(n, t) {
|
||||
n.__proto__ = t;
|
||||
} || function(n, t) {
|
||||
for (var e in t) if (Object.prototype.hasOwnProperty.call(t, e)) n[e] = t[e];
|
||||
};
|
||||
return extendStatics(n, t);
|
||||
};
|
||||
return function(n, t) {
|
||||
if (typeof t !== "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
|
||||
extendStatics(n, t);
|
||||
function __() {
|
||||
this.constructor = n;
|
||||
}
|
||||
n.prototype = t === null ? Object.create(t) : (__.prototype = t.prototype, new __);
|
||||
};
|
||||
}();
|
||||
|
||||
import { Container } from "../../ContainerBase";
|
||||
|
||||
var SequentialContainer = function(n) {
|
||||
__extends(SequentialContainer, n);
|
||||
function SequentialContainer() {
|
||||
return n !== null && n.apply(this, arguments) || this;
|
||||
}
|
||||
return SequentialContainer;
|
||||
}(Container);
|
||||
|
||||
export default SequentialContainer;
|
||||
Reference in New Issue
Block a user