full site update
This commit is contained in:
14
node_modules/astro/dist/content/data-store.js
generated
vendored
14
node_modules/astro/dist/content/data-store.js
generated
vendored
@@ -1,5 +1,5 @@
|
||||
import * as devalue from "devalue";
|
||||
class DataStore {
|
||||
class ImmutableDataStore {
|
||||
_collections = /* @__PURE__ */ new Map();
|
||||
constructor() {
|
||||
this._collections = /* @__PURE__ */ new Map();
|
||||
@@ -40,16 +40,16 @@ class DataStore {
|
||||
try {
|
||||
const data = await import("astro:data-layer-content");
|
||||
if (data.default instanceof Map) {
|
||||
return DataStore.fromMap(data.default);
|
||||
return ImmutableDataStore.fromMap(data.default);
|
||||
}
|
||||
const map = devalue.unflatten(data.default);
|
||||
return DataStore.fromMap(map);
|
||||
return ImmutableDataStore.fromMap(map);
|
||||
} catch {
|
||||
}
|
||||
return new DataStore();
|
||||
return new ImmutableDataStore();
|
||||
}
|
||||
static async fromMap(data) {
|
||||
const store = new DataStore();
|
||||
const store = new ImmutableDataStore();
|
||||
store._collections = data;
|
||||
return store;
|
||||
}
|
||||
@@ -59,7 +59,7 @@ function dataStoreSingleton() {
|
||||
return {
|
||||
get: async () => {
|
||||
if (!instance) {
|
||||
instance = DataStore.fromModule();
|
||||
instance = ImmutableDataStore.fromModule();
|
||||
}
|
||||
return instance;
|
||||
},
|
||||
@@ -70,6 +70,6 @@ function dataStoreSingleton() {
|
||||
}
|
||||
const globalDataStore = dataStoreSingleton();
|
||||
export {
|
||||
DataStore,
|
||||
ImmutableDataStore,
|
||||
globalDataStore
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user