Skip to content

Commit b64ec17

Browse files
committed
feat(words): Capitalize all when option is true
1 parent 59e8063 commit b64ec17

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

sentence.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function sentence(input, opts) {
2424
id = hash([id, 'sentence', i])
2525

2626
var firstOpts = conj(opts, {
27-
capitalize: true,
27+
capitalize: 'first',
2828
min: minWords,
2929
max: maxWords,
3030
unicode: unicode

words.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ var word = require('./word')
77
var DEFAULT_MIN_SYLLABLES = 1
88
var DEFAULT_MIN_WORDS = 2
99
var DEFAULT_MAX_WORDS = 3
10-
var DEFAULT_CAPITALIZE = true
10+
var DEFAULT_CAPITALIZE = 'first'
1111

1212
function words(input, opts) {
1313
opts = opts || 0
1414
var minSyllables = defaults(opts.minSyllables, DEFAULT_MIN_SYLLABLES)
1515
var capitalize = defaults(opts.capitalize, DEFAULT_CAPITALIZE)
16-
var shouldCapitalizeFirst = capitalize || capitalize === 'first'
17-
var shouldCapitalizeAll = capitalize === 'all'
16+
var shouldCapitalizeAll = capitalize === true || capitalize === 'all'
17+
var shouldCapitalizeFirst = shouldCapitalizeAll || capitalize === 'first'
1818
var min = defaults(opts.min, DEFAULT_MIN_WORDS)
1919
var max = defaults(opts.max, DEFAULT_MAX_WORDS)
2020

0 commit comments

Comments
 (0)