@glutinum/cli 1.0.0-beta.4 → 1.0.0-beta.5

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.
@@ -5926,28 +5926,189 @@ function transform(typeMemory, state, reporter, typeLiteralsMemory, importSource
5926
5926
  }, rest);
5927
5927
  const exports_1 = (importSource.tag === 1) ? append(patternInput[0], append(classes, reExportedClasses)) : ((importSource.tag === 0) ? append(patternInput[0], append(classes, reExportedClasses)) : empty());
5928
5928
  const rootTransformContext = TransformContext_$ctor_Z1635F75A(reporter, "", typeMemory, state, typeLiteralsMemory, importSource);
5929
- const rest_1 = transformToFsharp(rootTransformContext, rest);
5929
+ let typeTestAttributes;
5930
+ const classDeclarations = choose((_arg_3) => {
5931
+ let matchResult_6, info_12;
5932
+ switch (_arg_3.tag) {
5933
+ case 12: {
5934
+ matchResult_6 = 0;
5935
+ info_12 = _arg_3.fields[0];
5936
+ break;
5937
+ }
5938
+ case 25: {
5939
+ if (_arg_3.fields[0].tag === 12) {
5940
+ matchResult_6 = 0;
5941
+ info_12 = _arg_3.fields[0].fields[0];
5942
+ }
5943
+ else {
5944
+ matchResult_6 = 1;
5945
+ }
5946
+ break;
5947
+ }
5948
+ default:
5949
+ matchResult_6 = 1;
5950
+ }
5951
+ switch (matchResult_6) {
5952
+ case 0:
5953
+ return info_12;
5954
+ default:
5955
+ return undefined;
5956
+ }
5957
+ }, glueAst_2);
5958
+ const defaultExported = ofSeq(choose((_arg_4) => {
5959
+ let matchResult_7, info_14, name_8;
5960
+ if (_arg_4.tag === 25) {
5961
+ switch (_arg_4.fields[0].tag) {
5962
+ case 12: {
5963
+ matchResult_7 = 0;
5964
+ info_14 = _arg_4.fields[0].fields[0];
5965
+ break;
5966
+ }
5967
+ case 2: {
5968
+ if (exists((info_13) => (info_13.Name === _arg_4.fields[0].fields[0].Name), classDeclarations)) {
5969
+ matchResult_7 = 1;
5970
+ name_8 = _arg_4.fields[0].fields[0].Name;
5971
+ }
5972
+ else {
5973
+ matchResult_7 = 2;
5974
+ }
5975
+ break;
5976
+ }
5977
+ default:
5978
+ matchResult_7 = 2;
5979
+ }
5980
+ }
5981
+ else {
5982
+ matchResult_7 = 2;
5983
+ }
5984
+ switch (matchResult_7) {
5985
+ case 0:
5986
+ return info_14.Name;
5987
+ case 1:
5988
+ return name_8;
5989
+ default:
5990
+ return undefined;
5991
+ }
5992
+ }, glueAst_2), {
5993
+ Compare: (x_2, y_2) => (comparePrimitives(x_2, y_2) | 0),
5994
+ });
5995
+ const classes_1 = ofSeq(map((_arg_5) => _arg_5.Name, filter((info_15) => {
5996
+ if (info_15.IsExported) {
5997
+ return true;
5998
+ }
5999
+ else {
6000
+ return equals(importSource, ImportSource.Global);
6001
+ }
6002
+ }, classDeclarations)), {
6003
+ Compare: (x_3, y_3) => (comparePrimitives(x_3, y_3) | 0),
6004
+ });
6005
+ const constructorVariables = ofSeq(choose((_arg_6) => {
6006
+ let matchResult_8, name_10, members_1, name_11;
6007
+ if (_arg_6.tag === 2) {
6008
+ switch (_arg_6.fields[0].Type.tag) {
6009
+ case 29: {
6010
+ matchResult_8 = 0;
6011
+ name_10 = _arg_6.fields[0].Name;
6012
+ break;
6013
+ }
6014
+ case 22: {
6015
+ if (exists((_arg_7) => {
6016
+ if (_arg_7.tag === 7) {
6017
+ return true;
6018
+ }
6019
+ else {
6020
+ return false;
6021
+ }
6022
+ }, _arg_6.fields[0].Type.fields[0].Members)) {
6023
+ matchResult_8 = 1;
6024
+ members_1 = _arg_6.fields[0].Type.fields[0].Members;
6025
+ name_11 = _arg_6.fields[0].Name;
6026
+ }
6027
+ else {
6028
+ matchResult_8 = 2;
6029
+ }
6030
+ break;
6031
+ }
6032
+ default:
6033
+ matchResult_8 = 2;
6034
+ }
6035
+ }
6036
+ else {
6037
+ matchResult_8 = 2;
6038
+ }
6039
+ switch (matchResult_8) {
6040
+ case 0:
6041
+ return name_10;
6042
+ case 1:
6043
+ return name_11;
6044
+ default:
6045
+ return undefined;
6046
+ }
6047
+ }, glueAst_2), {
6048
+ Compare: (x_4, y_4) => (comparePrimitives(x_4, y_4) | 0),
6049
+ });
6050
+ typeTestAttributes = ((name_12) => (!isTopLevel ? empty() : (FSharpSet__Contains(defaultExported, name_12) ? importDefaultAttribute(name_12, importSource) : ((FSharpSet__Contains(classes_1, name_12) ? true : FSharpSet__Contains(constructorVariables, name_12)) ? importAttribute(name_12, importSource) : empty()))));
6051
+ const rest_1 = map((_arg_9) => {
6052
+ let matchResult_9, info_17, fsharpType;
6053
+ if (_arg_9.tag === 5) {
6054
+ if (!exists((_arg_8) => {
6055
+ switch (_arg_8.tag) {
6056
+ case 3:
6057
+ case 5:
6058
+ case 4:
6059
+ case 21:
6060
+ return true;
6061
+ default:
6062
+ return false;
6063
+ }
6064
+ }, _arg_9.fields[0].Attributes)) {
6065
+ matchResult_9 = 0;
6066
+ info_17 = _arg_9.fields[0];
6067
+ }
6068
+ else {
6069
+ matchResult_9 = 1;
6070
+ fsharpType = _arg_9;
6071
+ }
6072
+ }
6073
+ else {
6074
+ matchResult_9 = 1;
6075
+ fsharpType = _arg_9;
6076
+ }
6077
+ switch (matchResult_9) {
6078
+ case 0: {
6079
+ const matchValue_1 = typeTestAttributes(info_17.OriginalName);
6080
+ if (isEmpty(matchValue_1)) {
6081
+ return new FSharpType(/* Interface */ 5, [info_17]);
6082
+ }
6083
+ else {
6084
+ return new FSharpType(/* Interface */ 5, [new FSharpInterface(append(info_17.Attributes, matchValue_1), info_17.Name, info_17.XmlDoc, info_17.OriginalName, info_17.TypeParameters, info_17.Members, info_17.Inheritance)]);
6085
+ }
6086
+ }
6087
+ default:
6088
+ return fsharpType;
6089
+ }
6090
+ }, transformToFsharp(rootTransformContext, rest));
5930
6091
  let exportsType_1;
