mirror of
https://github.com/Azure/setup-kubectl.git
synced 2026-06-22 16:49:26 +08:00
Add node modules and new code for release (#39)
Co-authored-by: tbarnes94 <tbarnes94@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
a10d84bc2e
commit
7ad2aa66bb
+13
@@ -0,0 +1,13 @@
|
||||
'use strict';
|
||||
const stripAnsi = require('strip-ansi');
|
||||
const charRegex = require('char-regex');
|
||||
|
||||
const stringLength = string => {
|
||||
if (string === '') {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return stripAnsi(string).match(charRegex()).length;
|
||||
};
|
||||
|
||||
module.exports = stringLength;
|
||||
Reference in New Issue
Block a user