@js-sdsl/ordered-map
Advanced tools
Comparing version 4.2.0 to 4.3.0
@@ -7,2 +7,12 @@ # Change Log | ||
## [4.3.0] - 2023.01.20 | ||
### Added | ||
- Add public member `container` to `Iterator` which means the container that the iterator pointed to. | ||
### Changed | ||
- Reimplement `Queue`, separate `Queue` from `Deque`. | ||
## [4.2.0] - 2022.11.20 | ||
@@ -9,0 +19,0 @@ |
@@ -10,2 +10,6 @@ /** | ||
/** | ||
* @description The container pointed to by the iterator. | ||
*/ | ||
abstract readonly container: Container<T>; | ||
/** | ||
* @description Iterator's type. | ||
@@ -199,10 +203,6 @@ * @example | ||
*/ | ||
type initContainer<T> = ({ | ||
size: number; | ||
} | { | ||
length: number; | ||
} | { | ||
size(): number; | ||
}) & { | ||
forEach(callback: (element: T) => void): void; | ||
type initContainer<T> = { | ||
size?: number | (() => number); | ||
length?: number; | ||
forEach: (callback: (el: T) => void) => void; | ||
}; | ||
@@ -213,2 +213,3 @@ declare abstract class TreeIterator<K, V> extends ContainerIterator<K | [ | ||
]> { | ||
abstract readonly container: TreeContainer<K, V>; | ||
/** | ||
@@ -293,3 +294,38 @@ * @description Get the sequential index of the iterator in the tree container.<br/> | ||
} | ||
declare const enum TreeNodeColor { | ||
RED = 1, | ||
BLACK = 0 | ||
} | ||
declare class TreeNode<K, V> { | ||
_color: TreeNodeColor; | ||
_key: K | undefined; | ||
_value: V | undefined; | ||
_left: TreeNode<K, V> | undefined; | ||
_right: TreeNode<K, V> | undefined; | ||
_parent: TreeNode<K, V> | undefined; | ||
constructor(key?: K, value?: V); | ||
/** | ||
* @description Get the pre node. | ||
* @returns TreeNode about the pre node. | ||
*/ | ||
_pre(): TreeNode<K, V>; | ||
/** | ||
* @description Get the next node. | ||
* @returns TreeNode about the next node. | ||
*/ | ||
_next(): TreeNode<K, V>; | ||
/** | ||
* @description Rotate left. | ||
* @returns TreeNode about moved to original position after rotation. | ||
*/ | ||
_rotateLeft(): TreeNode<K, V>; | ||
/** | ||
* @description Rotate right. | ||
* @returns TreeNode about moved to original position after rotation. | ||
*/ | ||
_rotateRight(): TreeNode<K, V>; | ||
} | ||
declare class OrderedMapIterator<K, V> extends TreeIterator<K, V> { | ||
container: OrderedMap<K, V>; | ||
constructor(node: TreeNode<K, V>, header: TreeNode<K, V>, container: OrderedMap<K, V>, iteratorType?: IteratorType); | ||
get pointer(): [ | ||
@@ -296,0 +332,0 @@ K, |
@@ -701,2 +701,6 @@ "use strict"; | ||
class OrderedMapIterator extends TreeIterator { | ||
constructor(t, e, s, i) { | ||
super(t, e, i); | ||
this.container = s; | ||
} | ||
get pointer() { | ||
@@ -721,3 +725,3 @@ if (this.O === this.R) { | ||
copy() { | ||
return new OrderedMapIterator(this.O, this.R, this.iteratorType); | ||
return new OrderedMapIterator(this.O, this.R, this.container, this.iteratorType); | ||
} | ||
@@ -741,12 +745,12 @@ } | ||
begin() { | ||
return new OrderedMapIterator(this.R.u || this.R, this.R); | ||
return new OrderedMapIterator(this.R.u || this.R, this.R, this); | ||
} | ||
end() { | ||
return new OrderedMapIterator(this.R, this.R); | ||
return new OrderedMapIterator(this.R, this.R, this); | ||
} | ||
rBegin() { | ||
return new OrderedMapIterator(this.R.l || this.R, this.R, 1); | ||
return new OrderedMapIterator(this.R.l || this.R, this.R, this, 1); | ||
} | ||
rEnd() { | ||
return new OrderedMapIterator(this.R, this.R, 1); | ||
return new OrderedMapIterator(this.R, this.R, this, 1); | ||
} | ||
@@ -765,15 +769,15 @@ front() { | ||
const e = this.K(this.m, t); | ||
return new OrderedMapIterator(e, this.R); | ||
return new OrderedMapIterator(e, this.R, this); | ||
} | ||
upperBound(t) { | ||
const e = this.U(this.m, t); | ||
return new OrderedMapIterator(e, this.R); | ||
return new OrderedMapIterator(e, this.R, this); | ||
} | ||
reverseLowerBound(t) { | ||
const e = this.j(this.m, t); | ||
return new OrderedMapIterator(e, this.R); | ||
return new OrderedMapIterator(e, this.R, this); | ||
} | ||
reverseUpperBound(t) { | ||
const e = this.q(this.m, t); | ||
return new OrderedMapIterator(e, this.R); | ||
return new OrderedMapIterator(e, this.R, this); | ||
} | ||
@@ -785,3 +789,3 @@ setElement(t, e, s) { | ||
const e = this.D(this.m, t); | ||
return new OrderedMapIterator(e, this.R); | ||
return new OrderedMapIterator(e, this.R, this); | ||
} | ||
@@ -788,0 +792,0 @@ getElementByKey(t) { |
@@ -10,2 +10,6 @@ /** | ||
/** | ||
* @description The container pointed to by the iterator. | ||
*/ | ||
abstract readonly container: Container<T>; | ||
/** | ||
* @description Iterator's type. | ||
@@ -199,10 +203,6 @@ * @example | ||
*/ | ||
type initContainer<T> = ({ | ||
size: number; | ||
} | { | ||
length: number; | ||
} | { | ||
size(): number; | ||
}) & { | ||
forEach(callback: (element: T) => void): void; | ||
type initContainer<T> = { | ||
size?: number | (() => number); | ||
length?: number; | ||
forEach: (callback: (el: T) => void) => void; | ||
}; | ||
@@ -213,2 +213,3 @@ declare abstract class TreeIterator<K, V> extends ContainerIterator<K | [ | ||
]> { | ||
abstract readonly container: TreeContainer<K, V>; | ||
/** | ||
@@ -293,3 +294,38 @@ * @description Get the sequential index of the iterator in the tree container.<br/> | ||
} | ||
declare const enum TreeNodeColor { | ||
RED = 1, | ||
BLACK = 0 | ||
} | ||
declare class TreeNode<K, V> { | ||
_color: TreeNodeColor; | ||
_key: K | undefined; | ||
_value: V | undefined; | ||
_left: TreeNode<K, V> | undefined; | ||
_right: TreeNode<K, V> | undefined; | ||
_parent: TreeNode<K, V> | undefined; | ||
constructor(key?: K, value?: V); | ||
/** | ||
* @description Get the pre node. | ||
* @returns TreeNode about the pre node. | ||
*/ | ||
_pre(): TreeNode<K, V>; | ||
/** | ||
* @description Get the next node. | ||
* @returns TreeNode about the next node. | ||
*/ | ||
_next(): TreeNode<K, V>; | ||
/** | ||
* @description Rotate left. | ||
* @returns TreeNode about moved to original position after rotation. | ||
*/ | ||
_rotateLeft(): TreeNode<K, V>; | ||
/** | ||
* @description Rotate right. | ||
* @returns TreeNode about moved to original position after rotation. | ||
*/ | ||
_rotateRight(): TreeNode<K, V>; | ||
} | ||
declare class OrderedMapIterator<K, V> extends TreeIterator<K, V> { | ||
container: OrderedMap<K, V>; | ||
constructor(node: TreeNode<K, V>, header: TreeNode<K, V>, container: OrderedMap<K, V>, iteratorType?: IteratorType); | ||
get pointer(): [ | ||
@@ -296,0 +332,0 @@ K, |
@@ -907,4 +907,6 @@ var extendStatics = function(e, r) { | ||
__extends(OrderedMapIterator, e); | ||
function OrderedMapIterator() { | ||
return e !== null && e.apply(this, arguments) || this; | ||
function OrderedMapIterator(r, t, i, n) { | ||
var s = e.call(this, r, t, n) || this; | ||
s.container = i; | ||
return s; | ||
} | ||
@@ -934,3 +936,3 @@ Object.defineProperty(OrderedMapIterator.prototype, "pointer", { | ||
OrderedMapIterator.prototype.copy = function() { | ||
return new OrderedMapIterator(this.M, this.j, this.iteratorType); | ||
return new OrderedMapIterator(this.M, this.j, this.container, this.iteratorType); | ||
}; | ||
@@ -975,12 +977,12 @@ return OrderedMapIterator; | ||
OrderedMap.prototype.begin = function() { | ||
return new OrderedMapIterator(this.j.h || this.j, this.j); | ||
return new OrderedMapIterator(this.j.h || this.j, this.j, this); | ||
}; | ||
OrderedMap.prototype.end = function() { | ||
return new OrderedMapIterator(this.j, this.j); | ||
return new OrderedMapIterator(this.j, this.j, this); | ||
}; | ||
OrderedMap.prototype.rBegin = function() { | ||
return new OrderedMapIterator(this.j.o || this.j, this.j, 1); | ||
return new OrderedMapIterator(this.j.o || this.j, this.j, this, 1); | ||
}; | ||
OrderedMap.prototype.rEnd = function() { | ||
return new OrderedMapIterator(this.j, this.j, 1); | ||
return new OrderedMapIterator(this.j, this.j, this, 1); | ||
}; | ||
@@ -999,15 +1001,15 @@ OrderedMap.prototype.front = function() { | ||
var r = this.R(this.N, e); | ||
return new OrderedMapIterator(r, this.j); | ||
return new OrderedMapIterator(r, this.j, this); | ||
}; | ||
OrderedMap.prototype.upperBound = function(e) { | ||
var r = this.G(this.N, e); | ||
return new OrderedMapIterator(r, this.j); | ||
return new OrderedMapIterator(r, this.j, this); | ||
}; | ||
OrderedMap.prototype.reverseLowerBound = function(e) { | ||
var r = this.q(this.N, e); | ||
return new OrderedMapIterator(r, this.j); | ||
return new OrderedMapIterator(r, this.j, this); | ||
}; | ||
OrderedMap.prototype.reverseUpperBound = function(e) { | ||
var r = this.D(this.N, e); | ||
return new OrderedMapIterator(r, this.j); | ||
return new OrderedMapIterator(r, this.j, this); | ||
}; | ||
@@ -1019,3 +1021,3 @@ OrderedMap.prototype.setElement = function(e, r, t) { | ||
var r = this.J(this.N, e); | ||
return new OrderedMapIterator(r, this.j); | ||
return new OrderedMapIterator(r, this.j, this); | ||
}; | ||
@@ -1022,0 +1024,0 @@ OrderedMap.prototype.getElementByKey = function(e) { |
/*! | ||
* @js-sdsl/ordered-map v4.2.0 | ||
* @js-sdsl/ordered-map v4.3.0 | ||
* https://github.com/js-sdsl/js-sdsl | ||
@@ -175,5 +175,2 @@ * (c) 2021-present ZLY201 <zilongyao1366@gmail.com> | ||
/** | ||
* @internal | ||
*/ | ||
var TreeNode = /** @class */function () { | ||
@@ -270,5 +267,2 @@ function TreeNode(key, value) { | ||
}(); | ||
/** | ||
* @internal | ||
*/ | ||
var TreeNodeEnableIndex = /** @class */function (_super) { | ||
@@ -995,6 +989,6 @@ __extends(TreeNodeEnableIndex, _super); | ||
*/ | ||
function TreeIterator(_node, _header, iteratorType) { | ||
function TreeIterator(node, header, iteratorType) { | ||
var _this = _super.call(this, iteratorType) || this; | ||
_this._node = _node; | ||
_this._header = _header; | ||
_this._node = node; | ||
_this._header = header; | ||
if (_this.iteratorType === 0 /* IteratorType.NORMAL */) { | ||
@@ -1076,4 +1070,6 @@ _this.pre = function () { | ||
__extends(OrderedMapIterator, _super); | ||
function OrderedMapIterator() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
function OrderedMapIterator(node, header, container, iteratorType) { | ||
var _this = _super.call(this, node, header, iteratorType) || this; | ||
_this.container = container; | ||
return _this; | ||
} | ||
@@ -1103,3 +1099,3 @@ Object.defineProperty(OrderedMapIterator.prototype, "pointer", { | ||
OrderedMapIterator.prototype.copy = function () { | ||
return new OrderedMapIterator(this._node, this._header, this.iteratorType); | ||
return new OrderedMapIterator(this._node, this._header, this.container, this.iteratorType); | ||
}; | ||
@@ -1154,13 +1150,13 @@ return OrderedMapIterator; | ||
OrderedMap.prototype.begin = function () { | ||
return new OrderedMapIterator(this._header._left || this._header, this._header); | ||
return new OrderedMapIterator(this._header._left || this._header, this._header, this); | ||
}; | ||
OrderedMap.prototype.end = function () { | ||
return new OrderedMapIterator(this._header, this._header); | ||
return new OrderedMapIterator(this._header, this._header, this); | ||
}; | ||
OrderedMap.prototype.rBegin = function () { | ||
return new OrderedMapIterator(this._header._right || this._header, this._header, 1 /* IteratorType.REVERSE */); | ||
return new OrderedMapIterator(this._header._right || this._header, this._header, this, 1 /* IteratorType.REVERSE */); | ||
}; | ||
OrderedMap.prototype.rEnd = function () { | ||
return new OrderedMapIterator(this._header, this._header, 1 /* IteratorType.REVERSE */); | ||
return new OrderedMapIterator(this._header, this._header, this, 1 /* IteratorType.REVERSE */); | ||
}; | ||
@@ -1180,15 +1176,15 @@ | ||
var resNode = this._lowerBound(this._root, key); | ||
return new OrderedMapIterator(resNode, this._header); | ||
return new OrderedMapIterator(resNode, this._header, this); | ||
}; | ||
OrderedMap.prototype.upperBound = function (key) { | ||
var resNode = this._upperBound(this._root, key); | ||
return new OrderedMapIterator(resNode, this._header); | ||
return new OrderedMapIterator(resNode, this._header, this); | ||
}; | ||
OrderedMap.prototype.reverseLowerBound = function (key) { | ||
var resNode = this._reverseLowerBound(this._root, key); | ||
return new OrderedMapIterator(resNode, this._header); | ||
return new OrderedMapIterator(resNode, this._header, this); | ||
}; | ||
OrderedMap.prototype.reverseUpperBound = function (key) { | ||
var resNode = this._reverseUpperBound(this._root, key); | ||
return new OrderedMapIterator(resNode, this._header); | ||
return new OrderedMapIterator(resNode, this._header, this); | ||
}; | ||
@@ -1212,3 +1208,3 @@ /** | ||
var curNode = this._findElementNode(this._root, key); | ||
return new OrderedMapIterator(curNode, this._header); | ||
return new OrderedMapIterator(curNode, this._header, this); | ||
}; | ||
@@ -1215,0 +1211,0 @@ /** |
/*! | ||
* @js-sdsl/ordered-map v4.2.0 | ||
* @js-sdsl/ordered-map v4.3.0 | ||
* https://github.com/js-sdsl/js-sdsl | ||
@@ -7,3 +7,3 @@ * (c) 2021-present ZLY201 <zilongyao1366@gmail.com> | ||
*/ | ||
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i((t="undefined"!=typeof globalThis?globalThis:t||self).sdsl={})}(this,function(t){"use strict";var e=function(t,i){return(e=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,i){t.__proto__=i}:function(t,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}))(t,i)};function i(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}function r(e,o){var n,h,s,u={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},f={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(f[Symbol.iterator]=function(){return this}),f;function t(r){return function(t){var i=[r,t];if(n)throw new TypeError("Generator is already executing.");for(;u=f&&i[f=0]?0:u;)try{if(n=1,h&&(s=2&i[0]?h.return:i[0]?h.throw||((s=h.return)&&s.call(h),0):h.next)&&!(s=s.call(h,i[1])).done)return s;switch(h=0,(i=s?[2&i[0],s.value]:i)[0]){case 0:case 1:s=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,h=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(s=0<(s=u.trys).length&&s[s.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!s||i[1]>s[0]&&i[1]<s[3]))u.label=i[1];else if(6===i[0]&&u.label<s[1])u.label=s[1],s=i;else{if(!(s&&u.label<s[2])){s[2]&&u.ops.pop(),u.trys.pop();continue}u.label=s[2],u.ops.push(i)}}i=o.call(e,u)}catch(t){i=[6,t],h=0}finally{n=s=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}}}function u(t){var i="function"==typeof Symbol&&Symbol.iterator,r=i&&t[i],e=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&e>=t.length?void 0:t)&&t[e++],done:!t}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(t,i){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var e,o,n=r.call(t),h=[];try{for(;(void 0===i||0<i--)&&!(e=n.next()).done;)h.push(e.value)}catch(t){o={error:t}}finally{try{e&&!e.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return h}h.prototype.v=function(){var t=this;if(1===t.t&&t.l.l===t)t=t.o;else if(t.h)for(t=t.h;t.o;)t=t.o;else{for(var i=t.l;i.h===t;)i=(t=i).l;t=i}return t},h.prototype.p=function(){var t=this;if(t.o){for(t=t.o;t.h;)t=t.h;return t}for(var i=t.l;i.o===t;)i=(t=i).l;return t.o!==i?i:t},h.prototype._=function(){var t=this.l,i=this.o,r=i.h;return t.l===this?t.l=i:t.h===this?t.h=i:t.o=i,i.l=t,(i.h=this).l=i,(this.o=r)&&(r.l=this),i},h.prototype.T=function(){var t=this.l,i=this.h,r=i.o;return t.l===this?t.l=i:t.h===this?t.h=i:t.o=i,i.l=t,(i.o=this).l=i,(this.h=r)&&(r.l=this),i};var n=h;function h(t,i){this.t=1,this.i=void 0,this.u=void 0,this.h=void 0,this.o=void 0,this.l=void 0,this.i=t,this.u=i}i(l,s=n),l.prototype._=function(){var t=s.prototype._.call(this);return this.C(),t.C(),t},l.prototype.T=function(){var t=s.prototype.T.call(this);return this.C(),t.C(),t},l.prototype.C=function(){this.O=1,this.h&&(this.O+=this.h.O),this.o&&(this.O+=this.o.O)};var s,f=l;function l(){var t=null!==s&&s.apply(this,arguments)||this;return t.O=1,t}p.prototype.equals=function(t){return this.I===t.I};var a=p;function p(t){this.iteratorType=t=void 0===t?0:t}function c(){this.M=0}Object.defineProperty(c.prototype,"length",{get:function(){return this.M},enumerable:!1,configurable:!0}),c.prototype.size=function(){return this.M},c.prototype.empty=function(){return 0===this.M};i(d,y=c);var y,v=d;function d(){return null!==y&&y.apply(this,arguments)||this}function S(){throw new RangeError("Iterator access denied!")}i(w,g=v),w.prototype.R=function(t,i){for(var r=this.S;t;){var e=this.N(t.i,i);if(e<0)t=t.o;else{if(!(0<e))return t;t=(r=t).h}}return r},w.prototype.G=function(t,i){for(var r=this.S;t;)t=this.N(t.i,i)<=0?t.o:(r=t).h;return r},w.prototype.q=function(t,i){for(var r=this.S;t;){var e=this.N(t.i,i);if(e<0)t=(r=t).o;else{if(!(0<e))return t;t=t.h}}return r},w.prototype.D=function(t,i){for(var r=this.S;t;)t=this.N(t.i,i)<0?(r=t).o:t.h;return r},w.prototype.F=function(t){for(;;){var i,r=t.l;if(r===this.S)return;if(1===t.t)return void(t.t=0);if(t===r.h)if(1===(i=r.o).t)i.t=0,r.t=1,r===this.g?this.g=r._():r._();else{if(i.o&&1===i.o.t)return i.t=r.t,r.t=0,i.o.t=0,void(r===this.g?this.g=r._():r._());i.h&&1===i.h.t?(i.t=1,i.h.t=0,i.T()):(i.t=1,t=r)}else if(1===(i=r.h).t)i.t=0,r.t=1,r===this.g?this.g=r.T():r.T();else{if(i.h&&1===i.h.t)return i.t=r.t,r.t=0,i.h.t=0,void(r===this.g?this.g=r.T():r.T());i.o&&1===i.o.t?(i.t=1,i.o.t=0,i._()):(i.t=1,t=r)}}},w.prototype.P=function(t){var i;if(1===this.M)return this.clear(),this.S;for(var r=t;r.h||r.o;){if(r.o)for(r=r.o;r.h;)r=r.h;else r=r.h;i=o([r.i,t.i],2),t.i=i[0],r.i=i[1],i=o([r.u,t.u],2),t.u=i[0],r.u=i[1],t=r}this.S.h===r?this.S.h=r.l:this.S.o===r&&(this.S.o=r.l),this.F(r);var e=r.l;return r===e.h?e.h=void 0:e.o=void 0,--this.M,this.g.t=0,e},w.prototype.H=function(t,i){return void 0!==t&&(!!this.H(t.h,i)||!!i(t)||this.H(t.o,i))},w.prototype.k=function(t){for(;;){var i=t.l;if(0===i.t)return;var r,e,o=i.l;if(i===o.h){if((r=o.o)&&1===r.t){if(r.t=i.t=0,o===this.g)return;o.t=1,t=o;continue}if(t===i.o)return t.t=0,t.h&&(t.h.l=i),t.o&&(t.o.l=o),i.o=t.h,o.h=t.o,t.h=i,(t.o=o)===this.g?(this.g=t,this.S.l=t):(e=o.l).h===o?e.h=t:e.o=t,t.l=o.l,i.l=t,o.l=t,o.t=1,{parentNode:i,grandParent:o,curNode:t};i.t=0,o===this.g?this.g=o.T():o.T()}else{if((r=o.h)&&1===r.t){if(r.t=i.t=0,o===this.g)return;o.t=1,t=o;continue}if(t===i.h)return t.t=0,t.h&&(t.h.l=o),t.o&&(t.o.l=i),o.o=t.h,i.h=t.o,t.h=o,t.o=i,o===this.g?(this.g=t,this.S.l=t):(e=o.l).h===o?e.h=t:e.o=t,t.l=o.l,i.l=t,o.l=t,o.t=1,{parentNode:i,grandParent:o,curNode:t};i.t=0,o===this.g?this.g=o._():o._()}return void(o.t=1)}},w.prototype.A=function(t,i,r){if(void 0===this.g)this.M+=1,this.g=new this.m(t,i),this.g.t=0,this.g.l=this.S,this.S.l=this.g,this.S.h=this.g,this.S.o=this.g;else{var e,o=this.S.h,n=this.N(o.i,t);if(0!==n){if(0<n)o.h=new this.m(t,i),e=(o.h.l=o).h,this.S.h=e;else{var n=this.S.o,h=this.N(n.i,t);if(0===h)return void(n.u=i);if(h<0)n.o=new this.m(t,i),e=(n.o.l=n).o,this.S.o=e;else{if(void 0!==r){h=r.I;if(h!==this.S){n=this.N(h.i,t);if(0===n)return void(h.u=i);if(0<n){r=h.v(),n=this.N(r.i,t);if(0===n)return void(r.u=i);n<0&&(e=new this.m(t,i),void 0===r.o?(r.o=e).l=r:(h.h=e).l=h)}}}if(void 0===e)for(e=this.g;;){var s=this.N(e.i,t);if(0<s){if(void 0===e.h){e.h=new this.m(t,i),e=(e.h.l=e).h;break}e=e.h}else{if(!(s<0))return void(e.u=i);if(void 0===e.o){e.o=new this.m(t,i),e=(e.o.l=e).o;break}e=e.o}}}}return this.M+=1,e}o.u=i}},w.prototype.J=function(t,i){for(;t;){var r=this.N(t.i,i);if(r<0)t=t.o;else{if(!(0<r))return t;t=t.h}}return t||this.S},w.prototype.clear=function(){this.M=0,this.g=void 0,this.S.l=void 0,this.S.h=this.S.o=void 0},w.prototype.updateKeyByIterator=function(t,i){t=t.I;if(t===this.S&&S(),1!==this.M){if(t===this.S.h)return 0<this.N(t.p().i,i)&&(t.i=i,!0);if(t===this.S.o)return this.N(t.v().i,i)<0&&(t.i=i,!0);var r=t.v().i;if(0<=this.N(r,i))return!1;if(r=t.p().i,this.N(r,i)<=0)return!1}return t.i=i,!0},w.prototype.eraseElementByPos=function(i){if(i<0||i>this.M-1)throw new RangeError;var r=0,e=this;return this.H(this.g,function(t){return i===r?(e.B(t),!0):(r+=1,!1)}),this.M},w.prototype.eraseElementByKey=function(t){return 0!==this.M&&(t=this.J(this.g,t))!==this.S&&(this.B(t),!0)},w.prototype.eraseElementByIterator=function(t){var i=t.I,r=(i===this.S&&S(),void 0===i.o);return 0===t.iteratorType?r&&t.next():r&&void 0!==i.h||t.next(),this.B(i),t},w.prototype.forEach=function(t){var i,r,e=0;try{for(var o=u(this),n=o.next();!n.done;n=o.next())t(n.value,e++,this)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}},w.prototype.getElementByPos=function(t){var i,r,e;if(t<0||t>this.M-1)throw new RangeError;var o=0;try{for(var n=u(this),h=n.next();!h.done;h=n.next()){var s=h.value;if(o===t){e=s;break}o+=1}}catch(t){i={error:t}}finally{try{h&&!h.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return e},w.prototype.getHeight=function(){var i;return 0===this.M?0:(i=function(t){return t?Math.max(i(t.h),i(t.o))+1:0})(this.g)};var g,v=w;function w(t,i){void 0===t&&(t=function(t,i){return t<i?-1:i<t?1:0}),void 0===i&&(i=!1);var r=g.call(this)||this;return r.g=void 0,r.N=t,i?(r.m=f,r.j=function(t,i,r){t=this.A(t,i,r);if(t){for(var e=t.l;e!==this.S;)e.O+=1,e=e.l;var i=this.k(t);i&&(r=i.parentNode,t=i.grandParent,i=i.curNode,r.C(),t.C(),i.C())}return this.M},r.B=function(t){for(var i=this.P(t);i!==this.S;)--i.O,i=i.l}):(r.m=n,r.j=function(t,i,r){t=this.A(t,i,r);return t&&this.k(t),this.M},r.B=r.P),r.S=new r.m,r}i(m,b=a),Object.defineProperty(m.prototype,"index",{get:function(){var t=this.I,i=this.S.l;if(t===this.S)return i?i.O-1:0;var r=0;for(t.h&&(r+=t.h.O);t!==i;){var e=t.l;t===e.o&&(r+=1,e.h)&&(r+=e.h.O),t=e}return r},enumerable:!1,configurable:!0});var b,a=m;function m(t,i,r){r=b.call(this,r)||this;return r.I=t,r.S=i,0===r.iteratorType?(r.pre=function(){return this.I===this.S.h&&S(),this.I=this.I.v(),this},r.next=function(){return this.I===this.S&&S(),this.I=this.I.p(),this}):(r.pre=function(){return this.I===this.S.o&&S(),this.I=this.I.p(),this},r.next=function(){return this.I===this.S&&S(),this.I=this.I.v(),this}),r}i(O,I=a),Object.defineProperty(O.prototype,"pointer",{get:function(){this.I===this.S&&S();var e=this;return new Proxy([],{get:function(t,i){return"0"===i?e.I.i:"1"===i?e.I.u:void 0},set:function(t,i,r){if("1"!==i)throw new TypeError("props must be 1");return e.I.u=r,!0}})},enumerable:!1,configurable:!0}),O.prototype.copy=function(){return new O(this.I,this.S,this.iteratorType)};var I,M=O;function O(){return null!==I&&I.apply(this,arguments)||this}i(x,N=v),x.prototype.K=function(i){return r(this,function(t){switch(t.label){case 0:return void 0===i?[2]:[5,u(this.K(i.h))];case 1:return t.sent(),[4,[i.i,i.u]];case 2:return t.sent(),[5,u(this.K(i.o))];case 3:return t.sent(),[2]}})},x.prototype.begin=function(){return new M(this.S.h||this.S,this.S)},x.prototype.end=function(){return new M(this.S,this.S)},x.prototype.rBegin=function(){return new M(this.S.o||this.S,this.S,1)},x.prototype.rEnd=function(){return new M(this.S,this.S,1)},x.prototype.front=function(){var t;if(0!==this.M)return[(t=this.S.h).i,t.u]},x.prototype.back=function(){var t;if(0!==this.M)return[(t=this.S.o).i,t.u]},x.prototype.lowerBound=function(t){t=this.R(this.g,t);return new M(t,this.S)},x.prototype.upperBound=function(t){t=this.G(this.g,t);return new M(t,this.S)},x.prototype.reverseLowerBound=function(t){t=this.q(this.g,t);return new M(t,this.S)},x.prototype.reverseUpperBound=function(t){t=this.D(this.g,t);return new M(t,this.S)},x.prototype.setElement=function(t,i,r){return this.j(t,i,r)},x.prototype.find=function(t){t=this.J(this.g,t);return new M(t,this.S)},x.prototype.getElementByKey=function(t){return this.J(this.g,t).u},x.prototype.union=function(t){var i=this;return t.forEach(function(t){i.setElement(t[0],t[1])}),this.M},x.prototype[Symbol.iterator]=function(){return this.K(this.g)};var N,a=x;function x(t,i,r){void 0===t&&(t=[]);var i=N.call(this,i,r)||this,e=i;return t.forEach(function(t){e.setElement(t[0],t[1])}),i}t.OrderedMap=a,Object.defineProperty(t,"L",{value:!0})}); | ||
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i((t="undefined"!=typeof globalThis?globalThis:t||self).sdsl={})}(this,function(t){"use strict";var e=function(t,i){return(e=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,i){t.__proto__=i}:function(t,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}))(t,i)};function i(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}function r(e,o){var n,h,s,u={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},f={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(f[Symbol.iterator]=function(){return this}),f;function t(r){return function(t){var i=[r,t];if(n)throw new TypeError("Generator is already executing.");for(;u=f&&i[f=0]?0:u;)try{if(n=1,h&&(s=2&i[0]?h.return:i[0]?h.throw||((s=h.return)&&s.call(h),0):h.next)&&!(s=s.call(h,i[1])).done)return s;switch(h=0,(i=s?[2&i[0],s.value]:i)[0]){case 0:case 1:s=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,h=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(s=0<(s=u.trys).length&&s[s.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!s||i[1]>s[0]&&i[1]<s[3]))u.label=i[1];else if(6===i[0]&&u.label<s[1])u.label=s[1],s=i;else{if(!(s&&u.label<s[2])){s[2]&&u.ops.pop(),u.trys.pop();continue}u.label=s[2],u.ops.push(i)}}i=o.call(e,u)}catch(t){i=[6,t],h=0}finally{n=s=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}}}function u(t){var i="function"==typeof Symbol&&Symbol.iterator,r=i&&t[i],e=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&e>=t.length?void 0:t)&&t[e++],done:!t}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(t,i){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var e,o,n=r.call(t),h=[];try{for(;(void 0===i||0<i--)&&!(e=n.next()).done;)h.push(e.value)}catch(t){o={error:t}}finally{try{e&&!e.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return h}h.prototype.v=function(){var t=this;if(1===t.t&&t.l.l===t)t=t.o;else if(t.h)for(t=t.h;t.o;)t=t.o;else{for(var i=t.l;i.h===t;)i=(t=i).l;t=i}return t},h.prototype.p=function(){var t=this;if(t.o){for(t=t.o;t.h;)t=t.h;return t}for(var i=t.l;i.o===t;)i=(t=i).l;return t.o!==i?i:t},h.prototype._=function(){var t=this.l,i=this.o,r=i.h;return t.l===this?t.l=i:t.h===this?t.h=i:t.o=i,i.l=t,(i.h=this).l=i,(this.o=r)&&(r.l=this),i},h.prototype.T=function(){var t=this.l,i=this.h,r=i.o;return t.l===this?t.l=i:t.h===this?t.h=i:t.o=i,i.l=t,(i.o=this).l=i,(this.h=r)&&(r.l=this),i};var n=h;function h(t,i){this.t=1,this.i=void 0,this.u=void 0,this.h=void 0,this.o=void 0,this.l=void 0,this.i=t,this.u=i}i(l,s=n),l.prototype._=function(){var t=s.prototype._.call(this);return this.C(),t.C(),t},l.prototype.T=function(){var t=s.prototype.T.call(this);return this.C(),t.C(),t},l.prototype.C=function(){this.O=1,this.h&&(this.O+=this.h.O),this.o&&(this.O+=this.o.O)};var s,f=l;function l(){var t=null!==s&&s.apply(this,arguments)||this;return t.O=1,t}p.prototype.equals=function(t){return this.I===t.I};var a=p;function p(t){this.iteratorType=t=void 0===t?0:t}function c(){this.M=0}Object.defineProperty(c.prototype,"length",{get:function(){return this.M},enumerable:!1,configurable:!0}),c.prototype.size=function(){return this.M},c.prototype.empty=function(){return 0===this.M};i(d,y=c);var y,v=d;function d(){return null!==y&&y.apply(this,arguments)||this}function S(){throw new RangeError("Iterator access denied!")}i(w,g=v),w.prototype.R=function(t,i){for(var r=this.S;t;){var e=this.N(t.i,i);if(e<0)t=t.o;else{if(!(0<e))return t;t=(r=t).h}}return r},w.prototype.G=function(t,i){for(var r=this.S;t;)t=this.N(t.i,i)<=0?t.o:(r=t).h;return r},w.prototype.q=function(t,i){for(var r=this.S;t;){var e=this.N(t.i,i);if(e<0)t=(r=t).o;else{if(!(0<e))return t;t=t.h}}return r},w.prototype.D=function(t,i){for(var r=this.S;t;)t=this.N(t.i,i)<0?(r=t).o:t.h;return r},w.prototype.F=function(t){for(;;){var i,r=t.l;if(r===this.S)return;if(1===t.t)return void(t.t=0);if(t===r.h)if(1===(i=r.o).t)i.t=0,r.t=1,r===this.g?this.g=r._():r._();else{if(i.o&&1===i.o.t)return i.t=r.t,r.t=0,i.o.t=0,void(r===this.g?this.g=r._():r._());i.h&&1===i.h.t?(i.t=1,i.h.t=0,i.T()):(i.t=1,t=r)}else if(1===(i=r.h).t)i.t=0,r.t=1,r===this.g?this.g=r.T():r.T();else{if(i.h&&1===i.h.t)return i.t=r.t,r.t=0,i.h.t=0,void(r===this.g?this.g=r.T():r.T());i.o&&1===i.o.t?(i.t=1,i.o.t=0,i._()):(i.t=1,t=r)}}},w.prototype.P=function(t){var i;if(1===this.M)return this.clear(),this.S;for(var r=t;r.h||r.o;){if(r.o)for(r=r.o;r.h;)r=r.h;else r=r.h;i=o([r.i,t.i],2),t.i=i[0],r.i=i[1],i=o([r.u,t.u],2),t.u=i[0],r.u=i[1],t=r}this.S.h===r?this.S.h=r.l:this.S.o===r&&(this.S.o=r.l),this.F(r);var e=r.l;return r===e.h?e.h=void 0:e.o=void 0,--this.M,this.g.t=0,e},w.prototype.H=function(t,i){return void 0!==t&&(!!this.H(t.h,i)||!!i(t)||this.H(t.o,i))},w.prototype.k=function(t){for(;;){var i=t.l;if(0===i.t)return;var r,e,o=i.l;if(i===o.h){if((r=o.o)&&1===r.t){if(r.t=i.t=0,o===this.g)return;o.t=1,t=o;continue}if(t===i.o)return t.t=0,t.h&&(t.h.l=i),t.o&&(t.o.l=o),i.o=t.h,o.h=t.o,t.h=i,(t.o=o)===this.g?(this.g=t,this.S.l=t):(e=o.l).h===o?e.h=t:e.o=t,t.l=o.l,i.l=t,o.l=t,o.t=1,{parentNode:i,grandParent:o,curNode:t};i.t=0,o===this.g?this.g=o.T():o.T()}else{if((r=o.h)&&1===r.t){if(r.t=i.t=0,o===this.g)return;o.t=1,t=o;continue}if(t===i.h)return t.t=0,t.h&&(t.h.l=o),t.o&&(t.o.l=i),o.o=t.h,i.h=t.o,t.h=o,t.o=i,o===this.g?(this.g=t,this.S.l=t):(e=o.l).h===o?e.h=t:e.o=t,t.l=o.l,i.l=t,o.l=t,o.t=1,{parentNode:i,grandParent:o,curNode:t};i.t=0,o===this.g?this.g=o._():o._()}return void(o.t=1)}},w.prototype.A=function(t,i,r){if(void 0===this.g)this.M+=1,this.g=new this.m(t,i),this.g.t=0,this.g.l=this.S,this.S.l=this.g,this.S.h=this.g,this.S.o=this.g;else{var e,o=this.S.h,n=this.N(o.i,t);if(0!==n){if(0<n)o.h=new this.m(t,i),e=(o.h.l=o).h,this.S.h=e;else{var n=this.S.o,h=this.N(n.i,t);if(0===h)return void(n.u=i);if(h<0)n.o=new this.m(t,i),e=(n.o.l=n).o,this.S.o=e;else{if(void 0!==r){h=r.I;if(h!==this.S){n=this.N(h.i,t);if(0===n)return void(h.u=i);if(0<n){r=h.v(),n=this.N(r.i,t);if(0===n)return void(r.u=i);n<0&&(e=new this.m(t,i),void 0===r.o?(r.o=e).l=r:(h.h=e).l=h)}}}if(void 0===e)for(e=this.g;;){var s=this.N(e.i,t);if(0<s){if(void 0===e.h){e.h=new this.m(t,i),e=(e.h.l=e).h;break}e=e.h}else{if(!(s<0))return void(e.u=i);if(void 0===e.o){e.o=new this.m(t,i),e=(e.o.l=e).o;break}e=e.o}}}}return this.M+=1,e}o.u=i}},w.prototype.J=function(t,i){for(;t;){var r=this.N(t.i,i);if(r<0)t=t.o;else{if(!(0<r))return t;t=t.h}}return t||this.S},w.prototype.clear=function(){this.M=0,this.g=void 0,this.S.l=void 0,this.S.h=this.S.o=void 0},w.prototype.updateKeyByIterator=function(t,i){t=t.I;if(t===this.S&&S(),1!==this.M){if(t===this.S.h)return 0<this.N(t.p().i,i)&&(t.i=i,!0);if(t===this.S.o)return this.N(t.v().i,i)<0&&(t.i=i,!0);var r=t.v().i;if(0<=this.N(r,i))return!1;if(r=t.p().i,this.N(r,i)<=0)return!1}return t.i=i,!0},w.prototype.eraseElementByPos=function(i){if(i<0||i>this.M-1)throw new RangeError;var r=0,e=this;return this.H(this.g,function(t){return i===r?(e.B(t),!0):(r+=1,!1)}),this.M},w.prototype.eraseElementByKey=function(t){return 0!==this.M&&(t=this.J(this.g,t))!==this.S&&(this.B(t),!0)},w.prototype.eraseElementByIterator=function(t){var i=t.I,r=(i===this.S&&S(),void 0===i.o);return 0===t.iteratorType?r&&t.next():r&&void 0!==i.h||t.next(),this.B(i),t},w.prototype.forEach=function(t){var i,r,e=0;try{for(var o=u(this),n=o.next();!n.done;n=o.next())t(n.value,e++,this)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}},w.prototype.getElementByPos=function(t){var i,r,e;if(t<0||t>this.M-1)throw new RangeError;var o=0;try{for(var n=u(this),h=n.next();!h.done;h=n.next()){var s=h.value;if(o===t){e=s;break}o+=1}}catch(t){i={error:t}}finally{try{h&&!h.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return e},w.prototype.getHeight=function(){var i;return 0===this.M?0:(i=function(t){return t?Math.max(i(t.h),i(t.o))+1:0})(this.g)};var g,v=w;function w(t,i){void 0===t&&(t=function(t,i){return t<i?-1:i<t?1:0}),void 0===i&&(i=!1);var r=g.call(this)||this;return r.g=void 0,r.N=t,i?(r.m=f,r.j=function(t,i,r){t=this.A(t,i,r);if(t){for(var e=t.l;e!==this.S;)e.O+=1,e=e.l;var i=this.k(t);i&&(r=i.parentNode,t=i.grandParent,i=i.curNode,r.C(),t.C(),i.C())}return this.M},r.B=function(t){for(var i=this.P(t);i!==this.S;)--i.O,i=i.l}):(r.m=n,r.j=function(t,i,r){t=this.A(t,i,r);return t&&this.k(t),this.M},r.B=r.P),r.S=new r.m,r}i(m,b=a),Object.defineProperty(m.prototype,"index",{get:function(){var t=this.I,i=this.S.l;if(t===this.S)return i?i.O-1:0;var r=0;for(t.h&&(r+=t.h.O);t!==i;){var e=t.l;t===e.o&&(r+=1,e.h)&&(r+=e.h.O),t=e}return r},enumerable:!1,configurable:!0});var b,a=m;function m(t,i,r){r=b.call(this,r)||this;return r.I=t,r.S=i,0===r.iteratorType?(r.pre=function(){return this.I===this.S.h&&S(),this.I=this.I.v(),this},r.next=function(){return this.I===this.S&&S(),this.I=this.I.p(),this}):(r.pre=function(){return this.I===this.S.o&&S(),this.I=this.I.p(),this},r.next=function(){return this.I===this.S&&S(),this.I=this.I.v(),this}),r}i(O,I=a),Object.defineProperty(O.prototype,"pointer",{get:function(){this.I===this.S&&S();var e=this;return new Proxy([],{get:function(t,i){return"0"===i?e.I.i:"1"===i?e.I.u:void 0},set:function(t,i,r){if("1"!==i)throw new TypeError("props must be 1");return e.I.u=r,!0}})},enumerable:!1,configurable:!0}),O.prototype.copy=function(){return new O(this.I,this.S,this.container,this.iteratorType)};var I,M=O;function O(t,i,r,e){t=I.call(this,t,i,e)||this;return t.container=r,t}i(x,N=v),x.prototype.K=function(i){return r(this,function(t){switch(t.label){case 0:return void 0===i?[2]:[5,u(this.K(i.h))];case 1:return t.sent(),[4,[i.i,i.u]];case 2:return t.sent(),[5,u(this.K(i.o))];case 3:return t.sent(),[2]}})},x.prototype.begin=function(){return new M(this.S.h||this.S,this.S,this)},x.prototype.end=function(){return new M(this.S,this.S,this)},x.prototype.rBegin=function(){return new M(this.S.o||this.S,this.S,this,1)},x.prototype.rEnd=function(){return new M(this.S,this.S,this,1)},x.prototype.front=function(){var t;if(0!==this.M)return[(t=this.S.h).i,t.u]},x.prototype.back=function(){var t;if(0!==this.M)return[(t=this.S.o).i,t.u]},x.prototype.lowerBound=function(t){t=this.R(this.g,t);return new M(t,this.S,this)},x.prototype.upperBound=function(t){t=this.G(this.g,t);return new M(t,this.S,this)},x.prototype.reverseLowerBound=function(t){t=this.q(this.g,t);return new M(t,this.S,this)},x.prototype.reverseUpperBound=function(t){t=this.D(this.g,t);return new M(t,this.S,this)},x.prototype.setElement=function(t,i,r){return this.j(t,i,r)},x.prototype.find=function(t){t=this.J(this.g,t);return new M(t,this.S,this)},x.prototype.getElementByKey=function(t){return this.J(this.g,t).u},x.prototype.union=function(t){var i=this;return t.forEach(function(t){i.setElement(t[0],t[1])}),this.M},x.prototype[Symbol.iterator]=function(){return this.K(this.g)};var N,a=x;function x(t,i,r){void 0===t&&(t=[]);var i=N.call(this,i,r)||this,e=i;return t.forEach(function(t){e.setElement(t[0],t[1])}),i}t.OrderedMap=a,Object.defineProperty(t,"L",{value:!0})}); | ||
//# sourceMappingURL=ordered-map.min.js.map |
{ | ||
"name": "@js-sdsl/ordered-map", | ||
"version": "4.2.0", | ||
"version": "4.3.0", | ||
"description": "javascript standard data structure library which benchmark against C++ STL", | ||
@@ -5,0 +5,0 @@ "main": "./dist/cjs/index.js", |
@@ -11,3 +11,3 @@ <p align="center"> | ||
<a href="https://www.npmjs.com/package/js-sdsl"><img src="https://img.shields.io/npm/v/js-sdsl.svg" alt="NPM Version" /></a> | ||
<a href="https://github.com/js-sdsl/js-sdsl/actions/workflows/build.yml"><img src="https://img.shields.io/github/workflow/status/js-sdsl/js-sdsl/js-sdsl%20CI" alt="Build Status" /></a> | ||
<a href="https://github.com/js-sdsl/js-sdsl/actions/workflows/build.yml"><img src="https://img.shields.io/github/actions/workflow/status/js-sdsl/js-sdsl/build.yml" alt="Build Status" /></a> | ||
<a href='https://coveralls.io/github/js-sdsl/js-sdsl?branch=main'><img src='https://coveralls.io/repos/github/js-sdsl/js-sdsl/badge.svg?branch=main' alt='Coverage Status' /></a> | ||
@@ -26,4 +26,4 @@ <a href="https://github.com/js-sdsl/js-sdsl"><img src="https://img.shields.io/github/stars/js-sdsl/js-sdsl.svg" alt="GITHUB Star" /></a> | ||
- **Stack** - first in first out stack. | ||
- **Queue** - first in last out queue. | ||
- **Stack** - first in last out stack. | ||
- **Queue** - first in first out queue. | ||
- **PriorityQueue** - heap-implemented priority queue. | ||
@@ -162,3 +162,3 @@ - **Vector** - protected array, cannot to operate properties like `length` directly. | ||
We use jest library to write unit tests, you can see test coverage on [coveralls](https://coveralls.io/github/js-sdsl/js-sdsl). You can run `yarn test:unit` command to reproduce it. | ||
We use [karma](https://karma-runner.github.io/) and [mocha](https://mochajs.org/) frame to do unit tests and synchronize to [coveralls](https://coveralls.io/github/js-sdsl/js-sdsl). You can run `yarn test:unit` command to reproduce it. | ||
@@ -180,3 +180,3 @@ ### For performance | ||
```bash | ||
$ git clone https://github.com/js-sdsl/js-sdl.git | ||
$ git clone https://github.com/js-sdsl/js-sdsl.git | ||
$ cd js-sdsl | ||
@@ -183,0 +183,0 @@ $ npm install |
@@ -11,3 +11,3 @@ <p align="center"> | ||
<a href="https://www.npmjs.com/package/js-sdsl"><img src="https://img.shields.io/npm/v/js-sdsl.svg" alt="NPM Version" /></a> | ||
<a href="https://github.com/js-sdsl/js-sdsl/actions/workflows/build.yml"><img src="https://img.shields.io/github/workflow/status/js-sdsl/js-sdsl/js-sdsl%20CI" alt="Build Status" /></a> | ||
<a href="https://github.com/js-sdsl/js-sdsl/actions/workflows/build.yml"><img src="https://img.shields.io/github/actions/workflow/status/js-sdsl/js-sdsl/build.yml" alt="Build Status" /></a> | ||
<a href='https://coveralls.io/github/js-sdsl/js-sdsl?branch=main'><img src='https://coveralls.io/repos/github/js-sdsl/js-sdsl/badge.svg?branch=main' alt='Coverage Status' /></a> | ||
@@ -26,4 +26,4 @@ <a href="https://github.com/js-sdsl/js-sdsl"><img src="https://img.shields.io/github/stars/js-sdsl/js-sdsl.svg" alt="GITHUB Star" /></a> | ||
- **Stack** - 先进先出的堆栈 | ||
- **Queue** - 先进后出的队列 | ||
- **Stack** - 先进后出的堆栈 | ||
- **Queue** - 先进先出的队列 | ||
- **PriorityQueue** - 堆实现的优先级队列 | ||
@@ -164,3 +164,3 @@ - **Vector** - 受保护的数组,不能直接操作像 `length` 这样的属性 | ||
我们使用 `jest` 库来编写我们的单元测试,并将结果同步到了 [coveralls](https://coveralls.io/github/js-sdsl/js-sdsl) 上,你可以使用 `yarn test:unit` 命令来重建它 | ||
我们使用 [karma](https://karma-runner.github.io/) 和 [mocha](https://mochajs.org/) 框架进行单元测试,并同步到 [coveralls](https://coveralls.io/github/js-sdsl/js-sdsl) 上,你可以使用 `yarn test:unit` 命令来重建它 | ||
@@ -182,3 +182,3 @@ ### 对于性能的校验 | ||
```bash | ||
$ git clone https://github.com/js-sdsl/js-sdl.git | ||
$ git clone https://github.com/js-sdsl/js-sdsl.git | ||
$ cd js-sdsl | ||
@@ -185,0 +185,0 @@ $ npm install |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
405389
3882