|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 6 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
783 bytes
|
| Line | |
|---|
| 1 | import { after } from '../../function/after.mjs';
|
|---|
| 2 | import { isEqualWith as isEqualWith$1 } from '../../predicate/isEqualWith.mjs';
|
|---|
| 3 |
|
|---|
| 4 | function isEqualWith(a, b, areValuesEqual) {
|
|---|
| 5 | if (typeof areValuesEqual !== 'function') {
|
|---|
| 6 | areValuesEqual = () => undefined;
|
|---|
| 7 | }
|
|---|
| 8 | return isEqualWith$1(a, b, (...args) => {
|
|---|
| 9 | const result = areValuesEqual(...args);
|
|---|
| 10 | if (result !== undefined) {
|
|---|
| 11 | return Boolean(result);
|
|---|
| 12 | }
|
|---|
| 13 | if (a instanceof Map && b instanceof Map) {
|
|---|
| 14 | return isEqualWith(Array.from(a), Array.from(b), after(2, areValuesEqual));
|
|---|
| 15 | }
|
|---|
| 16 | if (a instanceof Set && b instanceof Set) {
|
|---|
| 17 | return isEqualWith(Array.from(a), Array.from(b), after(2, areValuesEqual));
|
|---|
| 18 | }
|
|---|
| 19 | });
|
|---|
| 20 | }
|
|---|
| 21 |
|
|---|
| 22 | export { isEqualWith };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.