Comparing version 1.1.0 to 1.1.1
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
var React = require('react'); | ||
@@ -4,0 +6,0 @@ |
@@ -1,2 +0,2 @@ | ||
"use strict";var e=require("react"),r=e.createContext(null);function t(){var t=e.useContext(r);if(null===t)throw new Error("You must wrap your components in a FlagsProvider.");return t}function n(e){var r=t();return Array.isArray(r)?r.includes(e):"boolean"==typeof r[e]?r[e]:e.split("/").reduce((function(e,r){return"boolean"==typeof e?e:void 0!==e[r]&&e[r]}),r)}exports.Feature=function(e){var r=e.render,t=void 0===r?e.children:r,o=n(e.name);return"function"==typeof t?t(o):o?t:null},exports.FlagsProvider=function(t){var n=t.features,o=t.children;if(!n||null===n||"object"!=typeof n)throw new TypeError("The features prop must be an object or an array.");return e.createElement(r.Provider,{value:n},o)},exports.useFeature=n,exports.useFeatures=t,exports.withFeature=function(r){return function(t){return function(o){return n(r)?e.createElement(t,Object.assign({},o)):null}}}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=e.createContext(null);function t(){var t=e.useContext(r);if(null===t)throw new Error("You must wrap your components in a FlagsProvider.");return t}function n(e){var r=t();return Array.isArray(r)?r.includes(e):"boolean"==typeof r[e]?r[e]:e.split("/").reduce((function(e,r){return"boolean"==typeof e?e:void 0!==e[r]&&e[r]}),r)}exports.Feature=function(e){var r=e.render,t=void 0===r?e.children:r,o=n(e.name);return"function"==typeof t?t(o):o?t:null},exports.FlagsProvider=function(t){var n=t.features,o=t.children;if(!n||null===n||"object"!=typeof n)throw new TypeError("The features prop must be an object or an array.");return e.createElement(r.Provider,{value:n},o)},exports.useFeature=n,exports.useFeatures=t,exports.withFeature=function(r){return function(t){return function(o){return n(r)?e.createElement(t,Object.assign({},o)):null}}}; | ||
//# sourceMappingURL=flagged.cjs.production.min.js.map |
@@ -12,3 +12,3 @@ import * as React from 'react'; | ||
export declare function useFeature(name: string): boolean | FeatureFlags; | ||
export declare function withFeature(featureName: string): (Component: Function) => (props: any) => JSX.Element | null; | ||
export declare function withFeature(featureName: string): (Component: Function) => (props: React.ComponentProps<any>) => JSX.Element | null; | ||
export declare function Feature({ name, children, render, }: { | ||
@@ -15,0 +15,0 @@ name: string; |
{ | ||
"name": "flagged", | ||
"description": "Feature flags for React made easy with hooks, HOC and Render Props", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"license": "MIT", | ||
@@ -57,14 +57,14 @@ "repository": "https://github.com/sergiodxa/flagged.git", | ||
"devDependencies": { | ||
"@testing-library/jest-dom": "^4.2.0", | ||
"@testing-library/react": "^9.3.0", | ||
"@types/jest": "^24.0.19", | ||
"@testing-library/jest-dom": "^5.0.1", | ||
"@testing-library/react": "^10.0.0", | ||
"@types/jest": "^26.0.0", | ||
"@types/react": "^16.9.11", | ||
"@types/react-dom": "^16.9.3", | ||
"husky": "^3.0.9", | ||
"husky": "^4.0.0", | ||
"react": "^16.11.0", | ||
"react-dom": "^16.11.0", | ||
"tsdx": "^0.11.0", | ||
"tslib": "^1.10.0", | ||
"tsdx": "^0.13.0", | ||
"tslib": "^2.0.0", | ||
"typescript": "^3.6.4" | ||
} | ||
} |
@@ -113,3 +113,3 @@ # Flagged | ||
import * as React from "react"; | ||
import { withFeature } from "flagged": | ||
import { withFeature } from "flagged"; | ||
@@ -210,3 +210,3 @@ function Heading() { | ||
import * as React from 'react'; | ||
import { useFeature } from 'flagged'; | ||
import { useFeatures } from 'flagged'; | ||
@@ -213,0 +213,0 @@ function Header() { |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25629
11
139