Initial commit
This commit is contained in:
24
node_modules/@astrojs/vue/dist/context.js
generated
vendored
Normal file
24
node_modules/@astrojs/vue/dist/context.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
const contexts = /* @__PURE__ */ new WeakMap();
|
||||
const ID_PREFIX = "s";
|
||||
function getContext(rendererContextResult) {
|
||||
if (contexts.has(rendererContextResult)) {
|
||||
return contexts.get(rendererContextResult);
|
||||
}
|
||||
const ctx = {
|
||||
currentIndex: 0,
|
||||
get id() {
|
||||
return ID_PREFIX + this.currentIndex.toString();
|
||||
}
|
||||
};
|
||||
contexts.set(rendererContextResult, ctx);
|
||||
return ctx;
|
||||
}
|
||||
function incrementId(rendererContextResult) {
|
||||
const ctx = getContext(rendererContextResult);
|
||||
const id = ctx.id;
|
||||
ctx.currentIndex++;
|
||||
return id;
|
||||
}
|
||||
export {
|
||||
incrementId
|
||||
};
|
||||
Reference in New Issue
Block a user