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