@inrupt/experimental-graphql-directives-linked-data
Version:
GraphQL directives for Linked Data
17 lines (16 loc) • 462 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.asTerm = void 0;
function isTerm(input) {
return (typeof input === "object" &&
input !== null &&
typeof input.termType === "string" &&
typeof input.value === "string");
}
function asTerm(input) {
if (!isTerm(input)) {
throw new Error(`Expected RDF/JS term, instead received ${input}`);
}
return input;
}
exports.asTerm = asTerm;
;