MCPcopy Index your code
hub / github.com/plotly/dash / idValSort

Function idValSort

dash/dash-renderer/src/actions/dependencies.js:134–152  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

132 * - non-numeric strings come last
133 */
134function idValSort(a, b) {
135 const bIsNumeric = isNumeric(b);
136 if (isNumeric(a)) {
137 if (bIsNumeric) {
138 const aN = Number(a);
139 const bN = Number(b);
140 return aN > bN ? 1 : aN < bN ? -1 : 0;
141 }
142 return -1;
143 }
144 if (bIsNumeric) {
145 return 1;
146 }
147 const aIsBool = typeof a === 'boolean';
148 if (aIsBool !== (typeof b === 'boolean')) {
149 return aIsBool ? -1 : 1;
150 }
151 return a > b ? 1 : a < b ? -1 : 0;
152}
153
154/*
155 * Provide a value known to be before or after v, according to idValSort

Callers 1

idMatchFunction · 0.85

Calls 1

isNumericFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…