UNPKG

i18-fe-automator

Version:

前端代码提取中文并替换成$t函数

17 lines (16 loc) 555 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function formatKey(sourceKey, flag) { if (!sourceKey) { return String((Math.random() * 1000) >> 0) + (flag || 'debug3'); } sourceKey = String(sourceKey || ''); if (sourceKey && sourceKey.indexOf('[object Object]') > -1) { sourceKey = sourceKey + String((Math.random() * 1000) >> 0); } if (sourceKey && typeof sourceKey === 'string') { sourceKey = sourceKey.slice(0, 73); } return sourceKey; } exports.default = formatKey;