isite 2022.4.10 → 2022.4.15

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/lib/collection.js CHANGED
@@ -5,16 +5,15 @@ module.exports = function init(____0, option, db) {
5
5
  $collection.busy = !_;
6
6
  });
7
7
 
8
-
9
-
10
8
  if (typeof option === 'string') {
11
9
  option = {
12
- collection : option
13
- }
10
+ collection: option,
11
+ };
14
12
  $collection.collection = option;
15
13
  $collection.db = db || ____0.options.mongodb.db;
16
14
  }
17
15
  $collection.options = { ...____0.options.mongodb, ...option };
16
+ $collection.identityEnabled = $collection.options.identity.enabled;
18
17
 
19
18
  $collection.db = $collection.options.db.trim().replace(' ', '');
20
19
  $collection.collection = $collection.options.collection.trim().replace(' ', '');
@@ -83,7 +82,7 @@ module.exports = function init(____0, option, db) {
83
82
  }
84
83
  }
85
84
 
86
- if ($doc.id >= ____0.mongodb.collections_indexed[$collection.collection].nextID) {
85
+ if ($collection.identityEnabled === !0 && $doc.id >= ____0.mongodb.collections_indexed[$collection.collection].nextID) {
87
86
  ____0.mongodb.collections_indexed[$collection.collection].nextID = $doc.id + 1;
88
87
  }
89
88
 
@@ -396,7 +395,7 @@ module.exports = function init(____0, option, db) {
396
395
  }
397
396
  }
398
397
 
399
- if ($doc.id >= ____0.mongodb.collections_indexed[$collection.collection].nextID) {
398
+ if ($collection.identityEnabled === !0 && $doc.id >= ____0.mongodb.collections_indexed[$collection.collection].nextID) {
400
399
  ____0.mongodb.collections_indexed[$collection.collection].nextID = $doc.id + 1;
401
400
  }
402
401
  });
@@ -532,7 +531,6 @@ module.exports = function init(____0, option, db) {
532
531
  }
533
532
  };
534
533
 
535
-
536
534
  $collection.ObjectID = function (_id) {
537
535
  return new ____0.mongodb.ObjectID(_id);
538
536
  };
@@ -769,7 +767,7 @@ module.exports = function init(____0, option, db) {
769
767
 
770
768
  // id Handle
771
769
 
772
- if ($collection.options.identity.enabled) {
770
+ if ($collection.identityEnabled) {
773
771
  $collection.aggregate(
774
772
  [
775
773
  {
@@ -819,7 +817,7 @@ module.exports = function init(____0, option, db) {
819
817
  },
820
818
  );
821
819
 
822
- function handleIndex() {
820
+ $collection.handleIndex = function () {
823
821
  $collection.busy = !0;
824
822
  $collection.identityEnabled = !0;
825
823
  $collection.step = ____0.options.mongodb.identity.step;
@@ -854,9 +852,11 @@ module.exports = function init(____0, option, db) {
854
852
  $collection.busy = !1;
855
853
  },
856
854
  );
857
- }
855
+ };
858
856
 
859
- handleIndex();
857
+ $collection.handleIndex();
858
+ } else {
859
+ ____0.mongodb.collections_indexed[$collection.collection] = { nextID: 1 };
860
860
  }
861
861
 
862
862
  return $collection;
@@ -73,7 +73,7 @@ function setOptions(_options, ____0) {
73
73
  collection: '',
74
74
  },
75
75
  identity: {
76
- enabled: !0,
76
+ enabled: !1,
77
77
  start: 1,
78
78
  step: 1,
79
79
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isite",
3
- "version": "2022.04.10",
3
+ "version": "2022.04.15",
4
4
  "description": "Create Enterprise Multi-Language Web Site [Fast and Easy] ",
5
5
  "main": "index.js",
6
6
  "repository": {