@cheetah.js/orm 0.1.21 → 0.1.22

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
@@ -33537,12 +33537,12 @@ ${lanes.join("\n")}
33537
33537
  function createESDecorateContextObject(contextIn) {
33538
33538
  return contextIn.kind === "class" ? createESDecorateClassContextObject(contextIn) : createESDecorateClassElementContextObject(contextIn);
33539
33539
  }
33540
- function createESDecorateHelper(ctor, descriptorIn, decorators5, contextIn, initializers, extraInitializers) {
33540
+ function createESDecorateHelper(ctor, descriptorIn, decorators6, contextIn, initializers, extraInitializers) {
33541
33541
  context.requestEmitHelper(esDecorateHelper);
33542
33542
  return factory2.createCallExpression(getUnscopedHelperName("__esDecorate"), undefined, [
33543
33543
  ctor ?? factory2.createNull(),
33544
33544
  descriptorIn ?? factory2.createNull(),
33545
- decorators5,
33545
+ decorators6,
33546
33546
  createESDecorateContextObject(contextIn),
33547
33547
  initializers,
33548
33548
  extraInitializers
@@ -87619,7 +87619,7 @@ ${lanes.join("\n")}
87619
87619
  return !isStatic(member) && (isMethodOrAccessor(member) || isAutoAccessorPropertyDeclaration(member)) && isPrivateIdentifier(member.name);
87620
87620
  }
87621
87621
  function getDecoratorsOfParameters(node) {
87622
- let decorators5;
87622
+ let decorators6;
87623
87623
  if (node) {
87624
87624
  const parameters = node.parameters;
87625
87625
  const firstParameterIsThis = parameters.length > 0 && parameterIsThisKeyword(parameters[0]);
@@ -87627,24 +87627,24 @@ ${lanes.join("\n")}
87627
87627
  const numParameters = firstParameterIsThis ? parameters.length - 1 : parameters.length;
87628
87628
  for (let i = 0;i < numParameters; i++) {
87629
87629
  const parameter = parameters[i + firstParameterOffset];
87630
- if (decorators5 || hasDecorators(parameter)) {
87631
- if (!decorators5) {
87632
- decorators5 = new Array(numParameters);
87630
+ if (decorators6 || hasDecorators(parameter)) {
87631
+ if (!decorators6) {
87632
+ decorators6 = new Array(numParameters);
87633
87633
  }
87634
- decorators5[i] = getDecorators(parameter);
87634
+ decorators6[i] = getDecorators(parameter);
87635
87635
  }
87636
87636
  }
87637
87637
  }
87638
- return decorators5;
87638
+ return decorators6;
87639
87639
  }
87640
87640
  function getAllDecoratorsOfClass(node) {
87641
- const decorators5 = getDecorators(node);
87641
+ const decorators6 = getDecorators(node);
87642
87642
  const parameters = getDecoratorsOfParameters(getFirstConstructorWithBody(node));
87643
- if (!some(decorators5) && !some(parameters)) {
87643
+ if (!some(decorators6) && !some(parameters)) {
87644
87644
  return;
87645
87645
  }
87646
87646
  return {
87647
- decorators: decorators5,
87647
+ decorators: decorators6,
87648
87648
  parameters
87649
87649
  };
87650
87650
  }
@@ -87673,13 +87673,13 @@ ${lanes.join("\n")}
87673
87673
  if (!firstAccessorWithDecorators || accessor !== firstAccessorWithDecorators) {
87674
87674
  return;
87675
87675
  }
87676
- const decorators5 = getDecorators(firstAccessorWithDecorators);
87676
+ const decorators6 = getDecorators(firstAccessorWithDecorators);
87677
87677
  const parameters = getDecoratorsOfParameters(setAccessor);
87678
- if (!some(decorators5) && !some(parameters)) {
87678
+ if (!some(decorators6) && !some(parameters)) {
87679
87679
  return;
87680
87680
  }
87681
87681
  return {
87682
- decorators: decorators5,
87682
+ decorators: decorators6,
87683
87683
  parameters,
87684
87684
  getDecorators: getAccessor && getDecorators(getAccessor),
87685
87685
  setDecorators: setAccessor && getDecorators(setAccessor)
@@ -87689,19 +87689,19 @@ ${lanes.join("\n")}
87689
87689
  if (!method.body) {
87690
87690
  return;
87691
87691
  }
87692
- const decorators5 = getDecorators(method);
87692
+ const decorators6 = getDecorators(method);
87693
87693
  const parameters = getDecoratorsOfParameters(method);
87694
- if (!some(decorators5) && !some(parameters)) {
87694
+ if (!some(decorators6) && !some(parameters)) {
87695
87695
  return;
87696
87696
  }
87697
- return { decorators: decorators5, parameters };
87697
+ return { decorators: decorators6, parameters };
87698
87698
  }
87699
87699
  function getAllDecoratorsOfProperty(property2) {
87700
- const decorators5 = getDecorators(property2);
87701
- if (!some(decorators5)) {
87700
+ const decorators6 = getDecorators(property2);
87701
+ if (!some(decorators6)) {
87702
87702
  return;
87703
87703
  }
87704
- return { decorators: decorators5 };
87704
+ return { decorators: decorators6 };
87705
87705
  }
87706
87706
  function walkUpLexicalEnvironments(env, cb) {
87707
87707
  while (env) {
@@ -88853,20 +88853,20 @@ ${lanes.join("\n")}
88853
88853
  }
88854
88854
  function getOldTypeMetadata(node, container11) {
88855
88855
  if (typeSerializer) {
88856
- let decorators5;
88856
+ let decorators6;
88857
88857
  if (shouldAddTypeMetadata(node)) {
88858
88858
  const typeMetadata = emitHelpers().createMetadataHelper("design:type", typeSerializer.serializeTypeOfNode({ currentLexicalScope, currentNameScope: container11 }, node));
88859
- decorators5 = append(decorators5, factory2.createDecorator(typeMetadata));
88859
+ decorators6 = append(decorators6, factory2.createDecorator(typeMetadata));
88860
88860
  }
88861
88861
  if (shouldAddParamTypesMetadata(node)) {
88862
88862
  const paramTypesMetadata = emitHelpers().createMetadataHelper("design:paramtypes", typeSerializer.serializeParameterTypesOfNode({ currentLexicalScope, currentNameScope: container11 }, node, container11));
88863
- decorators5 = append(decorators5, factory2.createDecorator(paramTypesMetadata));
88863
+ decorators6 = append(decorators6, factory2.createDecorator(paramTypesMetadata));
88864
88864
  }
88865
88865
  if (shouldAddReturnTypeMetadata(node)) {
88866
88866
  const returnTypeMetadata = emitHelpers().createMetadataHelper("design:returntype", typeSerializer.serializeReturnTypeOfNode({ currentLexicalScope, currentNameScope: container11 }, node));
88867
- decorators5 = append(decorators5, factory2.createDecorator(returnTypeMetadata));
88867
+ decorators6 = append(decorators6, factory2.createDecorator(returnTypeMetadata));
88868
88868
  }
88869
- return decorators5;
88869
+ return decorators6;
88870
88870
  }
88871
88871
  }
88872
88872
  function getNewTypeMetadata(node, container11) {
@@ -91776,9 +91776,9 @@ ${lanes.join("\n")}
91776
91776
  if (!allDecorators) {
91777
91777
  return;
91778
91778
  }
91779
- const { false: decorators5, true: metadata } = groupBy(allDecorators.decorators, isSyntheticMetadataDecorator);
91779
+ const { false: decorators6, true: metadata } = groupBy(allDecorators.decorators, isSyntheticMetadataDecorator);
91780
91780
  const decoratorExpressions = [];
91781
- addRange(decoratorExpressions, map(decorators5, transformDecorator));
91781
+ addRange(decoratorExpressions, map(decorators6, transformDecorator));
91782
91782
  addRange(decoratorExpressions, flatMap(allDecorators.parameters, transformDecoratorsOfParameter));
91783
91783
  addRange(decoratorExpressions, map(metadata, transformDecorator));
91784
91784
  return decoratorExpressions;
@@ -91837,11 +91837,11 @@ ${lanes.join("\n")}
91837
91837
  function transformDecorator(decorator) {
91838
91838
  return Debug.checkDefined(visitNode(decorator.expression, visitor, isExpression));
91839
91839
  }
91840
- function transformDecoratorsOfParameter(decorators5, parameterOffset) {
91840
+ function transformDecoratorsOfParameter(decorators6, parameterOffset) {
91841
91841
  let expressions;
91842
- if (decorators5) {
91842
+ if (decorators6) {
91843
91843
  expressions = [];
91844
- for (const decorator of decorators5) {
91844
+ for (const decorator of decorators6) {
91845
91845
  const helper = emitHelpers().createParamHelper(transformDecorator(decorator), parameterOffset);
91846
91846
  setTextRange(helper, decorator.expression);
91847
91847
  setEmitFlags(helper, 3072);
@@ -106784,9 +106784,9 @@ ${lanes.join("\n")}
106784
106784
  decreaseIndent();
106785
106785
  }
106786
106786
  }
106787
- function emitDecoratorList(parentNode, decorators5) {
106788
- emitList(parentNode, decorators5, 2146305);
106789
- const lastDecorator = lastOrUndefined(decorators5);
106787
+ function emitDecoratorList(parentNode, decorators6) {
106788
+ emitList(parentNode, decorators6, 2146305);
106789
+ const lastDecorator = lastOrUndefined(decorators6);
106790
106790
  return lastDecorator && !positionIsSynthesized(lastDecorator.end) ? lastDecorator.end : parentNode.pos;
106791
106791
  }
106792
106792
  function emitTypeArguments(parentNode, typeArguments) {
@@ -125737,8 +125737,8 @@ ${lanes.join("\n")}
125737
125737
  case 262:
125738
125738
  return factory.updateFunctionDeclaration(d, modifiers, d.asteriskToken, d.name, d.typeParameters, d.parameters, d.type, d.body);
125739
125739
  case 263:
125740
- const decorators5 = canHaveDecorators(d) ? getDecorators(d) : undefined;
125741
- return factory.updateClassDeclaration(d, concatenate(decorators5, modifiers), d.name, d.typeParameters, d.heritageClauses, d.members);
125740
+ const decorators6 = canHaveDecorators(d) ? getDecorators(d) : undefined;
125741
+ return factory.updateClassDeclaration(d, concatenate(decorators6, modifiers), d.name, d.typeParameters, d.heritageClauses, d.members);
125742
125742
  case 243:
125743
125743
  return factory.updateVariableStatement(d, modifiers, d.declarationList);
125744
125744
  case 267:
@@ -142378,12 +142378,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
142378
142378
  return { modifiers: 0 };
142379
142379
  }
142380
142380
  let modifiers = 0;
142381
- let decorators5;
142381
+ let decorators6;
142382
142382
  let contextMod;
142383
142383
  const range = { pos: position, end: position };
142384
142384
  if (isPropertyDeclaration(contextToken.parent) && contextToken.parent.modifiers) {
142385
142385
  modifiers |= modifiersToFlags(contextToken.parent.modifiers) & 126975;
142386
- decorators5 = contextToken.parent.modifiers.filter(isDecorator) || [];
142386
+ decorators6 = contextToken.parent.modifiers.filter(isDecorator) || [];
142387
142387
  range.pos = Math.min(range.pos, contextToken.parent.modifiers.pos);
142388
142388
  }
142389
142389
  if (contextMod = isModifierLike2(contextToken)) {
@@ -142393,7 +142393,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
142393
142393
  range.pos = Math.min(range.pos, contextToken.pos);
142394
142394
  }
142395
142395
  }
142396
- return { modifiers, decorators: decorators5, range: range.pos !== position ? range : undefined };
142396
+ return { modifiers, decorators: decorators6, range: range.pos !== position ? range : undefined };
142397
142397
  }
142398
142398
  function isModifierLike2(node) {
142399
142399
  if (isModifier(node)) {
@@ -159635,13 +159635,13 @@ var require_ts_morph_common = __commonJS((exports) => {
159635
159635
  }
159636
159636
  return decorator;
159637
159637
  };
159638
- var __decorate9 = function(decorators5, target, key, desc) {
159638
+ var __decorate9 = function(decorators6, target, key, desc) {
159639
159639
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
159640
159640
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
159641
- r = Reflect.decorate(decorators5, target, key, desc);
159641
+ r = Reflect.decorate(decorators6, target, key, desc);
159642
159642
  else
159643
- for (var i = decorators5.length - 1;i >= 0; i--)
159644
- if (d = decorators5[i])
159643
+ for (var i = decorators6.length - 1;i >= 0; i--)
159644
+ if (d = decorators6[i])
159645
159645
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
159646
159646
  return c > 3 && r && Object.defineProperty(target, key, r), r;
159647
159647
  };
@@ -194610,10 +194610,10 @@ var require_ts_morph = __commonJS((exports) => {
194610
194610
  if (common.ArrayUtils.isNullOrEmpty(structures))
194611
194611
  return [];
194612
194612
  const decoratorLines = getDecoratorLines(this, structures);
194613
- const decorators5 = this.getDecorators();
194614
- index = verifyAndGetIndex(index, decorators5.length);
194615
- const formattingKind = getDecoratorFormattingKind(this, decorators5);
194616
- const previousDecorator = decorators5[index - 1];
194613
+ const decorators6 = this.getDecorators();
194614
+ index = verifyAndGetIndex(index, decorators6.length);
194615
+ const formattingKind = getDecoratorFormattingKind(this, decorators6);
194616
+ const previousDecorator = decorators6[index - 1];
194617
194617
  const decoratorCode = getNewInsertCode({
194618
194618
  structures,
194619
194619
  newCodes: decoratorLines,
@@ -194624,11 +194624,11 @@ var require_ts_morph = __commonJS((exports) => {
194624
194624
  nextFormattingKind: previousDecorator == null ? formattingKind : FormattingKind.None
194625
194625
  });
194626
194626
  insertIntoParentTextRange({
194627
- parent: (_d = (_b = (_a = decorators5[0]) === null || _a === undefined ? undefined : _a.getParentSyntaxListOrThrow()) !== null && _b !== undefined ? _b : (_c = this.getModifiers()[0]) === null || _c === undefined ? undefined : _c.getParentSyntaxListOrThrow()) !== null && _d !== undefined ? _d : this,
194628
- insertPos: index === 0 ? ((_e = decorators5[0]) !== null && _e !== undefined ? _e : this).getStart() : decorators5[index - 1].getEnd(),
194627
+ parent: (_d = (_b = (_a = decorators6[0]) === null || _a === undefined ? undefined : _a.getParentSyntaxListOrThrow()) !== null && _b !== undefined ? _b : (_c = this.getModifiers()[0]) === null || _c === undefined ? undefined : _c.getParentSyntaxListOrThrow()) !== null && _d !== undefined ? _d : this,
194628
+ insertPos: index === 0 ? ((_e = decorators6[0]) !== null && _e !== undefined ? _e : this).getStart() : decorators6[index - 1].getEnd(),
194629
194629
  newText: decoratorCode
194630
194630
  });
194631
- return getNodesToReturn(decorators5, this.getDecorators(), index, false);
194631
+ return getNodesToReturn(decorators6, this.getDecorators(), index, false);
194632
194632
  }
194633
194633
  set(structure) {
194634
194634
  callBaseSet(Base.prototype, this, structure);
@@ -197401,13 +197401,13 @@ var require_ts_morph = __commonJS((exports) => {
197401
197401
  if (!namespaceDec.hasDeclareKeyword())
197402
197402
  namespaceDec.setHasDeclareKeyword(true);
197403
197403
  };
197404
- var __decorate9 = function(decorators5, target, key, desc) {
197404
+ var __decorate9 = function(decorators6, target, key, desc) {
197405
197405
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
197406
197406
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
197407
- r = Reflect.decorate(decorators5, target, key, desc);
197407
+ r = Reflect.decorate(decorators6, target, key, desc);
197408
197408
  else
197409
- for (var i = decorators5.length - 1;i >= 0; i--)
197410
- if (d = decorators5[i])
197409
+ for (var i = decorators6.length - 1;i >= 0; i--)
197410
+ if (d = decorators6[i])
197411
197411
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
197412
197412
  return c > 3 && r && Object.defineProperty(target, key, r), r;
197413
197413
  };
@@ -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=5A66BAD421ECF19364756e2164756e21