random-weighted-pick 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +209 -116
- package/dist/cjs/index.d.ts +18 -0
- package/dist/cjs/index.js +3 -43
- package/dist/cjs/weightList.d.ts +42 -0
- package/dist/cjs/weightList.js +200 -138
- package/dist/esm/index.d.ts +2 -4
- package/dist/esm/index.js +1 -5
- package/dist/esm/weightList.d.ts +24 -18
- package/dist/esm/weightList.js +200 -138
- package/package.json +35 -22
- package/.babelrc +0 -6
- package/.circleci/config.yml +0 -20
- package/.eslintrc.json +0 -7
- package/.prettierrc +0 -4
- package/CONTRIBUTING.md +0 -9
- package/jest.config.cjs +0 -5
- package/tsconfig.cjs.json +0 -8
- package/tsconfig.esm.json +0 -8
- package/tsconfig.json +0 -20
package/dist/esm/weightList.js
CHANGED
|
@@ -1,161 +1,223 @@
|
|
|
1
|
-
const
|
|
2
|
-
throw new TypeError(msg);
|
|
3
|
-
};
|
|
1
|
+
const randomWords = new Uint32Array(2);
|
|
4
2
|
const defaultRNG = () => {
|
|
5
|
-
if (typeof globalThis
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return arr[0] / 0x100000000;
|
|
3
|
+
if (typeof globalThis.crypto?.getRandomValues === 'function') {
|
|
4
|
+
globalThis.crypto.getRandomValues(randomWords);
|
|
5
|
+
return ((randomWords[0] >>> 11) * 0x100000000 + randomWords[1]) / 0x20000000000000;
|
|
9
6
|
}
|
|
10
7
|
return Math.random();
|
|
11
8
|
};
|
|
12
|
-
|
|
9
|
+
function resolveConfig(cfg) {
|
|
10
|
+
const { normalize = true, epsilon = 1e-12, rng = defaultRNG } = cfg;
|
|
11
|
+
if (typeof normalize !== 'boolean')
|
|
12
|
+
throw new TypeError('normalize must be a boolean');
|
|
13
|
+
if (!Number.isFinite(epsilon) || epsilon < 0) {
|
|
14
|
+
throw new TypeError('epsilon must be a finite non-negative number');
|
|
15
|
+
}
|
|
16
|
+
if (typeof rng !== 'function')
|
|
17
|
+
throw new TypeError('rng must be a function');
|
|
18
|
+
return { normalize, epsilon, rng };
|
|
19
|
+
}
|
|
20
|
+
function random(rng) {
|
|
21
|
+
const value = rng();
|
|
22
|
+
if (!Number.isFinite(value) || value < 0 || value >= 1) {
|
|
23
|
+
throw new TypeError('RNG should return a number x where 0 <= x < 1');
|
|
24
|
+
}
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
function validateWeight(weight) {
|
|
28
|
+
if (!Number.isFinite(weight) || weight < 0) {
|
|
29
|
+
throw new TypeError('Weights should be finite numbers >= 0');
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function validateCount(k) {
|
|
33
|
+
if (!Number.isSafeInteger(k) || k < 0 || k > 0xffffffff) {
|
|
34
|
+
throw new RangeError('k must be a non-negative integer within the array length limit');
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function validateOptions(options) {
|
|
13
38
|
if (!Array.isArray(options)) {
|
|
14
|
-
|
|
39
|
+
throw new TypeError('Weighted List expect Array of Objects as argument');
|
|
15
40
|
}
|
|
16
|
-
return
|
|
17
|
-
if (
|
|
18
|
-
|
|
19
|
-
if (!('item' in opt))
|
|
20
|
-
throwTypeError('Every list item should have [item] property');
|
|
21
|
-
const w = opt.weight;
|
|
22
|
-
if (typeof w !== 'number' || Number.isNaN(w) || !Number.isFinite(w) || w < 0) {
|
|
23
|
-
throwTypeError('Weights should be finite numbers >= 0');
|
|
41
|
+
return Array.from(options, (option, index) => {
|
|
42
|
+
if (option === null || typeof option !== 'object') {
|
|
43
|
+
throw new TypeError('Every list item should be an object');
|
|
24
44
|
}
|
|
25
|
-
|
|
45
|
+
if (!('weight' in option))
|
|
46
|
+
throw new TypeError('Every list item should have [weight] property');
|
|
47
|
+
if (!('item' in option))
|
|
48
|
+
throw new TypeError('Every list item should have [item] property');
|
|
49
|
+
const weight = option.weight;
|
|
50
|
+
validateWeight(weight);
|
|
51
|
+
const id = option.id ?? index;
|
|
52
|
+
if (!Number.isFinite(id))
|
|
53
|
+
throw new TypeError('ID must be a finite number');
|
|
54
|
+
return { id, item: option.item, weight };
|
|
26
55
|
});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
56
|
+
}
|
|
57
|
+
function validateTotal(entries, config) {
|
|
58
|
+
let max = 0;
|
|
59
|
+
let total = 0;
|
|
60
|
+
for (const entry of entries) {
|
|
61
|
+
max = Math.max(max, entry.weight);
|
|
62
|
+
if (!config.normalize)
|
|
63
|
+
total += entry.weight;
|
|
34
64
|
}
|
|
35
|
-
if (
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
/** Pick a single item based on its weight */
|
|
40
|
-
export function weightedPick(options, cfg = {}) {
|
|
41
|
-
const config = { normalize: true, epsilon: 1e-12, rng: defaultRNG, ...cfg };
|
|
42
|
-
const opts = validateOptions(options);
|
|
43
|
-
const weights = opts.map(o => o.weight);
|
|
44
|
-
const normalized = normalize(weights, config);
|
|
45
|
-
const num = config.rng();
|
|
46
|
-
if (typeof num !== 'number' || Number.isNaN(num) || num < 0 || num >= 1) {
|
|
47
|
-
throwTypeError('RNG should return a number x where 0 <= x < 1');
|
|
65
|
+
if (max === 0)
|
|
66
|
+
throw new TypeError("Sum of 'weights' should be greater than 0");
|
|
67
|
+
if (!config.normalize && (!Number.isFinite(total) || Math.abs(total - 1) > config.epsilon)) {
|
|
68
|
+
throw new TypeError("Sum of 'weights' should be equal 1");
|
|
48
69
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
70
|
+
return max;
|
|
71
|
+
}
|
|
72
|
+
function result(entry) {
|
|
73
|
+
return { id: entry.id, item: entry.item };
|
|
74
|
+
}
|
|
75
|
+
/** Scale before summing to avoid overflow and retain small absolute weights. */
|
|
76
|
+
function distribution(entries, config) {
|
|
77
|
+
const max = validateTotal(entries, config);
|
|
78
|
+
const active = [];
|
|
79
|
+
const cumulative = [];
|
|
80
|
+
const scaled = [];
|
|
81
|
+
let total = 0;
|
|
82
|
+
for (const entry of entries) {
|
|
83
|
+
const weight = entry.weight / max;
|
|
84
|
+
if (weight === 0)
|
|
85
|
+
continue;
|
|
86
|
+
total += weight;
|
|
87
|
+
active.push(entry);
|
|
88
|
+
scaled.push(weight);
|
|
89
|
+
cumulative.push(total);
|
|
90
|
+
}
|
|
91
|
+
return { active, cumulative, scaled, total };
|
|
92
|
+
}
|
|
93
|
+
function buildDraw(entries, config, method) {
|
|
94
|
+
const { active, cumulative, scaled, total } = distribution(entries, config);
|
|
95
|
+
if (method === 'cdf') {
|
|
96
|
+
return () => {
|
|
97
|
+
const target = random(config.rng) * total;
|
|
98
|
+
let low = 0;
|
|
99
|
+
let high = cumulative.length - 1;
|
|
100
|
+
while (low < high) {
|
|
101
|
+
const mid = low + Math.floor((high - low) / 2);
|
|
102
|
+
if (target < cumulative[mid])
|
|
103
|
+
high = mid;
|
|
104
|
+
else
|
|
105
|
+
low = mid + 1;
|
|
106
|
+
}
|
|
107
|
+
return result(active[low]);
|
|
108
|
+
};
|
|
55
109
|
}
|
|
56
|
-
|
|
110
|
+
const n = active.length;
|
|
111
|
+
const probabilities = new Float64Array(n);
|
|
112
|
+
const aliases = new Uint32Array(n);
|
|
113
|
+
const small = [];
|
|
114
|
+
const large = [];
|
|
115
|
+
for (let i = 0; i < n; i++) {
|
|
116
|
+
scaled[i] = (scaled[i] / total) * n;
|
|
117
|
+
(scaled[i] < 1 ? small : large).push(i);
|
|
118
|
+
}
|
|
119
|
+
while (small.length && large.length) {
|
|
120
|
+
const l = small.pop();
|
|
121
|
+
const g = large.pop();
|
|
122
|
+
probabilities[l] = scaled[l];
|
|
123
|
+
aliases[l] = g;
|
|
124
|
+
scaled[g] = (scaled[g] + scaled[l]) - 1;
|
|
125
|
+
(scaled[g] < 1 ? small : large).push(g);
|
|
126
|
+
}
|
|
127
|
+
for (const index of small)
|
|
128
|
+
probabilities[index] = 1;
|
|
129
|
+
for (const index of large)
|
|
130
|
+
probabilities[index] = 1;
|
|
131
|
+
return () => {
|
|
132
|
+
const index = Math.min(Math.floor(random(config.rng) * n), n - 1);
|
|
133
|
+
const coin = random(config.rng);
|
|
134
|
+
return result(active[coin < probabilities[index] ? index : aliases[index]]);
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
/** Select one entry with probability proportional to its weight. */
|
|
138
|
+
export function weightedPick(options, cfg = {}) {
|
|
139
|
+
const config = resolveConfig(cfg);
|
|
140
|
+
const entries = validateOptions(options);
|
|
141
|
+
const max = validateTotal(entries, config);
|
|
142
|
+
let total = 0;
|
|
143
|
+
for (const entry of entries)
|
|
144
|
+
total += entry.weight / max;
|
|
145
|
+
const target = random(config.rng) * total;
|
|
146
|
+
let cumulative = 0;
|
|
147
|
+
let last = entries[0];
|
|
148
|
+
for (const entry of entries) {
|
|
149
|
+
const weight = entry.weight / max;
|
|
150
|
+
if (weight === 0)
|
|
151
|
+
continue;
|
|
152
|
+
cumulative += weight;
|
|
153
|
+
last = entry;
|
|
154
|
+
if (target < cumulative)
|
|
155
|
+
return result(entry);
|
|
156
|
+
}
|
|
157
|
+
return result(last);
|
|
57
158
|
}
|
|
58
|
-
/**
|
|
159
|
+
/** Sample with replacement by default; otherwise return up to k distinct entries. */
|
|
59
160
|
export function pickMany(options, k, cfg = {}) {
|
|
60
|
-
|
|
161
|
+
validateCount(k);
|
|
162
|
+
const { replacement = true } = cfg;
|
|
163
|
+
if (typeof replacement !== 'boolean')
|
|
164
|
+
throw new TypeError('replacement must be a boolean');
|
|
165
|
+
const config = resolveConfig(cfg);
|
|
166
|
+
const entries = validateOptions(options);
|
|
61
167
|
if (replacement) {
|
|
62
|
-
|
|
168
|
+
const draw = buildDraw(entries, config, 'cdf');
|
|
169
|
+
return Array.from({ length: k }, draw);
|
|
63
170
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
res.sort((a, b) => b.key - a.key);
|
|
78
|
-
return res.slice(0, k).map(r => ({ id: r.option.id, item: r.option.item }));
|
|
171
|
+
validateTotal(entries, config);
|
|
172
|
+
if (k === 0)
|
|
173
|
+
return [];
|
|
174
|
+
// Log-space exponential race avoids power underflow/overflow for extreme weights.
|
|
175
|
+
// A uniform value of zero corresponds to infinite waiting time.
|
|
176
|
+
const ranked = entries.filter(entry => entry.weight > 0).map(entry => ({
|
|
177
|
+
entry,
|
|
178
|
+
key: Math.log(-Math.log(random(config.rng))) - Math.log(entry.weight),
|
|
179
|
+
}));
|
|
180
|
+
ranked.sort((a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0);
|
|
181
|
+
return ranked.slice(0, k).map(({ entry }) => result(entry));
|
|
79
182
|
}
|
|
80
|
-
/**
|
|
183
|
+
/** Prepare reusable lookup tables for repeated selections. */
|
|
81
184
|
export function createWeightedPicker(options, cfg = {}) {
|
|
82
|
-
const { method = 'alias'
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
let
|
|
87
|
-
let
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
if (scaled[g] < 1)
|
|
106
|
-
small.push(g);
|
|
107
|
-
else
|
|
108
|
-
large.push(g);
|
|
109
|
-
}
|
|
110
|
-
;
|
|
111
|
-
[...large, ...small].forEach(i => (probs[i] = 1));
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
cdf = [];
|
|
115
|
-
let sum = 0;
|
|
116
|
-
normalized.forEach((w) => {
|
|
117
|
-
sum += w;
|
|
118
|
-
cdf.push(sum);
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
build();
|
|
123
|
-
const pick = () => {
|
|
124
|
-
if (method === 'alias') {
|
|
125
|
-
const n = opts.length;
|
|
126
|
-
const i = Math.floor(config.rng() * n);
|
|
127
|
-
const r = config.rng();
|
|
128
|
-
const idx = r < probs[i] ? i : alias[i];
|
|
129
|
-
return { id: opts[idx].id, item: opts[idx].item };
|
|
130
|
-
}
|
|
131
|
-
const r = config.rng();
|
|
132
|
-
if (typeof r !== 'number' || Number.isNaN(r) || r < 0 || r >= 1) {
|
|
133
|
-
throwTypeError('RNG should return a number x where 0 <= x < 1');
|
|
134
|
-
}
|
|
135
|
-
let low = 0;
|
|
136
|
-
let high = cdf.length - 1;
|
|
137
|
-
while (low < high) {
|
|
138
|
-
const mid = Math.floor((low + high) / 2);
|
|
139
|
-
if (r < cdf[mid])
|
|
140
|
-
high = mid;
|
|
141
|
-
else
|
|
142
|
-
low = mid + 1;
|
|
185
|
+
const { method = 'alias' } = cfg;
|
|
186
|
+
if (method !== 'alias' && method !== 'cdf')
|
|
187
|
+
throw new TypeError('Unknown picker method');
|
|
188
|
+
const config = resolveConfig(cfg);
|
|
189
|
+
let entries = validateOptions(options);
|
|
190
|
+
let draw = buildDraw(entries, config, method);
|
|
191
|
+
const indices = new Map();
|
|
192
|
+
entries.forEach((entry, index) => {
|
|
193
|
+
if (!indices.has(entry.id))
|
|
194
|
+
indices.set(entry.id, index);
|
|
195
|
+
});
|
|
196
|
+
function updateWeights(updates) {
|
|
197
|
+
if (!Array.isArray(updates))
|
|
198
|
+
throw new TypeError('updates must be an array');
|
|
199
|
+
if (updates.length === 0)
|
|
200
|
+
return;
|
|
201
|
+
const next = entries.slice();
|
|
202
|
+
for (const { id, weight } of updates) {
|
|
203
|
+
const index = indices.get(id);
|
|
204
|
+
if (index === undefined)
|
|
205
|
+
throw new TypeError('ID not found');
|
|
206
|
+
validateWeight(weight);
|
|
207
|
+
next[index] = { ...next[index], weight };
|
|
143
208
|
}
|
|
144
|
-
|
|
145
|
-
|
|
209
|
+
const nextDraw = buildDraw(next, config, method);
|
|
210
|
+
entries = next;
|
|
211
|
+
draw = nextDraw;
|
|
212
|
+
}
|
|
146
213
|
return {
|
|
147
|
-
pick,
|
|
148
|
-
pickMany: (k) =>
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
if (idx === -1)
|
|
152
|
-
throwTypeError('ID not found');
|
|
153
|
-
if (typeof weight !== 'number' || Number.isNaN(weight) || !Number.isFinite(weight) || weight < 0) {
|
|
154
|
-
throwTypeError('Weights should be finite numbers >= 0');
|
|
155
|
-
}
|
|
156
|
-
opts[idx].weight = weight;
|
|
157
|
-
build();
|
|
214
|
+
pick: () => draw(),
|
|
215
|
+
pickMany: (k) => {
|
|
216
|
+
validateCount(k);
|
|
217
|
+
return Array.from({ length: k }, () => draw());
|
|
158
218
|
},
|
|
219
|
+
updateWeight: (id, weight) => updateWeights([{ id, weight }]),
|
|
220
|
+
updateWeights,
|
|
159
221
|
};
|
|
160
222
|
}
|
|
161
223
|
export default weightedPick;
|
package/package.json
CHANGED
|
@@ -1,35 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "random-weighted-pick",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"description": "Zero-dependency weighted random sampling for TypeScript and JavaScript. Single draws, sampling without replacement, and reusable alias/CDF pickers.",
|
|
4
5
|
"type": "module",
|
|
5
|
-
"main": "dist/cjs/index.js",
|
|
6
|
-
"
|
|
6
|
+
"main": "./dist/cjs/index.js",
|
|
7
|
+
"module": "./dist/esm/index.js",
|
|
8
|
+
"types": "./dist/esm/index.d.ts",
|
|
7
9
|
"exports": {
|
|
8
10
|
".": {
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
"import": {
|
|
12
|
+
"types": "./dist/esm/index.d.ts",
|
|
13
|
+
"default": "./dist/esm/index.js"
|
|
14
|
+
},
|
|
15
|
+
"require": {
|
|
16
|
+
"types": "./dist/cjs/index.d.ts",
|
|
17
|
+
"default": "./dist/cjs/index.js"
|
|
18
|
+
}
|
|
12
19
|
}
|
|
13
20
|
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist/",
|
|
23
|
+
"README.md",
|
|
24
|
+
"LICENSE"
|
|
25
|
+
],
|
|
26
|
+
"sideEffects": false,
|
|
14
27
|
"engines": {
|
|
15
28
|
"node": ">=16"
|
|
16
29
|
},
|
|
17
30
|
"scripts": {
|
|
18
|
-
"build": "
|
|
19
|
-
"
|
|
20
|
-
"
|
|
31
|
+
"build": "node scripts/build.mjs",
|
|
32
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
33
|
+
"test": "npm run build && node --test test/weighted.test.mjs test/package.test.mjs && tsc -p test/tsconfig.json",
|
|
34
|
+
"coverage": "npm run build && node --experimental-test-coverage --test test/weighted.test.mjs test/package.test.mjs",
|
|
35
|
+
"benchmark": "npm run build && node benchmarks/pick.mjs",
|
|
36
|
+
"prepack": "npm run build"
|
|
21
37
|
},
|
|
22
38
|
"license": "MIT",
|
|
23
39
|
"devDependencies": {
|
|
24
|
-
"
|
|
25
|
-
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
26
|
-
"@typescript-eslint/parser": "^7.18.0",
|
|
27
|
-
"eslint": "^8.56.0",
|
|
28
|
-
"jest": "^29.7.0",
|
|
29
|
-
"prettier": "^3.3.3",
|
|
30
|
-
"ts-jest": "^29.4.1",
|
|
31
|
-
"typescript": "^5.9.2",
|
|
32
|
-
"undici-types": "^7.16.0"
|
|
40
|
+
"typescript": "^5.9.3"
|
|
33
41
|
},
|
|
34
42
|
"repository": {
|
|
35
43
|
"type": "git",
|
|
@@ -38,13 +46,18 @@
|
|
|
38
46
|
"keywords": [
|
|
39
47
|
"random",
|
|
40
48
|
"weighted",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
49
|
+
"sampling",
|
|
50
|
+
"weighted-random",
|
|
51
|
+
"probability",
|
|
52
|
+
"alias-method",
|
|
53
|
+
"typescript",
|
|
54
|
+
"random-selection",
|
|
55
|
+
"monte-carlo",
|
|
56
|
+
"load-balancing"
|
|
43
57
|
],
|
|
44
58
|
"author": "Phellipe Andrade",
|
|
45
59
|
"bugs": {
|
|
46
60
|
"url": "https://github.com/phellipeandrade/random-weighted-pick/issues"
|
|
47
61
|
},
|
|
48
|
-
"homepage": "https://github.com/phellipeandrade/random-weighted-pick
|
|
49
|
-
"description": "Easily choose a random item from a weighted list of items."
|
|
62
|
+
"homepage": "https://github.com/phellipeandrade/random-weighted-pick#readme"
|
|
50
63
|
}
|
package/.babelrc
DELETED
package/.circleci/config.yml
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
version: 2
|
|
2
|
-
jobs:
|
|
3
|
-
build:
|
|
4
|
-
docker:
|
|
5
|
-
- image: cimg/node:lts
|
|
6
|
-
working_directory: ~/random-weighted-pick
|
|
7
|
-
|
|
8
|
-
steps:
|
|
9
|
-
- checkout
|
|
10
|
-
- restore_cache:
|
|
11
|
-
keys:
|
|
12
|
-
- v1-dependencies-{{ checksum "package.json" }}
|
|
13
|
-
- v1-dependencies-
|
|
14
|
-
- run: npm install
|
|
15
|
-
- save_cache:
|
|
16
|
-
paths:
|
|
17
|
-
- node_modules
|
|
18
|
-
key: v1-dependencies-{{ checksum "package.json" }}
|
|
19
|
-
- run: npm run test
|
|
20
|
-
|
package/.eslintrc.json
DELETED
package/.prettierrc
DELETED
package/CONTRIBUTING.md
DELETED
package/jest.config.cjs
DELETED
package/tsconfig.cjs.json
DELETED
package/tsconfig.esm.json
DELETED
package/tsconfig.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2020",
|
|
4
|
-
"module": "commonjs",
|
|
5
|
-
"declaration": true,
|
|
6
|
-
"outDir": "./dist",
|
|
7
|
-
"strict": true,
|
|
8
|
-
"esModuleInterop": true,
|
|
9
|
-
"forceConsistentCasingInFileNames": true,
|
|
10
|
-
"types": ["node"],
|
|
11
|
-
"moduleResolution": "node"
|
|
12
|
-
},
|
|
13
|
-
"include": ["src/**/*"],
|
|
14
|
-
"exclude": [
|
|
15
|
-
"node_modules",
|
|
16
|
-
"dist",
|
|
17
|
-
"**/*.test.ts",
|
|
18
|
-
"src/utils/tests.utils.ts"
|
|
19
|
-
]
|
|
20
|
-
}
|