Skip to content

Commit 786ebf1

Browse files
Merge pull request #24 from mohd-akram/remove-default-indent
Remove default indent closes #25 closes #22
2 parents 41827b1 + 0a0e06b commit 786ebf1

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

.verb.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ wrap(str, {width: 60});
4141

4242
Type: `String`
4343

44-
Default: ` ` (two spaces)
44+
Default: `` (none)
4545

4646
The string to use at the beginning of each line.
4747

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ wrap(str, {width: 60});
5050

5151
Type: `String`
5252

53-
Default: `` (two spaces)
53+
Default: `` (none)
5454

5555
The string to use at the beginning of each line.
5656

@@ -179,4 +179,4 @@ Released under the [MIT License](LICENSE).
179179

180180
***
181181

182-
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 02, 2017._
182+
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 02, 2017._

index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ declare namespace wrap {
1616

1717
/**
1818
* The string to use at the beginning of each line.
19-
* @default ´ ´ (two spaces)
19+
* @default ´´ (none)
2020
*/
2121
indent?: string;
2222

@@ -47,4 +47,4 @@ declare namespace wrap {
4747
*/
4848
cut?: boolean;
4949
}
50-
}
50+
}

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = function(str, options) {
1414
var width = options.width || 50;
1515
var indent = (typeof options.indent === 'string')
1616
? options.indent
17-
: ' ';
17+
: '';
1818

1919
var newline = options.newline || '\n' + indent;
2020
var escape = typeof options.escape === 'function'

test.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,58 +8,58 @@ var str = 'A project without documentation is like a project that doesn\'t exist
88

99
describe('wrap', function () {
1010
it('should use defaults to wrap words in the given string:', function () {
11-
assert.equal(wrap(str), ' A project without documentation is like a project \n that doesn\'t exist. Verb solves this by making it \n dead simple to generate project documentation, \n using simple markdown templates, with zero \n configuration required. ');
11+
assert.equal(wrap(str), 'A project without documentation is like a project \nthat doesn\'t exist. Verb solves this by making it \ndead simple to generate project documentation, \nusing simple markdown templates, with zero \nconfiguration required. ');
1212
});
1313

1414
it('should wrap to the specified width:', function () {
15-
assert.equal(wrap(str, {width: 40}), ' A project without documentation is like \n a project that doesn\'t exist. Verb \n solves this by making it dead simple to \n generate project documentation, using \n simple markdown templates, with zero \n configuration required. ');
15+
assert.equal(wrap(str, {width: 40}), 'A project without documentation is like \na project that doesn\'t exist. Verb \nsolves this by making it dead simple to \ngenerate project documentation, using \nsimple markdown templates, with zero \nconfiguration required. ');
1616
});
1717

1818
it('should indent the specified amount:', function () {
1919
assert.equal(wrap(str, {indent: ' '}), ' A project without documentation is like a project \n that doesn\'t exist. Verb solves this by making it \n dead simple to generate project documentation, \n using simple markdown templates, with zero \n configuration required. ');
2020
});
2121

2222
it('should use the given string for newlines:', function () {
23-
assert.equal(wrap(str, {newline: '\n\n-'}), ' A project without documentation is like a project \n\n-that doesn\'t exist. Verb solves this by making it \n\n-dead simple to generate project documentation, \n\n-using simple markdown templates, with zero \n\n-configuration required. ');
23+
assert.equal(wrap(str, {newline: '\n\n-'}), 'A project without documentation is like a project \n\n-that doesn\'t exist. Verb solves this by making it \n\n-dead simple to generate project documentation, \n\n-using simple markdown templates, with zero \n\n-configuration required. ');
2424
});
2525

2626
it('should run the escape function on each line', function () {
2727
assert.equal(
2828
wrap(str, {escape: function(e) {return e.replace('\'', '\\\'')}}),
29-
' A project without documentation is like a project \n that doesn\\\'t exist. Verb solves this by making it \n dead simple to generate project documentation, \n using simple markdown templates, with zero \n configuration required. '
29+
'A project without documentation is like a project \nthat doesn\\\'t exist. Verb solves this by making it \ndead simple to generate project documentation, \nusing simple markdown templates, with zero \nconfiguration required. '
3030
)
3131
});
3232

3333
it('should trim trailing whitespace:', function () {
34-
assert.equal(wrap(str, {trim: true}), ' A project without documentation is like a project\n that doesn\'t exist. Verb solves this by making it\n dead simple to generate project documentation,\n using simple markdown templates, with zero\n configuration required.');
34+
assert.equal(wrap(str, {trim: true}), 'A project without documentation is like a project\nthat doesn\'t exist. Verb solves this by making it\ndead simple to generate project documentation,\nusing simple markdown templates, with zero\nconfiguration required.');
3535
});
3636

3737
it('should handle strings with just newlines', function () {
3838
assert.equal(wrap('\r\n', {indent: '\r\n', width: 18}), '\r\n');
3939
});
4040

4141
it('should handle newlines that occur at the same position as `options.width`', function () {
42-
assert.equal(wrap('asdfg\nqwert', {width:5}), ' asdfg\n qwert');
43-
assert.equal(wrap('aaaaaa\nbbbbbb\ncccccc', {width:6}), ' aaaaaa\n bbbbbb\n cccccc');
42+
assert.equal(wrap('asdfg\nqwert', {width:5}), 'asdfg\nqwert');
43+
assert.equal(wrap('aaaaaa\nbbbbbb\ncccccc', {width:6}), 'aaaaaa\nbbbbbb\ncccccc');
4444
});
4545

4646
it('should handle strings that break where there are multiple spaces', function() {
47-
assert.equal(wrap('foo foo. bar', {width:8}), ' foo foo. \n bar');
48-
assert.equal(wrap('foo foo. bar', {width:8, trim: true}), ' foo foo.\n bar');
47+
assert.equal(wrap('foo foo. bar', {width:8}), 'foo foo. \nbar');
48+
assert.equal(wrap('foo foo. bar', {width:8, trim: true}), 'foo foo.\nbar');
4949
});
5050

5151
it('should cut one long word', function() {
52-
assert.equal(wrap('Supercalifragilisticexpialidocious', {width:24, cut:true}), ' Supercalifragilisticexpi\n alidocious');
52+
assert.equal(wrap('Supercalifragilisticexpialidocious', {width:24, cut:true}), 'Supercalifragilisticexpi\nalidocious');
5353
});
5454

5555
it('should cut long words', function() {
56-
assert.equal(wrap('Supercalifragilisticexpialidocious and Supercalifragilisticexpialidocious', {width:24, cut:true}), ' Supercalifragilisticexpi\n alidocious and Supercali\n fragilisticexpialidociou\n s');
56+
assert.equal(wrap('Supercalifragilisticexpialidocious and Supercalifragilisticexpialidocious', {width:24, cut:true}), 'Supercalifragilisticexpi\nalidocious and Supercali\nfragilisticexpialidociou\ns');
5757
});
5858

5959
it('should wrap on zero space characters', function () {
6060
assert.equal(
6161
wrap('Supercalifragilistic\u200Bexpialidocious', {width: 24}),
62-
' Supercalifragilistic\u200B\n expialidocious'
62+
'Supercalifragilistic\u200B\nexpialidocious'
6363
);
6464
});
6565
});

0 commit comments

Comments
 (0)