mirror of
https://github.com/documentationjs/documentation.git
synced 2026-01-18 14:17:30 +00:00
17 lines
487 B
JavaScript
17 lines
487 B
JavaScript
'use strict';
|
|
|
|
var format = require('util').format;
|
|
var path = require('path');
|
|
|
|
/**
|
|
* Format an error message regarding a comment, prefixed with file name and line number.
|
|
*
|
|
* @param comment
|
|
* @param error
|
|
*/
|
|
module.exports = function(comment, error) {
|
|
var relativePath = path.relative(process.cwd(), comment.context.file);
|
|
return format.apply(format, ['%s:%d: ' + error, relativePath, comment.context.loc.start.line]
|
|
.concat(Array.prototype.slice.call(arguments, 2)));
|
|
};
|