groq-builder
Version:
A **schema-aware**, strongly-typed GROQ query builder. It enables you to build GROQ queries using **auto-completion**, **type-checking**, and **runtime validation**.
17 lines • 595 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const groq_builder_1 = require("../groq-builder");
groq_builder_1.GroqBuilder.implement({
nullable() {
const parser = this.parser;
if (!parser) {
// If there's no previous parser, then this method is just used
// for type-safety, and we don't need to perform runtime validation:
return this;
}
return this.chain("", (input) => {
return input === null ? null : parser(input);
});
},
});
//# sourceMappingURL=nullable.js.map