@envelop/core
Version:
This is the core package for Envelop. You can find a complete documentation here: https://github.com/n1ru4l/envelop
11 lines (10 loc) • 352 B
JavaScript
export const documentStringMap = new WeakMap();
function getDocumentString(document, print) {
let documentSource = documentStringMap.get(document);
if (!documentSource && print) {
documentSource = print(document);
documentStringMap.set(document, documentSource);
}
return documentSource;
}
export { getDocumentString };