mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 12:50:38 -07:00
1.7.5
This commit is contained in:
Vendored
+8
@@ -888,6 +888,7 @@ module.exports = factory;
|
||||
var _ = require('./util/underscore.js');
|
||||
var lexical = require('./lexical.js');
|
||||
var assert = require('./util/assert.js');
|
||||
var toStr = Object.prototype.toString;
|
||||
|
||||
var Scope = {
|
||||
getAll: function getAll() {
|
||||
@@ -962,9 +963,16 @@ var Scope = {
|
||||
throw new TypeError('undefined variable');
|
||||
}
|
||||
var variable = obj[varName];
|
||||
var lastName = paths.pop();
|
||||
paths.forEach(function (p) {
|
||||
return variable = variable[p];
|
||||
});
|
||||
if (undefined !== lastName) {
|
||||
if (lastName === 'size' && (toStr.call(variable) === '[object Array]' || toStr.call(variable) === '[object String]')) {
|
||||
return variable.length;
|
||||
}
|
||||
variable = variable[lastName];
|
||||
}
|
||||
return variable;
|
||||
},
|
||||
|
||||
|
||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "shopify-liquid",
|
||||
"version": "1.7.4",
|
||||
"version": "1.7.5",
|
||||
"description": "A feature-rich Liquid template engine for Node.js and browsers, with compliance with the Ruby version.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user