Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

launchdarkly-react-client-sdk

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

launchdarkly-react-client-sdk - npm Package Compare versions

Comparing version 3.0.0-alpha.2 to 3.0.0

6

lib/asyncWithLDProvider.js
"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;

7

lib/getFlagsProxy.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc