Skip to content

Commit 9c9b13f

Browse files
committed
disallow negative integer
1 parent 00e330b commit 9c9b13f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dictionary/parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,8 @@ const prepositionDefinition = checkedSimpleUnitWithTemplate(
295295
const numeralDefinition = checkedSimpleUnit("num")
296296
.mapWithPositionedError((num) => {
297297
const numeral = +num;
298-
if (!Number.isInteger(numeral)) {
299-
throw `"${num}" is not a number`;
298+
if (!Number.isInteger(numeral) || numeral < 0) {
299+
throw `"${num}" is not a non-negative integer`;
300300
} else {
301301
return { type: "numeral", numeral };
302302
}

0 commit comments

Comments
 (0)