interpolate-components
Advanced tools
Comparing version 1.0.5 to 1.1.0
# Changelog | ||
## 1.1.0 | ||
* Update to Babel 6 and bump node testing version to 5.11.1 | ||
## 1.0.5 | ||
@@ -4,0 +7,0 @@ |
@@ -1,12 +0,17 @@ | ||
/** | ||
* External Dependencies | ||
*/ | ||
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; /** | ||
* External Dependencies | ||
*/ | ||
/** | ||
* Internal Dependencies | ||
*/ | ||
var _react = require('react'); | ||
@@ -20,6 +25,2 @@ | ||
/** | ||
* Internal Dependencies | ||
*/ | ||
var _tokenize = require('./tokenize'); | ||
@@ -29,4 +30,6 @@ | ||
var currentMixedString = undefined; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var currentMixedString = void 0; | ||
function getCloseIndex(openIndex, tokens) { | ||
@@ -81,3 +84,3 @@ var openToken = tokens[openIndex], | ||
// should be either ReactElement or null (both type "object"), all other types deprecated | ||
if (typeof components[token.value] !== 'object') { | ||
if (_typeof(components[token.value]) !== 'object') { | ||
throw new Error('Invalid interpolation, component node must be a ReactElement or null: `' + token.value + '`', '\n> ' + currentMixedString); | ||
@@ -103,3 +106,3 @@ } | ||
grandChildren = buildChildren(grandChildTokens, components); | ||
clonedOpenComponent = _react2['default'].cloneElement(openComponent, {}, grandChildren); | ||
clonedOpenComponent = _react2.default.cloneElement(openComponent, {}, grandChildren); | ||
children.push(clonedOpenComponent); | ||
@@ -124,3 +127,3 @@ | ||
return (0, _reactAddonsCreateFragment2['default'])(childrenObject); | ||
return (0, _reactAddonsCreateFragment2.default)(childrenObject); | ||
} | ||
@@ -133,2 +136,3 @@ | ||
currentMixedString = mixedString; | ||
@@ -140,3 +144,3 @@ | ||
if (typeof components !== 'object') { | ||
if ((typeof components === 'undefined' ? 'undefined' : _typeof(components)) !== 'object') { | ||
if (throwErrors) { | ||
@@ -149,3 +153,3 @@ throw new Error('Interpolation Error: unable to process `' + mixedString + '` because components is not an object'); | ||
var tokens = (0, _tokenize2['default'])(mixedString); | ||
var tokens = (0, _tokenize2.default)(mixedString); | ||
@@ -163,4 +167,3 @@ try { | ||
exports['default'] = interpolate; | ||
module.exports = exports['default']; | ||
exports.default = interpolate; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "interpolate-components", | ||
"version": "1.0.5", | ||
"version": "1.1.0", | ||
"description": "Convert strings into structured React components.", | ||
@@ -15,15 +15,14 @@ "repository": { | ||
], | ||
"engines": { | ||
"node": ">=4.2.3" | ||
}, | ||
"scripts": { | ||
"compile": "babel -sd lib/ src/", | ||
"prepublish": "npm run compile", | ||
"test": "make test" | ||
"compile": "babel -sd lib/ src/", | ||
"prepublish": "npm run compile", | ||
"test": "mocha --require babel-register --reporter spec test/test.jsx" | ||
}, | ||
"devDependencies": { | ||
"babel": "^5.8.12", | ||
"babel-core": "^5.8.12", | ||
"babel-runtime": "^5.8.12", | ||
"mocha": "^2.3.4" | ||
"babel-cli": "^6.9.0", | ||
"babel-core": "^6.9.1", | ||
"babel-preset-es2015": "^6.9.0", | ||
"babel-preset-react": "^6.5.0", | ||
"babel-register": "^6.9.0", | ||
"mocha": "^2.3.4" | ||
}, | ||
@@ -30,0 +29,0 @@ "bugs": { |
@@ -45,3 +45,3 @@ Interpolate-Components | ||
# run tests | ||
make test | ||
npm test | ||
``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
60025
19
6
412
1