Skip to content

Commit

Permalink
feat: rename to isEmptyString
Browse files Browse the repository at this point in the history
Signed-off-by: David Dal Busco <[email protected]>
  • Loading branch information
peterpeterparker committed Dec 16, 2024
1 parent a57cdd8 commit 301ca68
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- Expose a few additional types related to snapshots in `ic-management`.
- Add support for `get_subnet_types_to_subnets` to `@dfinity/cmc`.
- Support `VotingPowerEconomics`, `potential_voting_power` and `deciding_voting_power` in `@dfinity/nns`.
- Add utility `emptyString` (the opposite of existing `notEmptyString`).
- Add utility `isEmptyString` (the opposite of existing `notEmptyString`).

# 2024.11.27-1230Z

Expand Down
10 changes: 5 additions & 5 deletions packages/utils/src/utils/nullish.utils.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
emptyString,
isEmptyString,
isNullish,
nonNullish,
notEmptyString,
Expand Down Expand Up @@ -50,10 +50,10 @@ describe("nullish-utils", () => {

describe("emptyString", () => {
it("should determine empty", () => {
expect(emptyString(null)).toBeTruthy();
expect(emptyString(undefined)).toBeTruthy();
expect(emptyString("")).toBeTruthy();
expect(emptyString("test")).toBeFalsy();
expect(isEmptyString(null)).toBeTruthy();
expect(isEmptyString(undefined)).toBeTruthy();
expect(isEmptyString("")).toBeTruthy();
expect(isEmptyString("test")).toBeFalsy();
});
});
});
2 changes: 1 addition & 1 deletion packages/utils/src/utils/nullish.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ export const notEmptyString = (value: string | undefined | null): boolean =>
* @param {string | undefined | null} value - The value to check.
* @returns {boolean} `true` if the value is null, undefined, or an empty string; otherwise, `false`.
*/
export const emptyString = (value: string | undefined | null): boolean =>
export const isEmptyString = (value: string | undefined | null): boolean =>
!notEmptyString(value);

0 comments on commit 301ca68

Please sign in to comment.