@envelop/core
Version:
This is the core package for Envelop. You can find a complete documentation here: https://github.com/n1ru4l/envelop
14 lines (13 loc) • 493 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.documentStringMap = void 0;
exports.getDocumentString = getDocumentString;
exports.documentStringMap = new WeakMap();
function getDocumentString(document, print) {
let documentSource = exports.documentStringMap.get(document);
if (!documentSource && print) {
documentSource = print(document);
exports.documentStringMap.set(document, documentSource);
}
return documentSource;
}
;