mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 12:20:40 -07:00
refactor: use _.assign
This commit is contained in:
+3
-2
@@ -148,8 +148,9 @@ function matchRightBracket(str, begin) {
|
||||
}
|
||||
|
||||
exports.factory = function(_ctx, opts) {
|
||||
opts = opts || {};
|
||||
opts.strict = opts.strict || false;
|
||||
opts = _.assign({
|
||||
strict: false
|
||||
}, opts);
|
||||
|
||||
var scope = Object.create(Scope);
|
||||
scope.opts = opts;
|
||||
|
||||
@@ -25,6 +25,14 @@ function forOwn(object, iteratee) {
|
||||
return object;
|
||||
}
|
||||
|
||||
function assign(dst, src) {
|
||||
dst = dst || {};
|
||||
forOwn(src, function(v, k) {
|
||||
dst[k] = v;
|
||||
});
|
||||
return dst;
|
||||
}
|
||||
|
||||
function isArray(value) {
|
||||
return value instanceof Array;
|
||||
}
|
||||
@@ -32,3 +40,4 @@ function isArray(value) {
|
||||
exports.isString = isString;
|
||||
exports.isArray = isArray;
|
||||
exports.forOwn = forOwn;
|
||||
exports.assign = assign;
|
||||
|
||||
Reference in New Issue
Block a user