diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ffbbf8..0328983 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## Change Log +### v1.7.4 (2017/12/09 05:05 +00:00) +- [#142](https://github.com/linkedin/dustjs-helpers/pull/142) Fix Node 8 - add registerWith property to dustjs-helpers which has factory function (@kumarrishav) + ### v1.7.3 (2015/07/28 20:55 +00:00) - [#140](https://github.com/linkedin/dustjs-helpers/pull/140) Fix logic helpers inside any and none blocks. (@sethkinast) @@ -78,4 +81,4 @@ - [#12](https://github.com/linkedin/dustjs-helpers/pull/12) Math helper with Body issue #120 (@jimmyhchan) - [#6](https://github.com/linkedin/dustjs-helpers/pull/6) Minor README markdown styling fix (@zzen) - [#5](https://github.com/linkedin/dustjs-helpers/pull/5) Updated README to install node dependencies properly (@zzen) -- [#2](https://github.com/linkedin/dustjs-helpers/pull/2) Extend contextDump helper (@rragan) \ No newline at end of file +- [#2](https://github.com/linkedin/dustjs-helpers/pull/2) Extend contextDump helper (@rragan) diff --git a/bower.json b/bower.json index 1d61982..a3a308f 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "dustjs-helpers", - "version": "1.7.3", + "version": "1.7.4", "homepage": "https://github.com/linkedin/dustjs-helpers", "authors": [ "Veena Basavaraj ", diff --git a/dist/dust-helpers.js b/dist/dust-helpers.js index 490b87d..9f59f6a 100644 --- a/dist/dust-helpers.js +++ b/dist/dust-helpers.js @@ -1,11 +1,12 @@ -/*! dustjs-helpers - v1.7.3 +/*! dustjs-helpers - v1.7.4 * http://dustjs.com/ -* Copyright (c) 2015 Aleksander Williams; Released under the MIT License */ +* Copyright (c) 2017 Aleksander Williams; Released under the MIT License */ (function(root, factory) { if (typeof define === 'function' && define.amd && define.amd.dust === true) { define(['dust.core'], factory); } else if (typeof exports === 'object') { module.exports = factory(require('dustjs-linkedin')); + module.exports.registerWith = factory; } else { factory(root.dust); } diff --git a/dist/dust-helpers.min.js b/dist/dust-helpers.min.js index 771ed6e..0dcf09a 100644 --- a/dist/dust-helpers.min.js +++ b/dist/dust-helpers.min.js @@ -1,4 +1,4 @@ -/*! dustjs-helpers - v1.7.3 +/*! dustjs-helpers - v1.7.4 * http://dustjs.com/ -* Copyright (c) 2015 Aleksander Williams; Released under the MIT License */ -!function(a,b){"function"==typeof define&&define.amd&&define.amd.dust===!0?define(["dust.core"],b):"object"==typeof exports?module.exports=b(require("dustjs-linkedin")):b(a.dust)}(this,function(dust){function a(a,b,c){c=c||"INFO",a=a?"{@"+a+"}: ":"",dust.log(a+b,c)}function b(b){k[b]||(a(b,"Deprecation warning: "+b+" is deprecated and will be removed in a future version of dustjs-helpers","WARN"),a(null,"For help and a deprecation timeline, see https://github.com/linkedin/dustjs-helpers/wiki/Deprecated-Features#"+b.replace(/\W+/g,""),"WARN"),k[b]=!0)}function c(a){return a.stack.tail&&a.stack.tail.head&&"undefined"!=typeof a.stack.tail.head.__select__}function d(a){return c(a)&&a.get("__select__")}function e(a,b){var c,d=a.stack.head,e=a.rebase();a.stack&&a.stack.tail&&(e.stack=a.stack.tail);var f={isPending:!1,isResolved:!1,isDeferredComplete:!1,deferreds:[]};for(c in b)f[c]=b[c];return e.push({__select__:f}).push(d,a.stack.index,a.stack.of)}function f(a){var b,c;if(a.isDeferredPending=!0,a.deferreds.length)for(a.isDeferredComplete=!0,b=0,c=a.deferreds.length;c>b;b++)a.deferreds[b]();a.isDeferredPending=!1}function g(a,b){return"function"==typeof b?b.toString().replace(/(^\s+|\s+$)/gm,"").replace(/\n/gm,"").replace(/,\s*/gm,", ").replace(/\)\{/gm,") {"):b}function h(a,b){return function(c,d,e,f){return i(c,d,e,f,a,b)}}function i(b,c,e,f,g,h){var i,k,l,m,n=e.block,o=e["else"],p=d(c)||{};if(p.isResolved&&!p.isDeferredPending)return b;if(f.hasOwnProperty("key"))k=f.key;else{if(!p.hasOwnProperty("key"))return a(g,"No key specified","WARN"),b;k=p.key}return m=f.type||p.type,k=j(c.resolve(k),m),l=j(c.resolve(f.value),m),h(k,l)?(p.isPending||(i=!0,p.isPending=!0),n&&(b=b.render(n,c)),i&&(p.isResolved=!0)):o&&(b=b.render(o,c)),b}function j(a,b){switch(b&&(b=b.toLowerCase()),b){case"number":return+a;case"string":return String(a);case"boolean":return a="false"===a?!1:a,Boolean(a);case"date":return new Date(a)}return a}var k={},l={tap:function(a,c,d){return b("tap"),d.resolve(a)},sep:function(a,b,c){var d=c.block;return b.stack.index===b.stack.of-1?a:d?d(a,b):a},first:function(a,b,c){return 0===b.stack.index?c.block(a,b):a},last:function(a,b,c){return b.stack.index===b.stack.of-1?c.block(a,b):a},contextDump:function(b,c,d,e){var f,h,i=c.resolve(e.to),j=c.resolve(e.key);switch(j){case"full":f=c.stack;break;default:f=c.stack.head}switch(h=JSON.stringify(f,g,2),i){case"console":a("contextDump",h);break;default:h=h.replace(/a}),lte:h("lte",function(a,b){return b>=a}),gt:h("gt",function(a,b){return a>b}),gte:h("gte",function(a,b){return a>=b}),any:function(b,c,e,f){var g=d(c);return g?g.isDeferredComplete?a("any","Must not be nested inside {@any} or {@none} block","ERROR"):b=b.map(function(a){g.deferreds.push(function(){g.isResolved&&(a=a.render(e.block,c)),a.end()})}):a("any","Must be used inside a {@select} block","ERROR"),b},none:function(b,c,e,f){var g=d(c);return g?g.isDeferredComplete?a("none","Must not be nested inside {@any} or {@none} block","ERROR"):b=b.map(function(a){g.deferreds.push(function(){g.isResolved||(a=a.render(e.block,c)),a.end()})}):a("none","Must be used inside a {@select} block","ERROR"),b},size:function(a,b,c,d){var e,f,g=d.key;if(g=b.resolve(d.key),g&&g!==!0)if(dust.isArray(g))e=g.length;else if(!isNaN(parseFloat(g))&&isFinite(g))e=g;else if("object"==typeof g){e=0;for(f in g)g.hasOwnProperty(f)&&e++}else e=(g+"").length;else e=0;return a.write(e)}};for(var m in l)dust.helpers[m]=l[m];return dust}); \ No newline at end of file +* Copyright (c) 2017 Aleksander Williams; Released under the MIT License */ +!function(a,b){"function"==typeof define&&define.amd&&define.amd.dust===!0?define(["dust.core"],b):"object"==typeof exports?(module.exports=b(require("dustjs-linkedin")),module.exports.registerWith=b):b(a.dust)}(this,function(dust){function a(a,b,c){c=c||"INFO",a=a?"{@"+a+"}: ":"",dust.log(a+b,c)}function b(b){k[b]||(a(b,"Deprecation warning: "+b+" is deprecated and will be removed in a future version of dustjs-helpers","WARN"),a(null,"For help and a deprecation timeline, see https://github.com/linkedin/dustjs-helpers/wiki/Deprecated-Features#"+b.replace(/\W+/g,""),"WARN"),k[b]=!0)}function c(a){return a.stack.tail&&a.stack.tail.head&&"undefined"!=typeof a.stack.tail.head.__select__}function d(a){return c(a)&&a.get("__select__")}function e(a,b){var c,d=a.stack.head,e=a.rebase();a.stack&&a.stack.tail&&(e.stack=a.stack.tail);var f={isPending:!1,isResolved:!1,isDeferredComplete:!1,deferreds:[]};for(c in b)f[c]=b[c];return e.push({__select__:f}).push(d,a.stack.index,a.stack.of)}function f(a){var b,c;if(a.isDeferredPending=!0,a.deferreds.length)for(a.isDeferredComplete=!0,b=0,c=a.deferreds.length;c>b;b++)a.deferreds[b]();a.isDeferredPending=!1}function g(a,b){return"function"==typeof b?b.toString().replace(/(^\s+|\s+$)/gm,"").replace(/\n/gm,"").replace(/,\s*/gm,", ").replace(/\)\{/gm,") {"):b}function h(a,b){return function(c,d,e,f){return i(c,d,e,f,a,b)}}function i(b,c,e,f,g,h){var i,k,l,m,n=e.block,o=e["else"],p=d(c)||{};if(p.isResolved&&!p.isDeferredPending)return b;if(f.hasOwnProperty("key"))k=f.key;else{if(!p.hasOwnProperty("key"))return a(g,"No key specified","WARN"),b;k=p.key}return m=f.type||p.type,k=j(c.resolve(k),m),l=j(c.resolve(f.value),m),h(k,l)?(p.isPending||(i=!0,p.isPending=!0),n&&(b=b.render(n,c)),i&&(p.isResolved=!0)):o&&(b=b.render(o,c)),b}function j(a,b){switch(b&&(b=b.toLowerCase()),b){case"number":return+a;case"string":return String(a);case"boolean":return a="false"===a?!1:a,Boolean(a);case"date":return new Date(a)}return a}var k={},l={tap:function(a,c,d){return b("tap"),d.resolve(a)},sep:function(a,b,c){var d=c.block;return b.stack.index===b.stack.of-1?a:d?d(a,b):a},first:function(a,b,c){return 0===b.stack.index?c.block(a,b):a},last:function(a,b,c){return b.stack.index===b.stack.of-1?c.block(a,b):a},contextDump:function(b,c,d,e){var f,h,i=c.resolve(e.to),j=c.resolve(e.key);switch(j){case"full":f=c.stack;break;default:f=c.stack.head}switch(h=JSON.stringify(f,g,2),i){case"console":a("contextDump",h);break;default:h=h.replace(/a}),lte:h("lte",function(a,b){return b>=a}),gt:h("gt",function(a,b){return a>b}),gte:h("gte",function(a,b){return a>=b}),any:function(b,c,e){var f=d(c);return f?f.isDeferredComplete?a("any","Must not be nested inside {@any} or {@none} block","ERROR"):b=b.map(function(a){f.deferreds.push(function(){f.isResolved&&(a=a.render(e.block,c)),a.end()})}):a("any","Must be used inside a {@select} block","ERROR"),b},none:function(b,c,e){var f=d(c);return f?f.isDeferredComplete?a("none","Must not be nested inside {@any} or {@none} block","ERROR"):b=b.map(function(a){f.deferreds.push(function(){f.isResolved||(a=a.render(e.block,c)),a.end()})}):a("none","Must be used inside a {@select} block","ERROR"),b},size:function(a,b,c,d){var e,f,g=d.key;if(g=b.resolve(d.key),g&&g!==!0)if(dust.isArray(g))e=g.length;else if(!isNaN(parseFloat(g))&&isFinite(g))e=g;else if("object"==typeof g){e=0;for(f in g)g.hasOwnProperty(f)&&e++}else e=(g+"").length;else e=0;return a.write(e)}};for(var m in l)dust.helpers[m]=l[m];return dust}); \ No newline at end of file diff --git a/package.json b/package.json index c56950a..159d495 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dustjs-helpers", - "version": "1.7.3", + "version": "1.7.4", "author": { "name": "Aleksander Williams", "url": "http://akdubya.github.com/dustjs"