MCPcopy
hub / github.com/chartjs/Chart.js / setsEqual

Function setsEqual

src/helpers/helpers.core.ts:396–408  ·  view source on GitHub ↗
(a: Set<T>, b: Set<T>)

Source from the content-addressed store, hash-verified

394
395// Adapted from https://stackoverflow.com/questions/31128855/comparing-ecma6-sets-for-equality#31129384
396export const setsEqual = <T>(a: Set<T>, b: Set<T>) => {
397 if (a.size !== b.size) {
398 return false;
399 }
400
401 for (const item of a) {
402 if (!b.has(item)) {
403 return false;
404 }
405 }
406
407 return true;
408};
409
410/**
411 * @param e - The event

Callers 2

_checkEventBindingsMethod · 0.85

Calls 1

hasMethod · 0.80

Tested by

no test coverage detected