@greenberry/use-label-prefix
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -20,2 +20,7 @@ "use strict"; | ||
var env = process.env || { | ||
NODE_ENV: undefined | ||
}; | ||
var NODE_ENV = env.NODE_ENV; | ||
var isTest = NODE_ENV === 'test'; | ||
var allChars = (0, _ramda.split)('', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789'); | ||
@@ -55,3 +60,3 @@ | ||
var _useState = (0, _react.useState)("p_".concat(prefix, "_").concat(serializeLabel(label))), | ||
var _useState = (0, _react.useState)("p_".concat(prefix, "_").concat(isTest ? '' : serializeLabel(label))), | ||
_useState2 = _slicedToArray(_useState, 1), | ||
@@ -58,0 +63,0 @@ prefixed = _useState2[0]; |
{ | ||
"name": "@greenberry/use-label-prefix", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Custom React Hook to prefix labels on Input fields", | ||
@@ -11,3 +11,3 @@ "main": "index.js", | ||
"scripts": { | ||
"test": "jest test --coverage", | ||
"test": "NODE_ENV=jest jest test --coverage", | ||
"build": "rm -rf ./dist && NODE_ENV=production babel src --out-dir dist", | ||
@@ -14,0 +14,0 @@ "prepublishOnly": "yarn build && cp -r ./dist/* . && rm -rf ./dist", |
@@ -46,1 +46,6 @@ # `@greenberry/use-label-prefix` | ||
``` | ||
## Notes | ||
- When `NODE_ENV` is `test` no random string will be generated |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
5124
53
51
2