Skip to content

Commit

Permalink
fix: is number greater/less than functions
Browse files Browse the repository at this point in the history
  • Loading branch information
izatop committed Sep 1, 2023
1 parent 6f50c36 commit f2d8294
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
8 changes: 8 additions & 0 deletions packages/is/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ export const isNumber = (value: unknown): value is number => {
return typeof value === "number" && value === +value;
};

export const isNumberGreaterThan = (value: unknown, than: number): value is number => (
isNumber(value) && value > than
);

export const isNumberLessThan = (value: unknown, than: number): value is number => (
isNumber(value) && value < than
);

export const isNullish = (value: unknown): value is null | undefined => isNull(value) || isUndefined(value);
export const isNotNullish = <T>(value: T | null | undefined): value is T => !isNullish(value);

Expand Down
24 changes: 12 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -417,15 +417,15 @@ __metadata:
languageName: node
linkType: hard

"@bunt/app@^0.29.16, @bunt/app@workspace:packages/app":
"@bunt/app@^0.29.17, @bunt/app@workspace:packages/app":
version: 0.0.0-use.local
resolution: "@bunt/app@workspace:packages/app"
dependencies:
"@bunt/assert": ^0.29.16
"@bunt/async": ^0.29.16
"@bunt/input": ^0.29.16
"@bunt/is": ^0.29.16
"@bunt/unit": ^0.29.16
"@bunt/unit": ^0.29.17
"@bunt/util": ^0.29.16
"@types/busboy": ^1.5.0
busboy: ^1.6.0
Expand Down Expand Up @@ -456,7 +456,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@bunt/cli@workspace:packages/cli"
dependencies:
"@bunt/app": ^0.29.16
"@bunt/app": ^0.29.17
"@bunt/assert": ^0.29.16
"@bunt/util": ^0.29.16
path-to-regexp: ^6.2.1
Expand All @@ -478,7 +478,7 @@ __metadata:
dependencies:
"@bunt/assert": ^0.29.16
"@bunt/is": ^0.29.16
"@bunt/unit": ^0.29.16
"@bunt/unit": ^0.29.17
"@types/minio": ^7.1.1
"@types/node-fetch": ^2.6.4
minio: ^7.1.2
Expand Down Expand Up @@ -509,7 +509,7 @@ __metadata:
resolution: "@bunt/queue@workspace:packages/queue"
dependencies:
"@bunt/async": ^0.29.16
"@bunt/unit": ^0.29.16
"@bunt/unit": ^0.29.17
"@bunt/util": ^0.29.16
ioredis: ^5.3.2
languageName: unknown
Expand All @@ -523,7 +523,7 @@ __metadata:
"@bunt/async": ^0.29.16
"@bunt/is": ^0.29.16
"@bunt/type": ^0.29.16
"@bunt/unit": ^0.29.16
"@bunt/unit": ^0.29.17
languageName: unknown
linkType: soft

Expand All @@ -533,7 +533,7 @@ __metadata:
languageName: unknown
linkType: soft

"@bunt/unit@^0.29.16, @bunt/unit@workspace:packages/unit":
"@bunt/unit@^0.29.17, @bunt/unit@workspace:packages/unit":
version: 0.0.0-use.local
resolution: "@bunt/unit@workspace:packages/unit"
dependencies:
Expand All @@ -556,11 +556,11 @@ __metadata:
languageName: unknown
linkType: soft

"@bunt/web@^0.29.16, @bunt/web@workspace:packages/web":
"@bunt/web@^0.29.17, @bunt/web@workspace:packages/web":
version: 0.0.0-use.local
resolution: "@bunt/web@workspace:packages/web"
dependencies:
"@bunt/app": ^0.29.16
"@bunt/app": ^0.29.17
"@bunt/assert": ^0.29.16
"@bunt/async": ^0.29.16
"@bunt/is": ^0.29.16
Expand All @@ -575,14 +575,14 @@ __metadata:
version: 0.0.0-use.local
resolution: "@bunt/ws@workspace:packages/ws"
dependencies:
"@bunt/app": ^0.29.16
"@bunt/app": ^0.29.17
"@bunt/assert": ^0.29.16
"@bunt/async": ^0.29.16
"@bunt/is": ^0.29.16
"@bunt/type": ^0.29.16
"@bunt/unit": ^0.29.16
"@bunt/unit": ^0.29.17
"@bunt/util": ^0.29.16
"@bunt/web": ^0.29.16
"@bunt/web": ^0.29.17
"@types/websocket": ^1.0.6
"@types/ws": ^8.5.5
websocket: ^1.0.34
Expand Down

0 comments on commit f2d8294

Please sign in to comment.