File size: 1,052 Bytes
bc20498 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Shared = void 0;
exports.beginShared = beginShared;
exports.terminateShared = terminateShared;
exports.getShared = getShared;
const comment_directives_1 = require("./comment-directives");
class Shared {
constructor() {
this.commentDirectives = [];
}
newCommentDirectives(options) {
const directives = new comment_directives_1.CommentDirectives(options);
this.commentDirectives.push(directives);
return directives;
}
}
exports.Shared = Shared;
const sharedMap = new Map();
/** Start sharing and make the data available. */
function beginShared(filename) {
sharedMap.set(filename, new Shared());
}
/** Get the shared data and end the sharing. */
function terminateShared(filename) {
const result = sharedMap.get(filename);
sharedMap.delete(filename);
return result ?? null;
}
/** If sharing has started, get the shared data. */
function getShared(filename) {
return sharedMap.get(filename) ?? null;
}
|