@cheetah.js/orm 0.1.21 → 0.1.23

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/dist/bun/index.js CHANGED
@@ -223710,6 +223710,22 @@ function getDefaultLength(type) {
223710
223710
  return null;
223711
223711
  }
223712
223712
 
223713
+ // ../../node_modules/balanced-match
223714
+ function Index(options) {
223715
+ return (target, propertyKey) => {
223716
+ const indexes = Metadata.get("indexes", target.constructor) || [];
223717
+ let index;
223718
+ if (options && options.properties) {
223719
+ const properties = options.properties;
223720
+ index = { name: `${properties.join("_")}_index`, properties: options.properties };
223721
+ } else {
223722
+ index = { name: `${propertyKey}_index`, properties: [propertyKey] };
223723
+ }
223724
+ indexes.push(index);
223725
+ Metadata.set("indexes", indexes, target.constructor);
223726
+ };
223727
+ }
223728
+
223713
223729
  // ../../node_modules/balanced-match/in
223714
223730
  function Property(options) {
223715
223731
  return (target, propertyKey) => {
@@ -223724,6 +223740,9 @@ function Property(options) {
223724
223740
  indexes.push({ name: `[TABLE]_pkey`, properties: [propertyKey] });
223725
223741
  Metadata.set("indexes", indexes, target.constructor);
223726
223742
  }
223743
+ if (options.index) {
223744
+ Index({ properties: [propertyKey] })(target, propertyKey);
223745
+ }
223727
223746
  properties.forEach((property) => {
223728
223747
  const types = Metadata.get(PROPERTIES_METADATA, target.constructor) || {};
223729
223748
  const type2 = Metadata.getType(target, property.propertyKey);
@@ -223752,21 +223771,6 @@ function ManyToOne(entity) {
223752
223771
  Metadata.set(PROPERTIES_RELATIONS, existing, target.constructor);
223753
223772
  };
223754
223773
  }
223755
- // ../../node_modules/balanced-match
223756
- function Index(options) {
223757
- return (target, propertyKey) => {
223758
- const indexes = Metadata.get("indexes", target.constructor) || [];
223759
- let index;
223760
- if (options && options.properties) {
223761
- const properties = options.properties;
223762
- index = { name: `${properties.join("_")}_index`, properties: options.properties };
223763
- } else {
223764
- index = { name: `${propertyKey}_index`, properties: [propertyKey] };
223765
- }
223766
- indexes.push(index);
223767
- Metadata.set("indexes", indexes, target.constructor);
223768
- };
223769
- }
223770
223774
  // ../../node_modules/balanced-match/inde
223771
223775
  function BeforeCreate() {
223772
223776
  return function(target, propertyName) {
@@ -225251,4 +225255,4 @@ export {
225251
225255
  AfterCreate
225252
225256
  };
225253
225257
 
225254
- //# debugId=78C9B65A64D6188F64756e2164756e21
225258
+ //# debugId=850B4C669C7C865464756e2164756e21