Skip to content

Commit

Permalink
Created sameValues helper.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexiglesias93 committed Nov 2, 2021
1 parent 83f53a3 commit e7eaa1d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export { isVisible } from './isVisible';
export { queryElement } from './queryElement';
export { removeChildElements } from './removeChildElements';
export { removeSpaces } from './removeSpaces';
export { sameValues } from './sameValues';
export { selectInputElement } from './selectInputElement';
export { setFormFieldValue } from './setFormFieldValue';
export { simulateEvent } from './simulateEvent';
Expand Down
7 changes: 7 additions & 0 deletions helpers/sameValues.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* Compares if two arrays have the same exact values.
* @param array1
* @param array2
*/
// prettier-ignore
export const sameValues = (array1: unknown[], array2: unknown[]): boolean => array1.every((key) => array2.includes(key)) && array2.every((key) => array1.includes(key));
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@finsweet/ts-utils",
"version": "0.20.2",
"version": "0.21.0",
"description": "Typescript utils for custom Webflow projects.",
"main": "index.ts",
"module": "index.ts",
Expand Down

0 comments on commit e7eaa1d

Please sign in to comment.