Skip to content

Commit

Permalink
randomEmptyValue
Browse files Browse the repository at this point in the history
  • Loading branch information
ogroppo committed Aug 11, 2024
1 parent 0381e96 commit 6553be2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# deverything

## 1.3.0

### Minor Changes

- randomEmptyValue

## 1.2.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "deverything",
"version": "1.2.0",
"version": "1.3.0",
"description": "Everything you need for Dev",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
Expand Down
1 change: 1 addition & 0 deletions src/random/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export * from "./randomCoords";
export * from "./randomDate";
export * from "./randomEmail";
export * from "./randomEmoji";
export * from "./randomEmptyValue";
export * from "./randomEnumKey";
export * from "./randomEnumValue";
export * from "./randomFile";
Expand Down
5 changes: 5 additions & 0 deletions src/random/randomEmptyValue.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { randomArrayItem } from "./randomArrayItem";

export const randomEmptyValue = () => {
return randomArrayItem([undefined, null, NaN, Infinity]);
};
5 changes: 1 addition & 4 deletions src/random/randomValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { randomBigInt, randomInt } from "./randomInt";
import { randomString } from "./randomString";
import { randomSymbol } from "./randomSymbol";

// This must return true with `isValue` assertion
export const randomValue = () => {
return randomArrayItem([
randomBool(),
Expand All @@ -13,9 +14,5 @@ export const randomValue = () => {
randomDate(),
randomBigInt(),
randomSymbol(),
undefined,
null,
NaN,
Infinity,
]);
};

0 comments on commit 6553be2

Please sign in to comment.