@e22m4u/js-repository-mongodb-adapter 0.1.6 → 0.1.8

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/dist/cjs/index.cjs +42 -28
  2. package/package.json +9 -9
@@ -31342,24 +31342,24 @@ var require_lib3 = __commonJS({
31342
31342
  }
31343
31343
  });
31344
31344
 
31345
- // node_modules/@e22m4u/js-repository/node_modules/@e22m4u/js-format/src/utils/is-class.js
31345
+ // node_modules/@e22m4u/js-format/src/utils/is-class.js
31346
31346
  function isClass(value) {
31347
31347
  if (!value) return false;
31348
31348
  return typeof value === "function" && /^class\s/.test(Function.prototype.toString.call(value));
31349
31349
  }
31350
31350
  var init_is_class = __esm({
31351
- "node_modules/@e22m4u/js-repository/node_modules/@e22m4u/js-format/src/utils/is-class.js"() {
31351
+ "node_modules/@e22m4u/js-format/src/utils/is-class.js"() {
31352
31352
  }
31353
31353
  });
31354
31354
 
31355
- // node_modules/@e22m4u/js-repository/node_modules/@e22m4u/js-format/src/utils/index.js
31355
+ // node_modules/@e22m4u/js-format/src/utils/index.js
31356
31356
  var init_utils = __esm({
31357
- "node_modules/@e22m4u/js-repository/node_modules/@e22m4u/js-format/src/utils/index.js"() {
31357
+ "node_modules/@e22m4u/js-format/src/utils/index.js"() {
31358
31358
  init_is_class();
31359
31359
  }
31360
31360
  });
31361
31361
 
31362
- // node_modules/@e22m4u/js-repository/node_modules/@e22m4u/js-format/src/value-to-string.js
31362
+ // node_modules/@e22m4u/js-format/src/value-to-string.js
31363
31363
  function valueToString(input) {
31364
31364
  if (input == null) return String(input);
31365
31365
  if (typeof input === "string") return `"${input}"`;
@@ -31367,17 +31367,30 @@ function valueToString(input) {
31367
31367
  return String(input);
31368
31368
  if (isClass(input)) return input.name ? input.name : "Class";
31369
31369
  if (input.constructor && input.constructor.name)
31370
- return input.constructor.name;
31370
+ return BASE_CTOR_NAMES.includes(input.constructor.name) ? input.constructor.name : `${input.constructor.name} (instance)`;
31371
31371
  if (typeof input === "object" && input.constructor == null) return "Object";
31372
31372
  return String(input);
31373
31373
  }
31374
+ var BASE_CTOR_NAMES;
31374
31375
  var init_value_to_string = __esm({
31375
- "node_modules/@e22m4u/js-repository/node_modules/@e22m4u/js-format/src/value-to-string.js"() {
31376
+ "node_modules/@e22m4u/js-format/src/value-to-string.js"() {
31376
31377
  init_utils();
31378
+ BASE_CTOR_NAMES = [
31379
+ "String",
31380
+ "Number",
31381
+ "Boolean",
31382
+ "Object",
31383
+ "Array",
31384
+ "Function",
31385
+ "Symbol",
31386
+ "Map",
31387
+ "Set",
31388
+ "Date"
31389
+ ];
31377
31390
  }
31378
31391
  });
31379
31392
 
31380
- // node_modules/@e22m4u/js-repository/node_modules/@e22m4u/js-format/src/array-to-list.js
31393
+ // node_modules/@e22m4u/js-format/src/array-to-list.js
31381
31394
  function arrayToList(input) {
31382
31395
  if (Array.isArray(input) && input.length)
31383
31396
  return input.map(valueToString).join(SEPARATOR);
@@ -31385,13 +31398,13 @@ function arrayToList(input) {
31385
31398
  }
31386
31399
  var SEPARATOR;
31387
31400
  var init_array_to_list = __esm({
31388
- "node_modules/@e22m4u/js-repository/node_modules/@e22m4u/js-format/src/array-to-list.js"() {
31401
+ "node_modules/@e22m4u/js-format/src/array-to-list.js"() {
31389
31402
  init_value_to_string();
31390
31403
  SEPARATOR = ", ";
31391
31404
  }
31392
31405
  });
31393
31406
 
31394
- // node_modules/@e22m4u/js-repository/node_modules/@e22m4u/js-format/src/format.js
31407
+ // node_modules/@e22m4u/js-format/src/format.js
31395
31408
  function format(pattern) {
31396
31409
  if (pattern instanceof Date) {
31397
31410
  pattern = pattern.toISOString();
@@ -31404,7 +31417,6 @@ function format(pattern) {
31404
31417
  pattern = pattern.replace(re, function(match, escaped, ptn, flag) {
31405
31418
  let arg = args.shift();
31406
31419
  switch (flag) {
31407
- // eslint-disable-next-line no-fallthrough
31408
31420
  case "s":
31409
31421
  arg = String(arg);
31410
31422
  break;
@@ -31427,20 +31439,20 @@ function format(pattern) {
31427
31439
  });
31428
31440
  }
31429
31441
  if (args.length) pattern += " " + args.join(" ");
31430
- pattern = pattern.replace(/%{2,2}/g, "%");
31442
+ pattern = pattern.replace(/%{2}/g, "%");
31431
31443
  return "" + pattern;
31432
31444
  }
31433
31445
  var init_format = __esm({
31434
- "node_modules/@e22m4u/js-repository/node_modules/@e22m4u/js-format/src/format.js"() {
31446
+ "node_modules/@e22m4u/js-format/src/format.js"() {
31435
31447
  init_array_to_list();
31436
31448
  init_value_to_string();
31437
31449
  }
31438
31450
  });
31439
31451
 
31440
- // node_modules/@e22m4u/js-repository/node_modules/@e22m4u/js-format/src/errorf.js
31452
+ // node_modules/@e22m4u/js-format/src/errorf.js
31441
31453
  var Errorf;
31442
31454
  var init_errorf = __esm({
31443
- "node_modules/@e22m4u/js-repository/node_modules/@e22m4u/js-format/src/errorf.js"() {
31455
+ "node_modules/@e22m4u/js-format/src/errorf.js"() {
31444
31456
  init_format();
31445
31457
  Errorf = class extends Error {
31446
31458
  /**
@@ -31457,35 +31469,35 @@ var init_errorf = __esm({
31457
31469
  }
31458
31470
  });
31459
31471
 
31460
- // node_modules/@e22m4u/js-repository/node_modules/@e22m4u/js-format/src/index.js
31472
+ // node_modules/@e22m4u/js-format/src/index.js
31461
31473
  var init_src = __esm({
31462
- "node_modules/@e22m4u/js-repository/node_modules/@e22m4u/js-format/src/index.js"() {
31474
+ "node_modules/@e22m4u/js-format/src/index.js"() {
31463
31475
  init_format();
31464
31476
  init_errorf();
31465
31477
  }
31466
31478
  });
31467
31479
 
31468
- // node_modules/@e22m4u/js-repository/node_modules/@e22m4u/js-service/src/errors/invalid-argument-error.js
31480
+ // node_modules/@e22m4u/js-service/src/errors/invalid-argument-error.js
31469
31481
  var InvalidArgumentError;
31470
31482
  var init_invalid_argument_error = __esm({
31471
- "node_modules/@e22m4u/js-repository/node_modules/@e22m4u/js-service/src/errors/invalid-argument-error.js"() {
31483
+ "node_modules/@e22m4u/js-service/src/errors/invalid-argument-error.js"() {
31472
31484
  init_src();
31473
31485
  InvalidArgumentError = class extends Errorf {
31474
31486
  };
31475
31487
  }
31476
31488
  });
31477
31489
 
31478
- // node_modules/@e22m4u/js-repository/node_modules/@e22m4u/js-service/src/errors/index.js
31490
+ // node_modules/@e22m4u/js-service/src/errors/index.js
31479
31491
  var init_errors = __esm({
31480
- "node_modules/@e22m4u/js-repository/node_modules/@e22m4u/js-service/src/errors/index.js"() {
31492
+ "node_modules/@e22m4u/js-service/src/errors/index.js"() {
31481
31493
  init_invalid_argument_error();
31482
31494
  }
31483
31495
  });
31484
31496
 
31485
- // node_modules/@e22m4u/js-repository/node_modules/@e22m4u/js-service/src/service-container.js
31497
+ // node_modules/@e22m4u/js-service/src/service-container.js
31486
31498
  var ServiceContainer;
31487
31499
  var init_service_container = __esm({
31488
- "node_modules/@e22m4u/js-repository/node_modules/@e22m4u/js-service/src/service-container.js"() {
31500
+ "node_modules/@e22m4u/js-service/src/service-container.js"() {
31489
31501
  init_service();
31490
31502
  init_errors();
31491
31503
  ServiceContainer = class _ServiceContainer {
@@ -31614,10 +31626,10 @@ var init_service_container = __esm({
31614
31626
  }
31615
31627
  });
31616
31628
 
31617
- // node_modules/@e22m4u/js-repository/node_modules/@e22m4u/js-service/src/service.js
31629
+ // node_modules/@e22m4u/js-service/src/service.js
31618
31630
  var Service;
31619
31631
  var init_service = __esm({
31620
- "node_modules/@e22m4u/js-repository/node_modules/@e22m4u/js-service/src/service.js"() {
31632
+ "node_modules/@e22m4u/js-service/src/service.js"() {
31621
31633
  init_service_container();
31622
31634
  Service = class {
31623
31635
  /**
@@ -31690,9 +31702,9 @@ var init_service = __esm({
31690
31702
  }
31691
31703
  });
31692
31704
 
31693
- // node_modules/@e22m4u/js-repository/node_modules/@e22m4u/js-service/src/index.js
31705
+ // node_modules/@e22m4u/js-service/src/index.js
31694
31706
  var init_src2 = __esm({
31695
- "node_modules/@e22m4u/js-repository/node_modules/@e22m4u/js-service/src/index.js"() {
31707
+ "node_modules/@e22m4u/js-service/src/index.js"() {
31696
31708
  init_service();
31697
31709
  init_service_container();
31698
31710
  }
@@ -31943,7 +31955,7 @@ function isDeepEqual(firstValue, secondValue) {
31943
31955
  setForB.add(a);
31944
31956
  const propertyNamesA = [...keysA, ...symbolsA];
31945
31957
  for (const propertyNameA of propertyNamesA) {
31946
- if (!b.hasOwnProperty(propertyNameA)) return false;
31958
+ if (!Object.prototype.hasOwnProperty.call(b, propertyNameA)) return false;
31947
31959
  const propertyValueA = a[propertyNameA];
31948
31960
  const propertyValueB = b[propertyNameA];
31949
31961
  if (!compare(propertyValueA, propertyValueB)) return false;
@@ -37116,6 +37128,7 @@ var init_memory_adapter = __esm({
37116
37128
  * @param {object|undefined} filter
37117
37129
  * @returns {Promise<object>}
37118
37130
  */
37131
+ // eslint-disable-next-line no-unused-vars
37119
37132
  async replaceOrCreate(modelName, modelData, filter = void 0) {
37120
37133
  const pkPropName = this.getService(ModelDefinitionUtils).getPrimaryKeyAsPropertyName(
37121
37134
  modelName
@@ -37858,6 +37871,7 @@ function transformValuesDeep(value, transformer) {
37858
37871
  }
37859
37872
 
37860
37873
  // src/mongodb-adapter.js
37874
+ init_src2();
37861
37875
  var MONGODB_OPTION_NAMES = [
37862
37876
  "appname",
37863
37877
  "authMechanism",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e22m4u/js-repository-mongodb-adapter",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "MongoDB адаптер для @e22m4u/js-repository",
5
5
  "type": "module",
6
6
  "module": "./src/index.js",
@@ -16,14 +16,14 @@
16
16
  "lint": "eslint ./src",
17
17
  "lint:fix": "eslint ./src --fix",
18
18
  "format": "prettier --write \"./src/**/*.js\"",
19
- "test": "eslint ./src && c8 --reporter=text-summary mocha",
20
- "test:coverage": "eslint ./src && c8 --reporter=text mocha",
19
+ "test": "npm run lint && c8 --reporter=text-summary mocha",
20
+ "test:coverage": "npm run lint && c8 --reporter=text mocha",
21
21
  "build:cjs": "node build-cjs.js",
22
22
  "prepare": "husky"
23
23
  },
24
24
  "repository": {
25
25
  "type": "git",
26
- "url": "https://github.com/e22m4u/js-repository-mongodb-adapter.git"
26
+ "url": "git+https://github.com/e22m4u/js-repository-mongodb-adapter.git"
27
27
  },
28
28
  "keywords": [
29
29
  "MongoDB",
@@ -48,19 +48,19 @@
48
48
  "devDependencies": {
49
49
  "@commitlint/cli": "~19.5.0",
50
50
  "@commitlint/config-conventional": "~19.5.0",
51
- "@eslint/js": "~9.12.0",
51
+ "@eslint/js": "~9.14.0",
52
52
  "c8": "~10.1.2",
53
- "chai": "~5.1.1",
53
+ "chai": "~5.1.2",
54
54
  "chai-as-promised": "~8.0.0",
55
55
  "dotenv": "~16.4.5",
56
56
  "esbuild": "~0.24.0",
57
- "eslint": "~9.12.0",
57
+ "eslint": "~9.14.0",
58
58
  "eslint-config-prettier": "~9.1.0",
59
59
  "eslint-plugin-chai-expect": "~3.1.0",
60
60
  "eslint-plugin-mocha": "~10.5.0",
61
- "globals": "~15.10.0",
61
+ "globals": "~15.12.0",
62
62
  "husky": "~9.1.6",
63
- "mocha": "~10.7.3",
63
+ "mocha": "~10.8.2",
64
64
  "prettier": "~3.3.3"
65
65
  }
66
66
  }