Skip to content

Commit

Permalink
Make a type declaration stronger
Browse files Browse the repository at this point in the history
  • Loading branch information
opyh committed Sep 5, 2024
1 parent e6bb993 commit 3de9c50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Quantity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export type Acceleration = Quantity | string;
export type Hertz = Quantity | string;
export type Temperature = Quantity | string;

export function parseQuantity(unitString: string): Quantity | string {
export function parseQuantity(unitString: string): Quantity {
const matches = unitString.match(
/^(>|<|<=|>=|=|==|~|~=|!=)? *([+-])? *(\d+(?:\.\d+)?)(?: *(\.\.\.?) *([+-])? *(\d+(?:\.\d+)?))? *(.+)?$/,
) || [];
Expand Down

0 comments on commit 3de9c50

Please sign in to comment.