@lunora/flags 1.0.0-alpha.1 → 1.0.0-alpha.2
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
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { defineFlags, isFlagsDefinition } from './packem_shared/defineFlags-DAIO8cWQ.mjs';
|
|
2
|
-
export { createFlags } from './packem_shared/createFlags-
|
|
2
|
+
export { createFlags } from './packem_shared/createFlags-CAhOHjdv.mjs';
|
|
@@ -26,8 +26,13 @@ const resetFlags = async () => {
|
|
|
26
26
|
await OpenFeature.clearProviders();
|
|
27
27
|
};
|
|
28
28
|
const memoKey = (type, flagKey, defaultValue, context) => {
|
|
29
|
-
const
|
|
30
|
-
|
|
29
|
+
const contextKeys = Object.keys(context);
|
|
30
|
+
const prefix = JSON.stringify([type, flagKey, defaultValue]);
|
|
31
|
+
if (contextKeys.length === 0) {
|
|
32
|
+
return `${prefix}:[]`;
|
|
33
|
+
}
|
|
34
|
+
const entries = contextKeys.toSorted((a, b) => a.localeCompare(b)).map((name) => [name, context[name]]);
|
|
35
|
+
return `${prefix}:${JSON.stringify(entries)}`;
|
|
31
36
|
};
|
|
32
37
|
const resolveDetails = (client, type, flagKey, defaultValue, context) => {
|
|
33
38
|
switch (type) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/flags",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.2",
|
|
4
4
|
"description": "OpenFeature-based feature flags for Lunora — ctx.flags, useFlag, and a first-class Cloudflare Flagship provider with any OpenFeature provider pluggable",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|