5931
6092
  if (isEmpty(exports_1)) {
5932
6093
  exportsType_1 = undefined;
5933
6094
  }
5934
6095
  else {
5935
- const matchValue_1 = transformExports(rootTransformContext, isTopLevel, exports_1);
5936
- let matchResult_6, exportsType;
5937
- if (matchValue_1.tag === 5) {
5938
- if (isEmpty(matchValue_1.fields[0].Members)) {
5939
- matchResult_6 = 0;
6096
+ const matchValue_2 = transformExports(rootTransformContext, isTopLevel, exports_1);
6097
+ let matchResult_10, exportsType;
6098
+ if (matchValue_2.tag === 5) {
6099
+ if (isEmpty(matchValue_2.fields[0].Members)) {
6100
+ matchResult_10 = 0;
5940
6101
  }
5941
6102
  else {
5942
- matchResult_6 = 1;
5943
- exportsType = matchValue_1;
6103
+ matchResult_10 = 1;
6104
+ exportsType = matchValue_2;
5944
6105
  }
5945
6106
  }
5946
6107
  else {
5947
- matchResult_6 = 1;
5948
- exportsType = matchValue_1;
6108
+ matchResult_10 = 1;
6109
+ exportsType = matchValue_2;
5949
6110
  }
5950
- switch (matchResult_6) {
6111
+ switch (matchResult_10) {
5951
6112
  case 0: {
5952
6113
  exportsType_1 = undefined;
5953
6114
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glutinum/cli",
3
- "version": "1.0.0-beta.4",
3
+ "version": "1.0.0-beta.5",
4
4
  "description": "TypeScript definition to F# bindings converter",
5
5
  "type": "module",
6
6
  "main": "index.js",