feat(utils): 添加string.prototype.replaceall shim,解决在低版本nodejs上无法工作的问题

This commit is contained in:
wxzhang 2023-03-29 17:35:54 +08:00
parent ad679f6942
commit d4fcf4bad3
3 changed files with 6 additions and 2 deletions

View File

@ -1,4 +1,4 @@
const { t } = require("./languages")
t("a")
t("b")
t("c")

View File

@ -2,6 +2,9 @@ const path = require("path")
const shelljs = require("shelljs")
const fs = require("fs-extra")
const semver = require('semver')
const replaceAll = require("string.prototype.replaceall")
// 由于replaceAll()方法在nodejs 15版本才支持所以这里做兼容处理
replaceAll.shim()
/**
*

View File

@ -12,7 +12,8 @@
"dependencies": {
"fs-extra": "^10.0.1",
"semver": "^7.3.7",
"shelljs": "^0.8.5"
"shelljs": "^0.8.5",
"string.prototype.replaceall": "^1.0.7"
},
"lastPublish": "2023-02-13T11:13:34+08:00"
}