@tungstenstudio/outschart-generator 1.0.0-rc.0 → 1.0.0-rc.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tungstenstudio/outschart-generator",
3
- "version": "1.0.0-rc.0",
3
+ "version": "1.0.0-rc.1",
4
4
  "description": "Darts outs/checkout chart generator with pre-computed lookups and a miss-aware recommendation engine",
5
5
  "type": "module",
6
6
  "sideEffects": false,
package/src/index.ts CHANGED
@@ -33,5 +33,4 @@ export {
33
33
 
34
34
  export { generateAllCheckouts } from './generate.js';
35
35
  export { generateRecommended } from './recommend.js';
36
- export { filterByPreferredTargets } from './filter.js';
37
36
  export { formatDart, formatCheckoutChart, NOTATIONS } from './notation.js';
package/src/filter.ts DELETED
@@ -1,35 +0,0 @@
1
- import type { EnumeratedCheckoutMap } from './types.js';
2
-
3
- function normalizeTargetLabel(str: string): string {
4
- if (str === 'Bull') return 'Bull';
5
- if (str === '25') return '25';
6
- const m = str.match(/^([SDT])(\d+)$/);
7
- if (m) {
8
- return m[1] === 'S' ? m[2] : `${m[1]}${m[2]}`;
9
- }
10
- if (/^\d+$/.test(str)) return str;
11
- return str;
12
- }
13
-
14
- export function filterByPreferredTargets(
15
- checkouts: EnumeratedCheckoutMap,
16
- preferredTargets: string[],
17
- ): EnumeratedCheckoutMap {
18
- const preferredLabels = new Set(preferredTargets.map(normalizeTargetLabel));
19
- const filtered: EnumeratedCheckoutMap = {};
20
-
21
- for (const [score, entry] of Object.entries(checkouts)) {
22
- const matching = entry.options.filter((darts) =>
23
- preferredLabels.has(darts[darts.length - 1]),
24
- );
25
-
26
- if (matching.length > 0) {
27
- filtered[Number(score)] = {
28
- options: matching,
29
- count: matching.length,
30
- };
31
- }
32
- }
33
-
34
- return filtered;
35
- }