UNPKG

1.23 kBJavaScriptView Raw
1"use strict";
2/**
3 * Created by user on 2018/4/19/019.
4 */
5Object.defineProperty(exports, "__esModule", { value: true });
6exports.AbstractTableDictCore = void 0;
7class AbstractTableDictCore {
8 constructor(type, options = {}, existsTable, ...argv) {
9 this.TABLE = {};
10 this.TABLE2 = {};
11 this.type = type;
12 this.options = Object.assign({}, this.options, options);
13 if (existsTable) {
14 if (existsTable.TABLE) {
15 this.TABLE = existsTable.TABLE;
16 }
17 if (existsTable.TABLE2) {
18 this.TABLE2 = existsTable.TABLE2;
19 }
20 }
21 }
22 _exists(data, ...argv) {
23 let w, p, f;
24 if (typeof data == 'string') {
25 w = data;
26 }
27 else if (Array.isArray(data)) {
28 [w, p, f] = data;
29 }
30 else {
31 ({ w, p, f } = data);
32 }
33 return w;
34 }
35 exists(data, ...argv) {
36 let w = this._exists(data);
37 return this.TABLE[w] || null;
38 }
39 size() {
40 return Object.keys(this.TABLE).length;
41 }
42}
43exports.AbstractTableDictCore = AbstractTableDictCore;
44exports.default = AbstractTableDictCore;
45//# sourceMappingURL=core.js.map
\No newline at end of file