1
0
mirror of https://github.com/thangisme/notes.git synced 2025-09-24 13:34:06 -04:00

Initial commit

This commit is contained in:
Patrick Marsceill
2017-03-09 13:16:08 -05:00
commit b7b0d0d7bf
4147 changed files with 401224 additions and 0 deletions

50
node_modules/yargs/lib/wordwrap.js generated vendored Normal file
View File

@@ -0,0 +1,50 @@
// Simplified version of https://github.com/substack/node-wordwrap
'use strict';
module.exports = function (start, stop) {
if (!stop) {
stop = start;
start = 0;
}
var re = /(\S+\s+)/;
return function (text) {
var chunks = text.toString().split(re);
return chunks.reduce(function (lines, rawChunk) {
if (rawChunk === '') return lines;
var chunk = rawChunk.replace(/\t/g, ' ');
var i = lines.length - 1;
if (lines[i].length + chunk.length > stop) {
lines[i] = lines[i].replace(/\s+$/, '');
chunk.split(/\n/).forEach(function (c) {
lines.push(
new Array(start + 1).join(' ')
+ c.replace(/^\s+/, '')
);
});
}
else if (chunk.match(/\n/)) {
var xs = chunk.split(/\n/);
lines[i] += xs.shift();
xs.forEach(function (c) {
lines.push(
new Array(start + 1).join(' ')
+ c.replace(/^\s+/, '')
);
});
}
else {
lines[i] += chunk;
}
return lines;
}, [ new Array(start + 1).join(' ') ]).join('\n');
};
};