launchdarkly-react-client-sdk
Advanced tools
Comparing version 3.0.0-alpha.2 to 3.0.0
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
@@ -10,0 +6,0 @@ if (k2 === undefined) k2 = k; |
@@ -52,3 +52,4 @@ "use strict"; | ||
const currentValue = Reflect.get(target, prop, receiver); | ||
if (typeof prop === 'symbol') { | ||
// only process flag keys and ignore symbols and native Object functions | ||
if (typeof prop === 'symbol' || !hasFlag(flagKeyMap, prop)) { | ||
return currentValue; | ||
@@ -59,5 +60,3 @@ } | ||
} | ||
const originalFlagKey = hasFlag(flagKeyMap, prop) ? flagKeyMap[prop] : prop; | ||
const nextValue = ldClient.variation(originalFlagKey, currentValue); | ||
return nextValue; | ||
return ldClient.variation(flagKeyMap[prop], currentValue); | ||
}, | ||
@@ -64,0 +63,0 @@ // disable all mutation functions to make proxy readonly |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
@@ -10,0 +6,0 @@ if (k2 === undefined) k2 = k; |
@@ -15,3 +15,3 @@ import { LDContext, LDFlagSet, LDOptions } from 'launchdarkly-js-client-sdk'; | ||
*/ | ||
declare const initLDClient: (clientSideID: string, context?: LDContext, options?: LDOptions, targetFlags?: LDFlagSet) => Promise<AllFlagsLDClient>; | ||
declare const initLDClient: (clientSideID: string, context?: LDContext, options?: LDOptions | undefined, targetFlags?: LDFlagSet | undefined) => Promise<AllFlagsLDClient>; | ||
export default initLDClient; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
@@ -10,0 +6,0 @@ if (k2 === undefined) k2 = k; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
@@ -10,0 +6,0 @@ if (k2 === undefined) k2 = k; |
@@ -90,3 +90,3 @@ import { LDClient, LDContext, LDFlagSet, LDOptions } from 'launchdarkly-js-client-sdk'; | ||
*/ | ||
export type AsyncProviderConfig = Omit<ProviderConfig, 'deferInitialization'> & { | ||
export declare type AsyncProviderConfig = Omit<ProviderConfig, 'deferInitialization'> & { | ||
/** | ||
@@ -93,0 +93,0 @@ * @deprecated - `asyncWithLDProvider` does not support the `deferInitialization` config option because |
@@ -42,3 +42,3 @@ import { LDClient, LDContext, LDFlagChangeset, LDFlagSet } from 'launchdarkly-js-client-sdk'; | ||
*/ | ||
export declare const fetchFlags: (ldClient: LDClient, targetFlags?: LDFlagSet) => LDFlagSet; | ||
export declare const fetchFlags: (ldClient: LDClient, targetFlags?: LDFlagSet | undefined) => LDFlagSet; | ||
declare const _default: { | ||
@@ -45,0 +45,0 @@ camelCaseKeys: { |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
@@ -10,0 +6,0 @@ if (k2 === undefined) k2 = k; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
@@ -10,0 +6,0 @@ if (k2 === undefined) k2 = k; |
{ | ||
"name": "launchdarkly-react-client-sdk", | ||
"version": "3.0.0-alpha.2", | ||
"version": "3.0.0", | ||
"description": "LaunchDarkly SDK for React", | ||
@@ -32,3 +32,4 @@ "author": "LaunchDarkly <team@launchdarkly.com>", | ||
"prettier": "prettier --write 'src/*.@(js|ts|tsx|json|css)'", | ||
"link-dev": "./link-dev.sh" | ||
"link-dev": "./link-dev.sh", | ||
"check": "npm i && npm run prettier && npm run lint && tsc && npm run test" | ||
}, | ||
@@ -68,3 +69,3 @@ "repository": { | ||
"hoist-non-react-statics": "^3.3.2", | ||
"launchdarkly-js-client-sdk": "^3.0.0-alpha.5", | ||
"launchdarkly-js-client-sdk": "^3.0.0", | ||
"lodash.camelcase": "^4.3.0" | ||
@@ -71,0 +72,0 @@ }, |
@@ -61,13 +61,15 @@ import { LDFlagSet, LDClient } from 'launchdarkly-js-client-sdk'; | ||
const currentValue = Reflect.get(target, prop, receiver); | ||
if (typeof prop === 'symbol') { | ||
// only process flag keys and ignore symbols and native Object functions | ||
if (typeof prop === 'symbol' || !hasFlag(flagKeyMap, prop)) { | ||
return currentValue; | ||
} | ||
if (currentValue === undefined) { | ||
return; | ||
} | ||
const originalFlagKey = hasFlag(flagKeyMap, prop) ? flagKeyMap[prop] : prop; | ||
const nextValue = ldClient.variation(originalFlagKey, currentValue); | ||
return nextValue; | ||
return ldClient.variation(flagKeyMap[prop], currentValue); | ||
}, | ||
// disable all mutation functions to make proxy readonly | ||
@@ -74,0 +76,0 @@ setPrototypeOf: () => false, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
100042
1783