intial
This commit is contained in:
26
node_modules/eslint-plugin-svelte/lib/shared/index.js
generated
vendored
Normal file
26
node_modules/eslint-plugin-svelte/lib/shared/index.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
import { CommentDirectives } from './comment-directives.js';
|
||||
export class Shared {
|
||||
constructor() {
|
||||
this.commentDirectives = [];
|
||||
}
|
||||
newCommentDirectives(options) {
|
||||
const directives = new CommentDirectives(options);
|
||||
this.commentDirectives.push(directives);
|
||||
return directives;
|
||||
}
|
||||
}
|
||||
const sharedMap = new Map();
|
||||
/** Start sharing and make the data available. */
|
||||
export function beginShared(filename) {
|
||||
sharedMap.set(filename, new Shared());
|
||||
}
|
||||
/** Get the shared data and end the sharing. */
|
||||
export function terminateShared(filename) {
|
||||
const result = sharedMap.get(filename);
|
||||
sharedMap.delete(filename);
|
||||
return result ?? null;
|
||||
}
|
||||
/** If sharing has started, get the shared data. */
|
||||
export function getShared(filename) {
|
||||
return sharedMap.get(filename) ?? null;
|
||||
}
|
||||
Reference in New Issue
Block a user