replace jest with ava
This commit is contained in:
parent
27cc8b23fe
commit
0347b72305
11775 changed files with 84546 additions and 1440575 deletions
20
node_modules/equal-length/index.js
generated
vendored
Normal file
20
node_modules/equal-length/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
'use strict';
|
||||
|
||||
module.exports = input => {
|
||||
if (typeof input !== 'string') {
|
||||
throw new TypeError(`Expected input to be a string, got ${typeof input}`);
|
||||
}
|
||||
|
||||
const lines = input.split('\n');
|
||||
const maxLength = Math.max.apply(null, lines.map(line => line.length));
|
||||
|
||||
return lines
|
||||
.map(line => {
|
||||
if (line.length < maxLength) {
|
||||
line += ' '.repeat(maxLength - line.length);
|
||||
}
|
||||
|
||||
return line;
|
||||
})
|
||||
.join('\n');
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue