Skip to content

Commit

Permalink
fix(core-helpers): remove type guard from isEmpty* predicates
Browse files Browse the repository at this point in the history
  • Loading branch information
ifiokjr committed Jul 27, 2020
1 parent 1fcdcff commit d8aa243
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/tiny-bees-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@remirror/core-helpers': minor
---

Remove type guard from `isEmptyArray` and `isEmptyObject` as they were incorrect.
5 changes: 2 additions & 3 deletions packages/@remirror/core-helpers/src/core-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { __INTERNAL_REMIRROR_IDENTIFIER_KEY__, RemirrorIdentifier } from '@remir
import {
AnyConstructor,
AnyFunction,
EmptyShape,
Nullable,
Predicate,
RemirrorIdentifierShape,
Expand Down Expand Up @@ -439,7 +438,7 @@ export function isSet(value: unknown): value is Set<unknown> {
*
* @public
*/
export function isEmptyObject(value: unknown): value is EmptyShape {
export function isEmptyObject(value: unknown) {
return isObject(value) && !isMap(value) && !isSet(value) && Object.keys(value).length === 0;
}

Expand All @@ -455,7 +454,7 @@ export const isArray = Array.isArray;
*
* @public
*/
export function isEmptyArray(value: unknown): value is never[] {
export function isEmptyArray(value: unknown) {
return isArray(value) && value.length === 0;
}

Expand Down

0 comments on commit d8aa243

Please sign in to comment.