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

@parcel/feature-flags

Package Overview
Dependencies
Maintainers
1
Versions
201
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parcel/feature-flags - npm Package Compare versions

Comparing version 2.12.1-nightly.3142 to 2.13.0

lib/types.d.ts

19

lib/index.js

@@ -7,4 +7,19 @@ "use strict";

exports.DEFAULT_FEATURE_FLAGS = void 0;
exports.getFeatureFlag = getFeatureFlag;
exports.setFeatureFlags = setFeatureFlags;
// We need to do these gymnastics as we don't want flow-to-ts to touch DEFAULT_FEATURE_FLAGS,
// but we want to export FeatureFlags for Flow
const DEFAULT_FEATURE_FLAGS = exports.DEFAULT_FEATURE_FLAGS = {
exampleFeature: false
};
exampleFeature: false,
useWatchmanWatcher: false,
importRetry: false
};
let featureFlagValues = {
...DEFAULT_FEATURE_FLAGS
};
function setFeatureFlags(flags) {
featureFlagValues = flags;
}
function getFeatureFlag(flagName) {
return featureFlagValues[flagName];
}

12

package.json
{
"name": "@parcel/feature-flags",
"version": "2.12.1-nightly.3142+40c370f09",
"description": "Blazing fast, zero configuration web application bundler",
"version": "2.13.0",
"description": "Provides internal feature-flags for the parcel codebase.",
"license": "MIT",

@@ -19,7 +19,11 @@ "publishConfig": {

"source": "src/index.js",
"types": "index.d.ts",
"types": "lib/types.d.ts",
"scripts": {
"build-ts": "mkdir -p lib && flow-to-ts src/types.js > lib/types.d.ts",
"check-ts": "tsc --noEmit lib/types.d.ts"
},
"engines": {
"node": ">= 16.0.0"
},
"gitHead": "40c370f09a1c4b7eee5a6ad2b1b74fb95a04f389"
"gitHead": "a53f8f3ba1025c7ea8653e9719e0a61ef9717079"
}
// @flow strict
export type FeatureFlags = {|
// This feature flag mostly exists to test the feature flag system, and doesn't have any build/runtime effect
+exampleFeature: boolean,
|};
import type {FeatureFlags as _FeatureFlags} from './types';
// We need to do these gymnastics as we don't want flow-to-ts to touch DEFAULT_FEATURE_FLAGS,
// but we want to export FeatureFlags for Flow
export type FeatureFlags = _FeatureFlags;
export const DEFAULT_FEATURE_FLAGS: FeatureFlags = {
exampleFeature: false,
useWatchmanWatcher: false,
importRetry: false,
};
let featureFlagValues: FeatureFlags = {...DEFAULT_FEATURE_FLAGS};
export function setFeatureFlags(flags: FeatureFlags) {
featureFlagValues = flags;
}
export function getFeatureFlag(flagName: $Keys<FeatureFlags>): boolean {
return featureFlagValues[flagName];
}
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