source: frontend/node_modules/string-length/index.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 343 bytes
Line 
1'use strict';
2const stripAnsi = require('strip-ansi');
3const charRegex = require('char-regex');
4
5const stringLength = string => {
6 if (string === '') {
7 return 0;
8 }
9
10 const strippedString = stripAnsi(string);
11
12 if (strippedString === '') {
13 return 0;
14 }
15
16 return strippedString.match(charRegex()).length;
17};
18
19module.exports = stringLength;
Note: See TracBrowser for help on using the repository browser.