recoder-code
Version:
Complete AI-powered development platform with ML model training, plugin registry, real-time collaboration, monitoring, infrastructure automation, and enterprise deployment capabilities
20 lines (14 loc) • 343 B
JavaScript
;
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;