Fix ignore chars regex flags in rainbow example (#306)

Use global matches rather than stopping after the first match.
This commit is contained in:
Atif Aziz 2018-10-27 16:09:54 +02:00 committed by Sindre Sorhus
parent 1542c85f1b
commit b827cb0817

View file

@ -1,7 +1,7 @@
'use strict';
const chalk = require('..');
const ignoreChars = /[^!-~]/;
const ignoreChars = /[^!-~]/g;
function rainbow(str, offset) {
if (!str || str.length === 0) {