MCPcopy Create free account
hub / github.com/AlexErrant/Pentive / handleComparison

Function handleComparison

shared-dom/src/language/query2sql.ts:852–868  ·  view source on GitHub ↗
(
	msSinceEpoch: number,
	context: Context,
	table: 'firstReview' | 'review' | 'note' | 'card' | undefined,
	column: 'created' | 'edited' | 'due',
	node: QueryString,
)

Source from the content-addressed store, hash-verified

850}
851
852function handleComparison(
853 msSinceEpoch: number,
854 context: Context,
855 table: 'firstReview' | 'review' | 'note' | 'card' | undefined,
856 column: 'created' | 'edited' | 'due',
857 node: QueryString,
858) {
859 if (node.comparison === '=') {
860 context.trustedSql('(')
861 handleOneComparison(msSinceEpoch, context, table, column, '>=')
862 context.trustedSql('AND')
863 handleOneComparison(msSinceEpoch + dayInMs, context, table, column, '<')
864 context.trustedSql(')')
865 } else {
866 handleOneComparison(msSinceEpoch, context, table, column, node.comparison)
867 }
868}
869
870function handleOneComparison(
871 val: number,

Callers 1

handleCreatedEditedDueFunction · 0.85

Calls 2

handleOneComparisonFunction · 0.85
trustedSqlMethod · 0.80

Tested by

no test coverage detected