Skip to content

Commit

Permalink
1.7.0: Merged with upstream, use babel-preset-env, add package-lock, …
Browse files Browse the repository at this point in the history
….npmignore
  • Loading branch information
Download committed Mar 27, 2018
1 parent 2d75dfd commit 472fb3f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions dist/ComponentInterpolator.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ var invariant = require('invariant');
var Component = require('preact').Component;
var h = require('preact').h;
var clone = require('extend').bind(true);

var WRAPPER_PATTERN = /(\*+)/;
var PLACEHOLDER_PATTERN = /(%\{.*?\})/;

Expand Down Expand Up @@ -86,8 +85,7 @@ var ComponentInterpolator = function (_Component) {
token = tokens.shift();
if (token === eof) break;
if (token.match(WRAPPER_PATTERN)) {
invariant(child = wrappers[token], '<ComponentInterpolator> expected \'' + token + '\' wrapper, none found');

invariant(child = wrappers[token], `<ComponentInterpolator> expected '${token}' wrapper, none found`);
child = injectNewDescendants(child, this.interpolateAllComponents(tokens, token), { key: this.keyCounter++ }, true);
children.push(child);
} else {
Expand All @@ -106,7 +104,7 @@ var ComponentInterpolator = function (_Component) {
token = tokens.shift();
if (token.match(PLACEHOLDER_PATTERN)) {
token = token.slice(2, -1);
invariant(this.props.hasOwnProperty(token), '<ComponentInterpolator> expected \'' + token + '\' placeholder value, none found');
invariant(this.props.hasOwnProperty(token), `<ComponentInterpolator> expected '${token}' placeholder value, none found`);
child = this.props[token];
child = child && child.nodeName ? clone(child, { key: this.keyCounter++ }) : child;
children.push(child);
Expand Down

0 comments on commit 472fb3f

Please sign in to comment.