MCPcopy Index your code
hub / github.com/callumalpass/tasknotes / normalizeRuntimeTaskQuery

Method normalizeRuntimeTaskQuery

src/api/TaskNotesAPI.ts:1226–1252  ·  view source on GitHub ↗
(
		query: unknown,
		issues: TaskNotesRuntimeQueryIssue[],
		warnings: TaskNotesRuntimeQueryWarning[]
	)

Source from the content-addressed store, hash-verified

1224 }
1225
1226 private normalizeRuntimeTaskQuery(
1227 query: unknown,
1228 issues: TaskNotesRuntimeQueryIssue[],
1229 warnings: TaskNotesRuntimeQueryWarning[]
1230 ): TaskNotesRuntimeNormalizedTaskQuery {
1231 if (query == null) return emptyRuntimeTaskQuery();
1232 if (!isRecord(query)) {
1233 issues.push({
1234 path: "$",
1235 code: "query_not_object",
1236 message: "Runtime task query must be an object.",
1237 });
1238 return emptyRuntimeTaskQuery();
1239 }
1240
1241 const where =
1242 typeof query["where"] === "undefined"
1243 ? undefined
1244 : this.normalizeRuntimePredicate(query["where"], "$.where", issues);
1245 const sort = this.normalizeRuntimeSorts(query["sort"], issues, warnings);
1246 const group = this.normalizeRuntimeGroups(query["group"], issues, warnings);
1247 const limit = normalizeRuntimeLimit(query["limit"], "$.limit", issues);
1248 const offset = normalizeRuntimeOffset(query["offset"], "$.offset", issues);
1249 const scope = normalizeRuntimeScope(query["scope"], issues);
1250
1251 return { where, sort, limit, offset, group, scope };
1252 }
1253
1254 private normalizeRuntimePredicate(
1255 predicate: unknown,

Callers 1

Calls 8

normalizeRuntimeSortsMethod · 0.95
emptyRuntimeTaskQueryFunction · 0.85
normalizeRuntimeLimitFunction · 0.85
normalizeRuntimeOffsetFunction · 0.85
normalizeRuntimeScopeFunction · 0.85
isRecordFunction · 0.70

Tested by

no test coverage detected