MCPcopy
hub / github.com/Automattic/mongoose / _handleSortValue

Function _handleSortValue

lib/query.js:3188–3199  ·  view source on GitHub ↗
(val, key)

Source from the content-addressed store, hash-verified

3186 */
3187
3188function _handleSortValue(val, key) {
3189 if (val === 1 || val === 'asc' || val === 'ascending') {
3190 return 1;
3191 }
3192 if (val === -1 || val === 'desc' || val === 'descending') {
3193 return -1;
3194 }
3195 if (val?.$meta != null) {
3196 return { $meta: val.$meta };
3197 }
3198 throw new TypeError('Invalid sort value: { ' + key + ': ' + val + ' }');
3199}
3200
3201/**
3202 * Declare and/or execute this query as a `deleteOne()` operation. Works like

Callers 1

query.jsFile · 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…