mm_config 2.2.1 → 2.2.3

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.
Files changed (2) hide show
  1. package/index.js +5 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -289,6 +289,8 @@ function create(file, options = {}, config = {}) {
289
289
  let f = file.fullname();
290
290
  // 检查是否已存在配置
291
291
  if (dict[f]) {
292
+ // 如果配置已存在,更新options并返回代理
293
+ dict[f].setOptions(options);
292
294
  return dict[f].getProxy();
293
295
  }
294
296
  let cfg = new Config({ file: f, ...config }, options);
@@ -309,6 +311,8 @@ async function createAsync(file, options = {}, config = {}) {
309
311
  let f = file.fullname();
310
312
  // 检查是否已存在配置
311
313
  if (dict[f]) {
314
+ // 如果配置已存在,更新options并返回异步代理
315
+ dict[f].setOptions(options);
312
316
  return dict[f].getAsyncProxy();
313
317
  }
314
318
  let cfg = new Config({ file: f, ...config }, options);
@@ -348,7 +352,7 @@ function clearAll() {
348
352
  * @returns {Proxy} 配置代理对象
349
353
  */
350
354
  function conf(options, file, config = {}) {
351
- return createAsync(file, options, config);
355
+ return create(file, options, config);
352
356
  }
353
357
 
354
358
  // 模块导出
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_config",
3
- "version": "2.2.1",
3
+ "version": "2.2.3",
4
4
  "description": "Super Meimei Configuration Synchronizer - Automatically sync configuration changes to JSON files",
5
5
  "main": "index.js",
6
6
  "scripts": {