Skip to content

Commit

Permalink
update util
Browse files Browse the repository at this point in the history
  • Loading branch information
severinlandolt committed May 25, 2024
1 parent 0be0113 commit a5b9ab2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/utils/hasOnlyOneValueForKey.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
// Tremor Raw hasOnlyOneValueForKey [v0.1.0]

export function hasOnlyOneValueForKey(array: any[], keyToCheck: string) {
const val = []
export function hasOnlyOneValueForKey(
array: any[],
keyToCheck: string,
): boolean {
const val: any[] = []

for (const obj of array) {
if (Object.prototype.hasOwnProperty.call(obj, keyToCheck)) {
Expand Down

0 comments on commit a5b9ab2

Please sign in to comment.