UNPKG

nsn-comp

Version:

NSN核心组件

22 lines (16 loc) 472 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getStrFullLength = void 0; var _nsnConst = require("nsn-const"); var getStrFullLength = function getStrFullLength(str) { return str.split(_nsnConst.NConst.EMPTY).reduce(function (pre, cur) { var charCode = cur.charCodeAt(0); if (charCode >= 0 && charCode <= 128) { return pre + 1; } return pre + 2; }, 0); }; exports.getStrFullLength = getStrFullLength;