Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const set = (host, next) => {
if (!next) return doc || null;
if (!isValidGql(next)) throw new Error(errorMessage);
if (onSet && typeof onSet === 'function') onSet(next);
return next;
};