mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 12:50:38 -07:00
cover all
This commit is contained in:
@@ -82,6 +82,7 @@ function parseLiteral (str) {
|
||||
if (res) {
|
||||
return str.slice(1, -1)
|
||||
}
|
||||
throw new TypeError(`cannot parse '${str}' as literal`)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
||||
@@ -40,6 +40,7 @@ function evalValue (str, scope) {
|
||||
if (lexical.isVariable(str)) {
|
||||
return scope.get(str)
|
||||
}
|
||||
throw new TypeError(`cannot eval '${str}' as value`)
|
||||
}
|
||||
|
||||
function isTruthy (val) {
|
||||
|
||||
+1
-5
@@ -25,11 +25,7 @@ module.exports = function () {
|
||||
if (typeof impl.render !== 'function') {
|
||||
return Promise.resolve('')
|
||||
}
|
||||
return Promise.resolve()
|
||||
.then(() => typeof impl.render === 'function'
|
||||
? impl.render(scope, obj)
|
||||
: ''
|
||||
)
|
||||
return Promise.resolve().then(() => impl.render(scope, obj))
|
||||
},
|
||||
parse: function (token, tokens) {
|
||||
this.type = 'tag'
|
||||
|
||||
@@ -163,6 +163,7 @@ var formatCodes = {
|
||||
},
|
||||
z: function (d) {
|
||||
var tz = d.getTimezoneOffset() / 60 * 100
|
||||
console.log('tz', tz)
|
||||
return (tz > 0 ? '-' : '+') + _number.pad(Math.abs(tz), 4)
|
||||
},
|
||||
'%': function () {
|
||||
|
||||
Reference in New Issue
Block a user