@popeindustries/lit-html-server
Advanced tools
Comparing version 2.0.0 to 3.0.0
@@ -13,3 +13,3 @@ 'use strict'; | ||
if (value === undefined && shared_js.isAttributePart(part)) { | ||
return part.setValue(shared_js.nothingString); | ||
return part.setValue(shared_js.nothing); | ||
} | ||
@@ -16,0 +16,0 @@ part.setValue(value); |
@@ -234,5 +234,5 @@ interface TemplateProcessor { | ||
/** | ||
* A value for strings that signals a Part to clear its content | ||
* A value for parts that signals a Part to clear its content | ||
*/ | ||
export declare const nothingString: string; | ||
export declare const nothing: string; | ||
/** | ||
@@ -239,0 +239,0 @@ * A prefix value for strings that should not be escaped |
19
index.js
@@ -78,6 +78,7 @@ 'use strict'; | ||
* | ||
* @param { object } promise | ||
* @param { unknown } promise | ||
* @returns { promise is Promise<unknown> } | ||
*/ | ||
function isPromise(promise) { | ||
// @ts-ignore | ||
return promise != null && promise.then != null; | ||
@@ -291,3 +292,3 @@ } | ||
// Bail if 'nothing' | ||
if (value === shared_js.nothingString) { | ||
if (value === shared_js.nothing) { | ||
return EMPTY_STRING_BUFFER; | ||
@@ -444,10 +445,6 @@ } | ||
if (value === shared_js.nothingString) { | ||
if (value === shared_js.nothing) { | ||
return value; | ||
} | ||
if (isTemplateResult(value)) { | ||
value = value.read(); | ||
} | ||
if (shared_js.isPrimitive(value)) { | ||
@@ -482,3 +479,3 @@ const string = typeof value !== 'string' ? String(value) : value; | ||
} else { | ||
throw Error(`unknown AttributPart value: ${value}`); | ||
return buffer.Buffer.from(String(value)); | ||
} | ||
@@ -499,3 +496,3 @@ } | ||
if (value === shared_js.nothingString || value === undefined) { | ||
if (value === shared_js.nothing || value === undefined) { | ||
return EMPTY_STRING_BUFFER; | ||
@@ -1297,6 +1294,6 @@ } | ||
}); | ||
Object.defineProperty(exports, 'nothingString', { | ||
Object.defineProperty(exports, 'nothing', { | ||
enumerable: true, | ||
get: function () { | ||
return shared_js.nothingString; | ||
return shared_js.nothing; | ||
} | ||
@@ -1303,0 +1300,0 @@ }); |
{ | ||
"name": "@popeindustries/lit-html-server", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"description": "Render lit-html templates on the server", | ||
@@ -42,21 +42,21 @@ "author": "Alexander Pope <alex@pope-industries.com>", | ||
"devDependencies": { | ||
"@rollup/plugin-commonjs": "^11.0.1", | ||
"@rollup/plugin-node-resolve": "^7.0.0", | ||
"@types/node": "^13.1.7", | ||
"autocannon": "^4.4.2", | ||
"babel-eslint": "^10.0.1", | ||
"@rollup/plugin-commonjs": "^11.0.2", | ||
"@rollup/plugin-node-resolve": "^7.1.1", | ||
"@types/node": "^13.9.1", | ||
"autocannon": "^4.6.0", | ||
"babel-eslint": "^10.1.0", | ||
"chai": "^4.2.0", | ||
"eslint": "^6.8.0", | ||
"eslint-config-prettier": "^6.9.0", | ||
"eslint-config-prettier": "^6.10.0", | ||
"eslint-plugin-prettier": "^3.1.2", | ||
"get-stream": "^5.1.0", | ||
"husky": "^4.0.9", | ||
"lint-staged": "^9.5.0", | ||
"husky": "^4.2.3", | ||
"lint-staged": "^10.0.8", | ||
"lit-html": "^1.1.0", | ||
"mocha": "^7.0.0", | ||
"mocha": "^7.1.0", | ||
"prettier": "^1.19.1", | ||
"puppeteer": "^2.0.0", | ||
"rollup": "^1.29.0", | ||
"puppeteer": "^2.1.1", | ||
"rollup": "^2.0.6", | ||
"send": "^0.17.1", | ||
"typescript": "^3.7.4" | ||
"typescript": "^3.8.3" | ||
}, | ||
@@ -82,10 +82,8 @@ "scripts": { | ||
"prettier --write", | ||
"eslint", | ||
"git add" | ||
"eslint" | ||
], | ||
"*.json": [ | ||
"prettier --write", | ||
"git add" | ||
"prettier --write" | ||
] | ||
} | ||
} |
@@ -11,5 +11,5 @@ 'use strict'; | ||
/** | ||
* A value for strings that signals a Part to clear its content | ||
* A value for parts that signals a Part to clear its content | ||
*/ | ||
const nothingString = '__nothing-lit-html-server-string__'; | ||
const nothing = '__nothing-lit-html-server-string__'; | ||
@@ -93,3 +93,3 @@ /** | ||
exports.isPrimitive = isPrimitive; | ||
exports.nothingString = nothingString; | ||
exports.nothing = nothing; | ||
exports.unsafePrefixString = unsafePrefixString; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
153241
4315