MCPcopy
hub / github.com/webpack/webpack / runtimeEqual

Function runtimeEqual

lib/util/runtime.js:150–173  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

148 * @returns {boolean} true, when they are equal
149 */
150const runtimeEqual = (a, b) => {
151 if (a === b) {
152 return true;
153 } else if (
154 a === undefined ||
155 b === undefined ||
156 typeof a === "string" ||
157 typeof b === "string"
158 ) {
159 return false;
160 } else if (a.size !== b.size) {
161 return false;
162 }
163 a.sort();
164 b.sort();
165 const aIt = a[Symbol.iterator]();
166 const bIt = b[Symbol.iterator]();
167 for (;;) {
168 const aV = aIt.next();
169 if (aV.done) return true;
170 const bV = bIt.next();
171 if (aV.value !== bV.value) return false;
172 }
173};
174
175/**
176 * Compares the provided values and returns their ordering.

Callers 7

applyMethod · 0.85
getMethod · 0.85
hasMethod · 0.85
setMethod · 0.85
provideMethod · 0.85
deleteMethod · 0.85
updateMethod · 0.85

Calls 2

sortMethod · 0.80
nextMethod · 0.45

Tested by

no test coverage detected