Comparing version 2.0.3 to 2.0.4
@@ -8,3 +8,3 @@ 'use strict'; | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
_extends = Object.assign ? Object.assign.bind() : function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
@@ -22,3 +22,2 @@ var source = arguments[i]; | ||
}; | ||
return _extends.apply(this, arguments); | ||
@@ -73,3 +72,3 @@ } | ||
if (!hasFeature) return null; | ||
return render; | ||
return React.createElement(React.Fragment, null, render); | ||
} // High Order Component API | ||
@@ -76,0 +75,0 @@ |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");function r(){return(r=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}var t=e.createContext({});function n(e){return Array.isArray(e)?Object.fromEntries(e.map((function(e){return[e,!0]}))):e}function o(){return e.useContext(t)}function u(e){var r=o();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)}function a(e){var r=e.render,t=void 0===r?e.children:r,n=u(e.name);return"function"==typeof t?t(n):n?t:null}exports.Feature=a,exports.FlagsProvider=function(u){var a,i,c=u.features,s=void 0===c?{}:c,f=u.children,l=o();return e.createElement(t.Provider,{value:(a=n(l),i=n(s),r({},a,i))},f)},exports.useFeature=u,exports.useFeatures=o,exports.withFeature=function(r){return function(t){return function(n){return e.createElement(a,{name:r},e.createElement(t,Object.assign({},n)))}}}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}var t=e.createContext({});function n(e){return Array.isArray(e)?Object.fromEntries(e.map((function(e){return[e,!0]}))):e}function u(){return e.useContext(t)}function o(e){var r=u();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)}function a(r){var t=r.render,n=void 0===t?r.children:t,u=o(r.name);return"function"==typeof n?n(u):u?e.createElement(e.Fragment,null,n):null}exports.Feature=a,exports.FlagsProvider=function(o){var a,i,c=o.features,s=void 0===c?{}:c,l=o.children,f=u();return e.createElement(t.Provider,{value:(a=n(f),i=n(s),r({},a,i))},l)},exports.useFeature=o,exports.useFeatures=u,exports.withFeature=function(r){return function(t){return function(n){return e.createElement(a,{name:r},e.createElement(t,Object.assign({},n)))}}}; | ||
//# sourceMappingURL=flagged.cjs.production.min.js.map |
@@ -1,5 +0,5 @@ | ||
import { useContext, createElement, createContext } from 'react'; | ||
import { useContext, createElement, Fragment, createContext } from 'react'; | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
_extends = Object.assign ? Object.assign.bind() : function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
@@ -17,3 +17,2 @@ var source = arguments[i]; | ||
}; | ||
return _extends.apply(this, arguments); | ||
@@ -68,3 +67,3 @@ } | ||
if (!hasFeature) return null; | ||
return render; | ||
return createElement(Fragment, null, render); | ||
} // High Order Component API | ||
@@ -71,0 +70,0 @@ |
@@ -16,4 +16,4 @@ import * as React from 'react'; | ||
render?: React.ReactNode | ((hasFeature: boolean | FeatureGroup) => JSX.Element); | ||
}): any; | ||
}): JSX.Element | null; | ||
export declare function withFeature(featureName: string): (Component: Function) => (props: React.ComponentProps<any>) => JSX.Element; | ||
export {}; |
{ | ||
"name": "flagged", | ||
"description": "Feature flags for React made easy with hooks, HOC and Render Props", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"license": "MIT", | ||
@@ -44,3 +44,3 @@ "repository": "https://github.com/sergiodxa/flagged.git", | ||
"peerDependencies": { | ||
"react": ">=16" | ||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0" | ||
}, | ||
@@ -60,14 +60,14 @@ "husky": { | ||
"devDependencies": { | ||
"@testing-library/jest-dom": "^5.0.1", | ||
"@testing-library/react": "^12.0.0", | ||
"@types/jest": "^27.0.0", | ||
"@types/react": "^17.0.0", | ||
"@types/react-dom": "^17.0.0", | ||
"husky": "^7.0.1", | ||
"react": "^17.0.0", | ||
"react-dom": "^17.0.0", | ||
"tsdx": "^0.14.0", | ||
"tslib": "^2.0.0", | ||
"typescript": "^4.0.2" | ||
"@testing-library/jest-dom": "^5.16.4", | ||
"@testing-library/react": "^13.3.0", | ||
"@types/jest": "^28.1.0", | ||
"@types/react": "^18.0.10", | ||
"@types/react-dom": "^18.0.5", | ||
"husky": "^8.0.1", | ||
"react": "^18.1.0", | ||
"react-dom": "^18.1.0", | ||
"tsdx": "^0.14.1", | ||
"tslib": "^2.4.0", | ||
"typescript": "^4.7.2" | ||
} | ||
} |
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
27873