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

@clds/feature-flags

Package Overview
Dependencies
Maintainers
2
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@clds/feature-flags - npm Package Compare versions

Comparing version 0.7.4 to 0.7.5

2

dist/cjs/createFeatureFlag.d.ts
export declare const createLocalStorageFeatureFlag: (key: string) => {
isEnabled: () => boolean;
setEnabled: (enabled: boolean) => void;
setEnabled: (enabled: boolean) => string | void;
whenEnabled: <T>(valueWhenEnabled: T) => {

@@ -5,0 +5,0 @@ orElse: (defaultValue: T) => T;

@@ -12,3 +12,12 @@ "use strict";

};
const getLocalStorageImpl = () => { var _a; return (_a = global.localStorage) !== null && _a !== void 0 ? _a : getInMemoryStorageImpl(); };
const getLocalStorageImpl = () => { var _a; return (_a = tryGetLocalStorage()) !== null && _a !== void 0 ? _a : getInMemoryStorageImpl(); };
const tryGetLocalStorage = () => {
try {
return global.localStorage;
}
catch (e) {
console.error('@clds/feature-flags: could not access localStorage');
return null;
}
};
const createLocalStorageFeatureFlag = (key) => {

@@ -15,0 +24,0 @@ const localStorageImpl = getLocalStorageImpl();

export declare const quickWinsTypography: {
isEnabled: () => boolean;
setEnabled: (enabled: boolean) => void;
setEnabled: (enabled: boolean) => string | void;
whenEnabled: <T>(valueWhenEnabled: T) => {

@@ -5,0 +5,0 @@ orElse: (defaultValue: T) => T;

export declare const createLocalStorageFeatureFlag: (key: string) => {
isEnabled: () => boolean;
setEnabled: (enabled: boolean) => void;
setEnabled: (enabled: boolean) => string | void;
whenEnabled: <T>(valueWhenEnabled: T) => {

@@ -5,0 +5,0 @@ orElse: (defaultValue: T) => T;

@@ -9,3 +9,12 @@ const getInMemoryStorageImpl = () => {

};
const getLocalStorageImpl = () => { var _a; return (_a = global.localStorage) !== null && _a !== void 0 ? _a : getInMemoryStorageImpl(); };
const getLocalStorageImpl = () => { var _a; return (_a = tryGetLocalStorage()) !== null && _a !== void 0 ? _a : getInMemoryStorageImpl(); };
const tryGetLocalStorage = () => {
try {
return global.localStorage;
}
catch (e) {
console.error('@clds/feature-flags: could not access localStorage');
return null;
}
};
export const createLocalStorageFeatureFlag = (key) => {

@@ -12,0 +21,0 @@ const localStorageImpl = getLocalStorageImpl();

export declare const quickWinsTypography: {
isEnabled: () => boolean;
setEnabled: (enabled: boolean) => void;
setEnabled: (enabled: boolean) => string | void;
whenEnabled: <T>(valueWhenEnabled: T) => {

@@ -5,0 +5,0 @@ orElse: (defaultValue: T) => T;

{
"name": "@clds/feature-flags",
"description": "",
"version": "0.7.4",
"version": "0.7.5",
"author": "Cloudinary",

@@ -6,0 +6,0 @@ "main": "./dist/cjs/index.js",

@@ -12,4 +12,13 @@ const getInMemoryStorageImpl = () => {

const getLocalStorageImpl = () =>
global.localStorage ?? getInMemoryStorageImpl();
tryGetLocalStorage() ?? getInMemoryStorageImpl();
const tryGetLocalStorage = () => {
try {
return global.localStorage;
} catch (e) {
console.error('@clds/feature-flags: could not access localStorage');
return null;
}
};
export const createLocalStorageFeatureFlag = (key: string) => {

@@ -16,0 +25,0 @@ const localStorageImpl = getLocalStorageImpl();

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