tiny-invariant
Advanced tools
Comparing version 0.0.3 to 1.0.0
@@ -11,9 +11,10 @@ 'use strict'; | ||
if (isProduction) { | ||
throw new Error(prefix); | ||
} else { | ||
throw new Error(prefix + ': ' + (message || '')); | ||
} | ||
throw new Error(prefix + ': ' + (message || '')); | ||
}); | ||
module.exports = index; |
@@ -9,9 +9,10 @@ var isProduction = process.env.NODE_ENV === 'production'; | ||
if (isProduction) { | ||
throw new Error(prefix); | ||
} else { | ||
throw new Error(prefix + ': ' + (message || '')); | ||
} | ||
throw new Error(prefix + ': ' + (message || '')); | ||
}); | ||
export default index; |
{ | ||
"name": "tiny-invariant", | ||
"version": "0.0.3", | ||
"version": "1.0.0", | ||
"keywords": [ | ||
"invariant", | ||
"error" | ||
], | ||
"description": "A tiny invariant function", | ||
@@ -27,12 +31,15 @@ "main": "dist/tiny-invariant.cjs.js", | ||
"babel-cli": "^6.26.0", | ||
"babel-core": "^6.26.0", | ||
"babel-preset-env": "^1.6.1", | ||
"babel-core": "^6.26.3", | ||
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2", | ||
"babel-preset-env": "^1.7.0", | ||
"babel-preset-flow": "^6.23.0", | ||
"flow-bin": "^0.70.0", | ||
"jest": "^22.4.3", | ||
"prettier": "^1.12.1", | ||
"flow-bin": "^0.78.0", | ||
"jest": "^23.5.0", | ||
"prettier": "^1.14.2", | ||
"rimraf": "^2.6.2", | ||
"rollup": "^0.58.0", | ||
"rollup-plugin-babel": "^3.0.3" | ||
"rollup": "^0.64.1", | ||
"rollup-plugin-babel": "^3.0.7", | ||
"rollup-plugin-replace": "^2.0.0", | ||
"rollup-plugin-uglify": "^4.0.0" | ||
} | ||
} |
// @flow | ||
const isProduction: boolean = process.env.NODE_ENV === 'production'; | ||
@@ -13,12 +12,12 @@ const prefix: string = 'Invariant failed'; | ||
} | ||
// Condition not passed | ||
// In production we strip the message but still throw | ||
if (isProduction) { | ||
// In production we strip the message but still throw | ||
throw new Error(prefix); | ||
} else { | ||
// When not in production we allow the message to pass through | ||
// *This block will be removed in non-production builds* | ||
throw new Error(`${prefix}: ${message || ''}`); | ||
} | ||
// In other environments we throw with the message | ||
throw new Error(`${prefix}: ${message || ''}`); | ||
}; |
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
6339
8
64
1
0
84
13