Files
setup-helm/node_modules/string-length/index.js
github-actions[bot] 20d2b4f98d v3 new release (#80)
2022-06-27 14:17:15 -04:00

20 lines
343 B
JavaScript

'use strict';
const stripAnsi = require('strip-ansi');
const charRegex = require('char-regex');
const stringLength = string => {
if (string === '') {
return 0;
}
const strippedString = stripAnsi(string);
if (strippedString === '') {
return 0;
}
return strippedString.match(charRegex()).length;
};
module.exports = stringLength;