Socket
Socket
Sign inDemoInstall

tiny-invariant

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tiny-invariant - npm Package Compare versions

Comparing version 0.0.3 to 1.0.0

dist/tiny-invariant.js

5

dist/tiny-invariant.cjs.js

@@ -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;

23

package.json
{
"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 || ''}`);
};
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