diff --git a/index.js b/index.js index 8ab64b4..3622820 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,6 @@ 'use strict'; const ansiRegex = require('ansi-regex'); -// Removes the `g` flag -const regex = new RegExp(ansiRegex().source); +const regex = ansiRegex({onlyFirst: true}); module.exports = string => regex.test(string);