Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / ccount / index.js
1 'use strict'
2
3 module.exports = ccount
4
5 function ccount(source, character) {
6   var value = String(source)
7   var count = 0
8   var index
9
10   if (typeof character !== 'string') {
11     throw new Error('Expected character')
12   }
13
14   index = value.indexOf(character)
15
16   while (index !== -1) {
17     count++
18     index = value.indexOf(character, index + character.length)
19   }
20
21   return count
22 }