helper-lib
Advanced tools
@@ -7,7 +7,21 @@ /*! html helpers | ||
| module.exports.register = function(Handlebars, options) { | ||
| var HTML, Utils, grunt; | ||
| var HTML, Utils, grunt, util; | ||
| grunt = require('grunt'); | ||
| util = require('util'); | ||
| Utils = require('../utils/utils'); | ||
| HTML = require('../utils/html'); | ||
| Handlebars.registerHelper("inspect", function(obj, ext) { | ||
| var html, md, result; | ||
| if (Utils.isUndefined(options.ext)) { | ||
| ext = ".html"; | ||
| } else { | ||
| ext = options.ext; | ||
| } | ||
| md = "``` " + "json" + "\n" + (util.inspect(obj, true, null)) + "\n```"; | ||
| html = '<pre class="json">' + '\n' + (util.inspect(obj, true, null)) + '\n</pre>'; | ||
| result = Utils.switchOutput(ext, md, html); | ||
| return Utils.safeString(result); | ||
| }); | ||
| Handlebars.registerHelper("_link", function(url, text, linkClass) { | ||
@@ -14,0 +28,0 @@ var html, md, result; |
@@ -6,3 +6,3 @@ /*! logging helpers | ||
| (function() { | ||
| var Utils, debug, expandJSON, expandYAML, grunt, inspect, log, to; | ||
| var Utils, debug, expandJSON, expandMapping, expandYAML, grunt, log, to; | ||
@@ -15,12 +15,2 @@ Utils = require('../utils/utils'); | ||
| module.exports.inspect = inspect = function(obj, language) { | ||
| var result; | ||
| if (Utils.isUndefined(language)) { | ||
| language = ""; | ||
| } | ||
| result = '``` ' + language + '\n' + require('util').inspect(obj, 10, null).replace('{', '{\n ').replace('}', '\n}') + '\n```'; | ||
| return Utils.safeString(result); | ||
| }; | ||
| module.exports.log = log = function(value) { | ||
@@ -38,2 +28,10 @@ return console.log(value); | ||
| module.exports.expandMapping = expandMapping = function(src) { | ||
| var list, yml; | ||
| list = Utils.expandMapping(src); | ||
| yml = to.format.yaml.stringify(list); | ||
| return Utils.safeString(yml); | ||
| }; | ||
| module.exports.expandYAML = expandYAML = function(src) { | ||
@@ -56,5 +54,5 @@ var list, yml; | ||
| module.exports.register = function(Handlebars, options) { | ||
| Handlebars.registerHelper("expandMapping", expandMapping); | ||
| Handlebars.registerHelper("expandYAML", expandYAML); | ||
| Handlebars.registerHelper("expandJSON", expandJSON); | ||
| Handlebars.registerHelper("inspect", inspect); | ||
| Handlebars.registerHelper("log", log); | ||
@@ -61,0 +59,0 @@ Handlebars.registerHelper("debug", debug); |
+1
-1
| { | ||
| "name": "helper-lib", | ||
| "description": "Extensive collection of Handlebars helpers.", | ||
| "version": "0.2.4", | ||
| "version": "0.2.5", | ||
| "homepage": "https://github.com/assemble/helper-lib", | ||
@@ -6,0 +6,0 @@ "author": { |
+2
-2
@@ -1,2 +0,2 @@ | ||
| # [Helper Library v0.2.4](http://github.com/assemble/helper-lib) [](https://travis-ci.org/assemble/helper-lib) | ||
| # [Helper Library v0.2.5](http://github.com/assemble/helper-lib) [](https://travis-ci.org/assemble/helper-lib) | ||
@@ -1806,3 +1806,3 @@ > Extensive collection of Handlebars helpers. | ||
| _This file was generated using Grunt and [assemble](http://github.com/assemble/assemble) on Sat May 18 2013 00:43:53._ | ||
| _This file was generated using Grunt and [assemble](http://github.com/assemble/assemble) on Sun May 26 2013 10:24:06._ | ||
@@ -1809,0 +1809,0 @@ |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
116000
0.35%2153
0.51%