Checks if substrings occur a minimum number of times in a string.
@see https://www.npmjs.com/package/@pelevesque/have-minimum-density for minimum density.
https://www.npmjs.com/package/@pelevesque/have-minimum-occurrences
npm install @pelevesque/have-minimum-occurrences
npm test
npm run cover
const haveMinimumOccurrences = require('@pelevesque/have-minimum-occurrences')
const str = 'A little string.'
const checks = [['i', 2]]
const result = haveMinimumOccurrences(str, checks)
// result === true
const str = 'A little string.'
const checks = [['i', 3]]
const result = haveMinimumOccurrences(str, checks)
// result === false
const str = 'A little string.'
const checks = [['i', 2], ['t', 3], [' ', 2]]
const result = haveMinimumOccurrences(str, checks)
// result === true
const str = 'A little string.'
const checks = [['i', 5], ['t', 3], [' ', 2]]
const result = haveMinimumOccurrences(str, checks)
// result === false
const str = 'aab111111aab'
const checks = [['aab', 2]]
const result = haveMinimumOccurrences(str, checks)
// result === true