Deprecate utils.walk, remove prototype modification

This commit is contained in:
Peter Jaszkowiak
2017-04-08 21:02:06 -06:00
parent 1ed571189c
commit 1892492505
2 changed files with 10 additions and 8 deletions

View File

@@ -2,9 +2,13 @@
(function (factory) {
if (typeof module === 'object' && module.exports) {
var winston = require('winston');
var file = require('../../src/file');
module.exports = factory(require('xregexp'));
module.exports.walk = function (dir, done) {
// DEPRECATED
winston.warn('[deprecated] `utils.walk` is deprecated. Use `file.walk` instead.');
file.walk(dir, done);
};
@@ -424,11 +428,5 @@
};
}
if (typeof String.prototype.rtrim !== 'function') {
String.prototype.rtrim = function () {
return this.replace(/\s+$/g, '');
};
}
return utils;
}));