mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 10:27:49 +00:00
Add util.pitch.
This commit is contained in:
@@ -5,7 +5,8 @@ var _ = require('lodash'),
|
||||
path = require('path');
|
||||
|
||||
var file = require('../common/file'),
|
||||
mapping = require('../common/mapping');
|
||||
mapping = require('../common/mapping'),
|
||||
util = require('../common/util');
|
||||
|
||||
var templatePath = path.join(__dirname, 'template/doc'),
|
||||
template = file.globTemplate(path.join(templatePath, '*.jst'));
|
||||
@@ -34,7 +35,7 @@ function toArgOrder(indexes) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts `funcNames` into a backticked chunked list string representation.
|
||||
* Converts `funcNames` into a chunked list string representation.
|
||||
*
|
||||
* @param {string[]} funcNames The function names.
|
||||
* @returns {string} Returns the function list string.
|
||||
@@ -64,17 +65,6 @@ function toFuncList(funcNames) {
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* A no-frills callback that throws any error it receives.
|
||||
*
|
||||
* @param {Object} [error] The error object.
|
||||
*/
|
||||
function onComplete(error) {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the FP-Guide wiki at the `target` path.
|
||||
*
|
||||
@@ -82,7 +72,7 @@ function onComplete(error) {
|
||||
*/
|
||||
function build(target) {
|
||||
target = path.resolve(target);
|
||||
fs.writeFile(target, template.wiki(templateData), onComplete);
|
||||
fs.writeFile(target, template.wiki(templateData), util.pitch);
|
||||
}
|
||||
|
||||
build(_.last(process.argv));
|
||||
|
||||
Reference in New Issue
Block a user