Comparing version 0.0.2 to 0.0.3
10
app.js
@@ -10,6 +10,6 @@ 'use strict' | ||
const drinks = [ | ||
{ name: 'Cafe Latte', price: 3.0 }, | ||
{ name: 'Cappucino', price: 2.9 }, | ||
{ name: 'Club Mate', price: 2.2 }, | ||
{ name: 'Berliner Weiße', price: 3.5 } | ||
{ name: 'Cafe Latte', price: 3.0, sold: false }, | ||
{ name: 'Cappucino', price: 2.9, sold: true }, | ||
{ name: 'Club Mate', price: 2.2, sold: true }, | ||
{ name: 'Berliner Weiße', price: 3.5, sold: false } | ||
] | ||
@@ -37,3 +37,3 @@ | ||
${drink.name} is € ${drink.price} | ||
<a href="#" onclick=${() => deleteDrink(drink)}>Give me!</a> | ||
<button onclick=${() => deleteDrink(drink)} disabled="${!drink.sold}">Give me!</button> | ||
</li> | ||
@@ -40,0 +40,0 @@ ` |
16
index.js
@@ -5,2 +5,9 @@ 'use strict' | ||
var BOOL_PROPS = [ | ||
'autofocus', 'checked', 'defaultchecked', 'disabled', 'formnovalidate', | ||
'indeterminate', 'readonly', 'required', 'selected', 'willvalidate' | ||
] | ||
var BOOL_PROP_PATTERN = new RegExp(' (' + BOOL_PROPS.join('|') + ')=(""|\'\')', 'ig') | ||
function handleValue (value) { | ||
@@ -18,3 +25,3 @@ if (Array.isArray(value)) { | ||
} | ||
if (value === null || value === undefined) { | ||
if (value === null || value === undefined || value === false) { | ||
return '' | ||
@@ -35,5 +42,5 @@ } | ||
function stringify () { | ||
const pieces = arguments[0] | ||
let output = '' | ||
for (let i = 0; i < pieces.length; i++) { | ||
var pieces = arguments[0] | ||
var output = '' | ||
for (var i = 0; i < pieces.length; i++) { | ||
output += pieces[i] | ||
@@ -44,2 +51,3 @@ if (i < pieces.length - 1) { | ||
} | ||
output = output.replace(BOOL_PROP_PATTERN, '') | ||
// HACK: Avoid double encoding by marking encoded string | ||
@@ -46,0 +54,0 @@ // You cannot add properties to string literals |
{ | ||
"name": "pelo", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Lightning fast server-side rendering with tagged template literals", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -45,4 +45,4 @@ # pelo (work in progress) | ||
| ---- | --------- | | ||
| pelo | 193.871 | | ||
| bel | 2522.082 | | ||
| pelo | 219.093 | | ||
| bel | 1982.610 | | ||
@@ -49,0 +49,0 @@ ## Motivation |
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
71171
208