mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-18 05:50:43 -07:00
upgrade outdated dependencies
This commit is contained in:
+1
-1
@@ -63,7 +63,7 @@ var Scope = {
|
||||
return (obj[key] = val)
|
||||
}
|
||||
if (undefined === obj[key]) obj[key] = {}
|
||||
// case for readonly objects
|
||||
// case for readonly objects
|
||||
obj = obj[key] || {}
|
||||
}
|
||||
}
|
||||
|
||||
+9
-9
@@ -27,15 +27,15 @@ module.exports = function () {
|
||||
return Promise.resolve('')
|
||||
}
|
||||
return Promise.resolve()
|
||||
.then(() => typeof impl.render === 'function'
|
||||
? impl.render(scope, obj) : '')
|
||||
.catch(function (e) {
|
||||
if (_.isError(e)) {
|
||||
throw e
|
||||
}
|
||||
var msg = `Please reject with an Error in ${impl.render}, got ${e}`
|
||||
throw new Error(msg)
|
||||
})
|
||||
.then(() => typeof impl.render === 'function'
|
||||
? impl.render(scope, obj) : '')
|
||||
.catch(function (e) {
|
||||
if (_.isError(e)) {
|
||||
throw e
|
||||
}
|
||||
var msg = `Please reject with an Error in ${impl.render}, got ${e}`
|
||||
throw new Error(msg)
|
||||
})
|
||||
},
|
||||
parse: function (token, tokens) {
|
||||
this.type = 'tag'
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@ function parse (html, filepath, options) {
|
||||
var parsedLinesCount = 0
|
||||
|
||||
while ((result = syntax.exec(html)) !== null) {
|
||||
// passed html fragments
|
||||
// passed html fragments
|
||||
if (result.index > lastMatchEnd) {
|
||||
htmlFragment = html.slice(lastMatchEnd, result.index)
|
||||
tokens.push({
|
||||
@@ -49,7 +49,7 @@ function parse (html, filepath, options) {
|
||||
lastMatchEnd = syntax.lastIndex
|
||||
}
|
||||
|
||||
// remaining html
|
||||
// remaining html
|
||||
if (html.length > lastMatchEnd) {
|
||||
htmlFragment = html.slice(lastMatchEnd, html.length)
|
||||
tokens.push({
|
||||
|
||||
+9
-9
@@ -34,7 +34,7 @@ ParseError.prototype = Object.create(Error.prototype)
|
||||
ParseError.prototype.constructor = ParseError
|
||||
|
||||
function RenderError (e, tpl) {
|
||||
// return the original render error
|
||||
// return the original render error
|
||||
if (e instanceof RenderError) {
|
||||
return e
|
||||
}
|
||||
@@ -79,14 +79,14 @@ function mkContext (input, line) {
|
||||
var end = Math.min(line + 3, lines.length)
|
||||
|
||||
var context = _
|
||||
.range(begin, end + 1)
|
||||
.map(l => [
|
||||
(l === line) ? '>> ' : ' ',
|
||||
align(l, end),
|
||||
'| ',
|
||||
lines[l - 1]
|
||||
].join(''))
|
||||
.join('\n')
|
||||
.range(begin, end + 1)
|
||||
.map(l => [
|
||||
(l === line) ? '>> ' : ' ',
|
||||
align(l, end),
|
||||
'| ',
|
||||
lines[l - 1]
|
||||
].join(''))
|
||||
.join('\n')
|
||||
|
||||
return context
|
||||
}
|
||||
|
||||
+2
-2
@@ -25,8 +25,8 @@ function mapSeries (iterable, iteratee) {
|
||||
var result = []
|
||||
iterable.forEach(function (item, idx) {
|
||||
ret = ret
|
||||
.then(() => iteratee(item, idx, iterable))
|
||||
.then(x => result.push(x))
|
||||
.then(() => iteratee(item, idx, iterable))
|
||||
.then(x => result.push(x))
|
||||
})
|
||||
return ret.then(() => result)
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ function isString (value) {
|
||||
|
||||
function isError (value) {
|
||||
var signature = Object.prototype.toString.call(value)
|
||||
// [object XXXError]
|
||||
// [object XXXError]
|
||||
return signature.substr(-6, 5) === 'Error' ||
|
||||
(typeof value.message === 'string' && typeof value.name === 'string')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user