@fbkworks/adapter-core 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +8 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -136,9 +136,16 @@ function useAdapter() {
|
|
|
136
136
|
'[fbk] \u672A\u627E\u5230 UI \u9002\u914D\u5668\u3002\u8BF7\u5728\u5E94\u7528\u5165\u53E3\u6267\u884C\uFF1A\n app.use(createBusinessKit({ adapter: elementPlusAdapter }))\n\u6216\u5728\u5C40\u90E8\u4F7F\u7528\uFF1A<FbkProvider :adapter="adapter">\u3002\n\u6587\u6863\uFF1A/guide/adapters'
|
|
137
137
|
);
|
|
138
138
|
}
|
|
139
|
-
|
|
139
|
+
validateOnce(ctx.adapter);
|
|
140
140
|
return ctx.adapter;
|
|
141
141
|
}
|
|
142
|
+
const validatedAdapters = /* @__PURE__ */ new WeakSet();
|
|
143
|
+
function validateOnce(adapter) {
|
|
144
|
+
if (validatedAdapters.has(adapter)) return;
|
|
145
|
+
assertAdapterVersion(adapter);
|
|
146
|
+
assertAdapterCompatible(adapter);
|
|
147
|
+
validatedAdapters.add(adapter);
|
|
148
|
+
}
|
|
142
149
|
function assertAdapterVersion(adapter) {
|
|
143
150
|
const actual = adapter.meta?.apiVersion;
|
|
144
151
|
if (actual !== ADAPTER_API_VERSION) {
|