@pisell/utils2
Advanced tools
@@ -11,2 +11,3 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } | ||
| import { getConfig, setConfig } from "./config"; | ||
| import _ from 'lodash'; | ||
| /** | ||
@@ -109,8 +110,7 @@ * @title: 获取当前语言 | ||
| _item = _context.sent; | ||
| console.log('resres', _item); | ||
| library = _objectSpread(_objectSpread({}, library), {}, _defineProperty({}, _item.locale, _item)); | ||
| library = _objectSpread(_objectSpread({}, library), {}, _defineProperty({}, _item.locale, _.mergeWith(library[_item.locale] || {}, _item))); | ||
| setConfig({ | ||
| library: library | ||
| }); | ||
| case 6: | ||
| case 5: | ||
| case "end": | ||
@@ -117,0 +117,0 @@ return _context.stop(); |
+15
-2
@@ -0,4 +1,6 @@ | ||
| var __create = Object.create; | ||
| var __defProp = Object.defineProperty; | ||
| var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
| var __getOwnPropNames = Object.getOwnPropertyNames; | ||
| var __getProtoOf = Object.getPrototypeOf; | ||
| var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
@@ -17,2 +19,10 @@ var __export = (target, all) => { | ||
| }; | ||
| var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
| // If the importer is in node compatibility mode or this is not an ESM | ||
| // file that has been converted to a CommonJS file using a Babel- | ||
| // compatible transform (i.e. "__esModule" has not been set), then set | ||
| // "default" to the CommonJS "module.exports" for node compatibility. | ||
| isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
| mod | ||
| )); | ||
| var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
@@ -33,2 +43,3 @@ | ||
| var import_config = require("./config"); | ||
| var import_lodash = __toESM(require("lodash")); | ||
| var getLocale = () => { | ||
@@ -63,4 +74,6 @@ return (0, import_config.getConfig)().locale; | ||
| const _item = await item.json(); | ||
| console.log("resres", _item); | ||
| library = { ...library, [_item.locale]: _item }; | ||
| library = { | ||
| ...library, | ||
| [_item.locale]: import_lodash.default.mergeWith(library[_item.locale] || {}, _item) | ||
| }; | ||
| (0, import_config.setConfig)({ library }); | ||
@@ -67,0 +80,0 @@ }); |
+3
-2
| { | ||
| "name": "@pisell/utils2", | ||
| "version": "1.0.8", | ||
| "version": "1.0.9", | ||
| "sideEffects": false, | ||
@@ -13,3 +13,4 @@ "main": "./lib/index.js", | ||
| "dayjs": "^1.11.9", | ||
| "axios": "^1.7.2" | ||
| "axios": "^1.7.2", | ||
| "lodash": "^4.17.21" | ||
| }, | ||
@@ -16,0 +17,0 @@ "dependencies": {}, |
57950
1.28%1153
1.14%5
25%