Skip to content

Commit

Permalink
guard bool
Browse files Browse the repository at this point in the history
  • Loading branch information
ogroppo committed Sep 5, 2023
1 parent c23274d commit a34d14a
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# deverything

## 0.27.1

### Patch Changes

- guard bool

## 0.27.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": "0.27.0",
"version": "0.27.1",
"description": "Everything you need for Dev",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
Expand Down
6 changes: 6 additions & 0 deletions src/helpers/dir.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Print or log helper that does not break on circular references, and expands nested objects.
*/
export const dir = (arg: any, depth = 5): void => {
console.dir(arg, { depth });
};
1 change: 1 addition & 0 deletions src/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export * from "./arrayIntersection";
export * from "./capitalize";
export * from "./clamp";
export * from "./cleanSpaces";
export * from "./dir";
export * from "./first";
export * from "./firstKey";
export * from "./firstValue";
Expand Down
1 change: 1 addition & 0 deletions src/helpers/pretty.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { objectSerializer } from "../_internals/objectSerializer";

// TODO: deprecate and rename to stringify
export const pretty = (arg?: any) => {
return JSON.stringify(arg, objectSerializer(), 2);
};
2 changes: 1 addition & 1 deletion src/validators/isBoolean.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const isBoolean = (arg: any) =>
export const isBoolean = (arg: any): arg is boolean =>
Object.prototype.toString.call(arg) === "[object Boolean]";
2 changes: 1 addition & 1 deletion src/validators/isLastIndex.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const isLastIndex = (index: number, array: any[]) => {
export const isLastIndex = (index: number, array: any[]): boolean => {
return index === array.length - 1;
};
2 changes: 1 addition & 1 deletion src/validators/isValue.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Maybe } from "../types";

export const isValue = (arg?: Maybe<any>) => {
export const isValue = (arg?: Maybe<any>): boolean => {
return arg !== undefined && arg !== null && !Number.isNaN(arg);
};

0 comments on commit a34d14a

Please sign in to comment.