mirror of
https://github.com/harttle/liquidjs.git
synced 2026-10-03 09:05:14 -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 _ = require('./util/underscore.js');
|
||||||
var lexical = require('./lexical.js');
|
var lexical = require('./lexical.js');
|
||||||
var assert = require('./util/assert.js');
|
var assert = require('./util/assert.js');
|
||||||
|
var toStr = Object.prototype.toString;
|
||||||
|
|
||||||
var Scope = {
|
var Scope = {
|
||||||
getAll: function getAll() {
|
getAll: function getAll() {
|
||||||
@@ -962,9 +963,16 @@ var Scope = {
|
|||||||
throw new TypeError('undefined variable');
|
throw new TypeError('undefined variable');
|
||||||
}
|
}
|
||||||
var variable = obj[varName];
|
var variable = obj[varName];
|
||||||
|
var lastName = paths.pop();
|
||||||
paths.forEach(function (p) {
|
paths.forEach(function (p) {
|
||||||
return variable = variable[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;
|
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",
|
"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.",
|
"description": "A feature-rich Liquid template engine for Node.js and browsers, with compliance with the Ruby version.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user