Fix ignore chars regex flags in rainbow example
Use global matches rather than stopping after the first match
This commit is contained in:
parent
1542c85f1b
commit
5da221af99
1 changed files with 1 additions and 1 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
const chalk = require('..');
|
const chalk = require('..');
|
||||||
|
|
||||||
const ignoreChars = /[^!-~]/;
|
const ignoreChars = /[^!-~]/g;
|
||||||
|
|
||||||
function rainbow(str, offset) {
|
function rainbow(str, offset) {
|
||||||
if (!str || str.length === 0) {
|
if (!str || str.length === 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue