td-octopus 0.0.16 → 0.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "td-octopus",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
4
4
  "description": "I18N tool",
5
5
  "author": "Anthony Li",
6
6
  "bin": {
package/src/back/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * @Author: 郑泳健
4
4
  * @Date: 2022-06-01 13:56:18
5
5
  * @LastEditors: 郑泳健
6
- * @LastEditTime: 2023-01-11 11:07:41
6
+ * @LastEditTime: 2023-01-11 15:14:00
7
7
  */
8
8
  const path = require('path')
9
9
  const fs = require('fs')
@@ -151,7 +151,8 @@ const { getProjectConfig } = require('../utils/index')
151
151
  if (Array.isArray(matchList) && matchList.length) {
152
152
  sum += matchList.length;
153
153
  matchList.forEach(({ key, value }) => {
154
- code = code.replace(key, "'" + value + "'")
154
+ const replaceVal = value && value.includes("'") ? '"' + value + '"' : "'" + value + "'"
155
+ code = code.replace(key, replaceVal)
155
156
  })
156
157
  }
157
158