From 1c88448217e1264329b67ceeb0d119a445b4c7c6 Mon Sep 17 00:00:00 2001 From: Ahmad Amireh Date: Thu, 26 May 2016 11:26:57 +0300 Subject: [PATCH] Be compatible with React 0.14, use "invariant" package --- ComponentInterpolator.js | 4 ++-- dist/ComponentInterpolator.js | 2 +- dist/invariant.js | 1 + package.json | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 dist/invariant.js diff --git a/ComponentInterpolator.js b/ComponentInterpolator.js index 8f92a07..5889d25 100644 --- a/ComponentInterpolator.js +++ b/ComponentInterpolator.js @@ -1,5 +1,5 @@ var React = require('react'); -var invariant = require('react/lib/invariant'); +var invariant = require('invariant'); var { string, object } = React.PropTypes; var WRAPPER_PATTERN = /(\*+)/; @@ -95,7 +95,7 @@ var ComponentInterpolator = React.createClass({ }, interpolatePlaceholders(string) { - var token; + var token, child; var tokens = string.split(PLACEHOLDER_PATTERN); var children = []; while (tokens.length) { diff --git a/dist/ComponentInterpolator.js b/dist/ComponentInterpolator.js index 445f460..095d3ae 100644 --- a/dist/ComponentInterpolator.js +++ b/dist/ComponentInterpolator.js @@ -1,5 +1,5 @@ var React = require('react'); -var invariant = require('react/lib/invariant'); +var invariant = require('invariant'); var $__0= React.PropTypes,string=$__0.string,object=$__0.object; var WRAPPER_PATTERN = /(\*+)/; diff --git a/dist/invariant.js b/dist/invariant.js new file mode 100644 index 0000000..aed3a49 --- /dev/null +++ b/dist/invariant.js @@ -0,0 +1 @@ +throw new Error("nonexistent module required: invariant"); \ No newline at end of file diff --git a/package.json b/package.json index a75a191..d4b61c0 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "react-tools": "0.13.x" }, "peerDependencies": { - "react": "0.13.x" + "react": "0.13.x || 0.14.x" }, "jest": { "scriptPreprocessor": "test_utils/preprocessor.js", @@ -28,6 +28,7 @@ }, "dependencies": { "i18nliner": "^0.1.5", + "invariant": "2.2.1", "recast": "^0.10.12", "through2": "^0.6.3" }