@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/README.md +2 -13
- package/dist/index.cjs +0 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -3
- package/dist/index.d.ts +1 -3
- package/dist/index.js +0 -29
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +0 -1
- package/src/filter.ts +0 -35
package/dist/index.d.cts
CHANGED
|
@@ -102,6 +102,4 @@ declare function generateRecommended(options: {
|
|
|
102
102
|
}>;
|
|
103
103
|
}): CheckoutResult;
|
|
104
104
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
export { type BedType, type CheckoutChart, type CheckoutEntry, type CheckoutResult, type EnumeratedCheckoutMap, type EnumeratedEntry, type EnumeratedResult, type EvaluatedMiss, type FormattedTarget, type GenerateOptions, type MissTarget, type MissType, NOTATIONS, type NotationMap, type OutMode, OutsChartError, type OutsChartErrorCode, type ParsedTarget, type RecommendOptions, type ThrowEvaluation, filterByPreferredTargets, formatCheckoutChart, formatDart, formatTarget, generateAllCheckouts, generateRecommended, getBogeyNumbers, getCheckout, getCheckoutChart, isCheckable, parseTarget };
|
|
105
|
+
export { type BedType, type CheckoutChart, type CheckoutEntry, type CheckoutResult, type EnumeratedCheckoutMap, type EnumeratedEntry, type EnumeratedResult, type EvaluatedMiss, type FormattedTarget, type GenerateOptions, type MissTarget, type MissType, NOTATIONS, type NotationMap, type OutMode, OutsChartError, type OutsChartErrorCode, type ParsedTarget, type RecommendOptions, type ThrowEvaluation, formatCheckoutChart, formatDart, formatTarget, generateAllCheckouts, generateRecommended, getBogeyNumbers, getCheckout, getCheckoutChart, isCheckable, parseTarget };
|
package/dist/index.d.ts
CHANGED
|
@@ -102,6 +102,4 @@ declare function generateRecommended(options: {
|
|
|
102
102
|
}>;
|
|
103
103
|
}): CheckoutResult;
|
|
104
104
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
export { type BedType, type CheckoutChart, type CheckoutEntry, type CheckoutResult, type EnumeratedCheckoutMap, type EnumeratedEntry, type EnumeratedResult, type EvaluatedMiss, type FormattedTarget, type GenerateOptions, type MissTarget, type MissType, NOTATIONS, type NotationMap, type OutMode, OutsChartError, type OutsChartErrorCode, type ParsedTarget, type RecommendOptions, type ThrowEvaluation, filterByPreferredTargets, formatCheckoutChart, formatDart, formatTarget, generateAllCheckouts, generateRecommended, getBogeyNumbers, getCheckout, getCheckoutChart, isCheckable, parseTarget };
|
|
105
|
+
export { type BedType, type CheckoutChart, type CheckoutEntry, type CheckoutResult, type EnumeratedCheckoutMap, type EnumeratedEntry, type EnumeratedResult, type EvaluatedMiss, type FormattedTarget, type GenerateOptions, type MissTarget, type MissType, NOTATIONS, type NotationMap, type OutMode, OutsChartError, type OutsChartErrorCode, type ParsedTarget, type RecommendOptions, type ThrowEvaluation, formatCheckoutChart, formatDart, formatTarget, generateAllCheckouts, generateRecommended, getBogeyNumbers, getCheckout, getCheckoutChart, isCheckable, parseTarget };
|
package/dist/index.js
CHANGED
|
@@ -1060,34 +1060,6 @@ function generateRecommended(options) {
|
|
|
1060
1060
|
return { checkouts, bogeyNumbers };
|
|
1061
1061
|
}
|
|
1062
1062
|
|
|
1063
|
-
// src/filter.ts
|
|
1064
|
-
function normalizeTargetLabel(str) {
|
|
1065
|
-
if (str === "Bull") return "Bull";
|
|
1066
|
-
if (str === "25") return "25";
|
|
1067
|
-
const m = str.match(/^([SDT])(\d+)$/);
|
|
1068
|
-
if (m) {
|
|
1069
|
-
return m[1] === "S" ? m[2] : `${m[1]}${m[2]}`;
|
|
1070
|
-
}
|
|
1071
|
-
if (/^\d+$/.test(str)) return str;
|
|
1072
|
-
return str;
|
|
1073
|
-
}
|
|
1074
|
-
function filterByPreferredTargets(checkouts, preferredTargets) {
|
|
1075
|
-
const preferredLabels = new Set(preferredTargets.map(normalizeTargetLabel));
|
|
1076
|
-
const filtered = {};
|
|
1077
|
-
for (const [score, entry] of Object.entries(checkouts)) {
|
|
1078
|
-
const matching = entry.options.filter(
|
|
1079
|
-
(darts) => preferredLabels.has(darts[darts.length - 1])
|
|
1080
|
-
);
|
|
1081
|
-
if (matching.length > 0) {
|
|
1082
|
-
filtered[Number(score)] = {
|
|
1083
|
-
options: matching,
|
|
1084
|
-
count: matching.length
|
|
1085
|
-
};
|
|
1086
|
-
}
|
|
1087
|
-
}
|
|
1088
|
-
return filtered;
|
|
1089
|
-
}
|
|
1090
|
-
|
|
1091
1063
|
// src/notation.ts
|
|
1092
1064
|
var NOTATIONS = {
|
|
1093
1065
|
default: { treble: "T", double: "D", single: "", bull: "Bull", outerBull: "25" },
|
|
@@ -1140,7 +1112,6 @@ function resolveNotation(notation) {
|
|
|
1140
1112
|
export {
|
|
1141
1113
|
NOTATIONS,
|
|
1142
1114
|
OutsChartError,
|
|
1143
|
-
filterByPreferredTargets,
|
|
1144
1115
|
formatCheckoutChart,
|
|
1145
1116
|
formatDart,
|
|
1146
1117
|
formatTarget,
|