MCPcopy Create free account
hub / github.com/ReactTraining/react-media / unwrapSingleQuery

Function unwrapSingleQuery

modules/Media.js:198–204  ·  view source on GitHub ↗

* Unwraps an object of queries, if it was originally passed as a single query.

(queryObject)

Source from the content-addressed store, hash-verified

196 * Unwraps an object of queries, if it was originally passed as a single query.
197 */
198function unwrapSingleQuery(queryObject) {
199 const queryNames = Object.keys(queryObject);
200 if (queryNames.length === 1 && queryNames[0] === "__DEFAULT__") {
201 return queryObject.__DEFAULT__;
202 }
203 return queryObject;
204}
205
206export default Media;

Callers 1

MediaClass · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…