Fix ignore chars regex flags in rainbow example

Use global matches rather than stopping after the first match
This commit is contained in:
Atif Aziz 2018-10-25 12:00:36 +02:00 committed by GitHub
parent 1542c85f1b
commit 5da221af99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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) {