mqtt and socket added
This commit is contained in:
32
WebUI/node_modules/js-sdsl/dist/esm/container/HashContainer/Base/index.d.ts
generated
vendored
Normal file
32
WebUI/node_modules/js-sdsl/dist/esm/container/HashContainer/Base/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
import { Base, Container } from "../../ContainerBase/index";
|
||||
declare abstract class HashContainer<K> extends Base {
|
||||
protected static readonly sigma = 0.75;
|
||||
protected static readonly treeifyThreshold = 8;
|
||||
protected static readonly untreeifyThreshold = 6;
|
||||
protected static readonly minTreeifySize = 64;
|
||||
protected static readonly maxBucketNum: number;
|
||||
protected bucketNum: number;
|
||||
protected initBucketNum: number;
|
||||
protected hashFunc: (x: K) => number;
|
||||
protected abstract hashTable: Container<unknown>[];
|
||||
protected constructor(initBucketNum?: number, hashFunc?: (x: K) => number);
|
||||
clear(): void;
|
||||
/**
|
||||
* @description Growth the hash table.
|
||||
* @protected
|
||||
*/
|
||||
protected abstract reAllocate(): void;
|
||||
abstract forEach(callback: (element: unknown, index: number) => void): void;
|
||||
/**
|
||||
* @description Remove the elements of the specified value.
|
||||
* @param key The element you want to remove.
|
||||
*/
|
||||
abstract eraseElementByKey(key: K): void;
|
||||
/**
|
||||
* @param key The element you want to find.
|
||||
* @return Boolean about if the specified element in the hash set.
|
||||
*/
|
||||
abstract find(key: K): void;
|
||||
abstract [Symbol.iterator](): Generator<unknown, void, undefined>;
|
||||
}
|
||||
export default HashContainer;
|
||||
57
WebUI/node_modules/js-sdsl/dist/esm/container/HashContainer/Base/index.js
generated
vendored
Normal file
57
WebUI/node_modules/js-sdsl/dist/esm/container/HashContainer/Base/index.js
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
import { Base } from "../../ContainerBase/index";
|
||||
var HashContainer = /** @class */ (function (_super) {
|
||||
__extends(HashContainer, _super);
|
||||
function HashContainer(initBucketNum, hashFunc) {
|
||||
if (initBucketNum === void 0) { initBucketNum = 16; }
|
||||
if (hashFunc === void 0) { hashFunc = function (x) {
|
||||
var str;
|
||||
if (typeof x !== 'string') {
|
||||
str = JSON.stringify(x);
|
||||
}
|
||||
else
|
||||
str = x;
|
||||
var hashCode = 0;
|
||||
var strLength = str.length;
|
||||
for (var i = 0; i < strLength; i++) {
|
||||
var ch = str.charCodeAt(i);
|
||||
hashCode = ((hashCode << 5) - hashCode) + ch;
|
||||
hashCode |= 0;
|
||||
}
|
||||
return hashCode >>> 0;
|
||||
}; }
|
||||
var _this = _super.call(this) || this;
|
||||
if (initBucketNum < 16 || (initBucketNum & (initBucketNum - 1)) !== 0) {
|
||||
throw new RangeError('InitBucketNum range error');
|
||||
}
|
||||
_this.bucketNum = _this.initBucketNum = initBucketNum;
|
||||
_this.hashFunc = hashFunc;
|
||||
return _this;
|
||||
}
|
||||
HashContainer.prototype.clear = function () {
|
||||
this.length = 0;
|
||||
this.bucketNum = this.initBucketNum;
|
||||
this.hashTable = [];
|
||||
};
|
||||
HashContainer.sigma = 0.75;
|
||||
HashContainer.treeifyThreshold = 8;
|
||||
HashContainer.untreeifyThreshold = 6;
|
||||
HashContainer.minTreeifySize = 64;
|
||||
HashContainer.maxBucketNum = (1 << 30);
|
||||
return HashContainer;
|
||||
}(Base));
|
||||
export default HashContainer;
|
||||
Reference in New Issue
Block a user