@nfdi4plants/arctrl 3.0.0-beta.4 → 3.0.0-beta.6
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/ts/node_modules/@fable-org/fable-library-js/Array.js +894 -4
- package/dist/ts/node_modules/@fable-org/fable-library-js/Async.js +121 -3
- package/dist/ts/node_modules/@fable-org/fable-library-js/BigInt.js +279 -1
- package/dist/ts/node_modules/@fable-org/fable-library-js/Char.js +101 -2
- package/dist/ts/node_modules/@fable-org/fable-library-js/Choice.js +187 -0
- package/dist/ts/node_modules/@fable-org/fable-library-js/CollectionUtil.js +156 -2
- package/dist/ts/node_modules/@fable-org/fable-library-js/Date.js +183 -7
- package/dist/ts/node_modules/@fable-org/fable-library-js/DateOffset.js +217 -5
- package/dist/ts/node_modules/@fable-org/fable-library-js/Decimal.js +154 -5
- package/dist/ts/node_modules/@fable-org/fable-library-js/Double.js +20 -1
- package/dist/ts/node_modules/@fable-org/fable-library-js/FSharp.Collections.js +30 -0
- package/dist/ts/node_modules/@fable-org/fable-library-js/FSharp.Core.js +68 -1
- package/dist/ts/node_modules/@fable-org/fable-library-js/Global.js +6 -1
- package/dist/ts/node_modules/@fable-org/fable-library-js/Guid.js +98 -1
- package/dist/ts/node_modules/@fable-org/fable-library-js/Int32.js +18 -1
- package/dist/ts/node_modules/@fable-org/fable-library-js/List.js +601 -5
- package/dist/ts/node_modules/@fable-org/fable-library-js/Long.js +10 -1
- package/dist/ts/node_modules/@fable-org/fable-library-js/Map.js +760 -16
- package/dist/ts/node_modules/@fable-org/fable-library-js/MapUtil.js +26 -1
- package/dist/ts/node_modules/@fable-org/fable-library-js/MutableMap.js +18 -8
- package/dist/ts/node_modules/@fable-org/fable-library-js/MutableSet.js +36 -4
- package/dist/ts/node_modules/@fable-org/fable-library-js/Option.js +35 -1
- package/dist/ts/node_modules/@fable-org/fable-library-js/Range.js +26 -1
- package/dist/ts/node_modules/@fable-org/fable-library-js/Reflection.js +355 -1
- package/dist/ts/node_modules/@fable-org/fable-library-js/RegExp.js +21 -2
- package/dist/ts/node_modules/@fable-org/fable-library-js/Result.js +133 -1
- package/dist/ts/node_modules/@fable-org/fable-library-js/Seq.js +543 -8
- package/dist/ts/node_modules/@fable-org/fable-library-js/Seq2.js +53 -4
- package/dist/ts/node_modules/@fable-org/fable-library-js/Set.js +673 -41
- package/dist/ts/node_modules/@fable-org/fable-library-js/String.js +197 -4
- package/dist/ts/node_modules/@fable-org/fable-library-js/System.Text.js +128 -3
- package/dist/ts/node_modules/@fable-org/fable-library-js/SystemException.js +8 -0
- package/dist/ts/node_modules/@fable-org/fable-library-js/TimeSpan.js +180 -0
- package/dist/ts/node_modules/@fable-org/fable-library-js/Types.js +20 -2
- package/dist/ts/node_modules/@fable-org/fable-library-js/Util.js +406 -2
- package/dist/ts/node_modules/@fable-org/fable-library-js/lib/big.js +2 -2
- package/dist/ts/ts/ARC.d.ts +12 -5
- package/dist/ts/ts/ARC.d.ts.map +1 -1
- package/dist/ts/ts/ARC.js +172 -93
- package/dist/ts/ts/Contract/ARC.d.ts.map +1 -1
- package/dist/ts/ts/Contract/ARC.js +8 -1
- package/dist/ts/ts/Contract/ArcAssay.js +14 -5
- package/dist/ts/ts/Contract/ArcInvestigation.js +10 -1
- package/dist/ts/ts/Contract/ArcRun.js +19 -6
- package/dist/ts/ts/Contract/ArcStudy.js +19 -6
- package/dist/ts/ts/Contract/ArcWorkflow.js +19 -6
- package/dist/ts/ts/Contract/Contract.js +42 -1
- package/dist/ts/ts/Contract/Datamap.js +61 -17
- package/dist/ts/ts/Contract/Git.d.ts.map +1 -1
- package/dist/ts/ts/Contract/Git.js +22 -6
- package/dist/ts/ts/Contract/License.d.ts +5 -0
- package/dist/ts/ts/Contract/License.d.ts.map +1 -0
- package/dist/ts/ts/Contract/License.js +34 -0
- package/dist/ts/ts/Contract/ValidationPackagesConfig.js +31 -6
- package/dist/ts/ts/ContractIO/ContractIO.js +5 -5
- package/dist/ts/ts/ContractIO/FileSystemHelper.js +16 -4
- package/dist/ts/ts/Conversion.js +321 -48
- package/dist/ts/ts/Core/ArcTypes.js +216 -15
- package/dist/ts/ts/Core/Comment.js +11 -1
- package/dist/ts/ts/Core/CommentList.js +77 -2
- package/dist/ts/ts/Core/Conversion.js +123 -43
- package/dist/ts/ts/Core/Data.js +9 -2
- package/dist/ts/ts/Core/DataContext.js +19 -4
- package/dist/ts/ts/Core/DataFile.js +38 -1
- package/dist/ts/ts/Core/DataMap.js +111 -5
- package/dist/ts/ts/Core/Helper/Collections.js +106 -5
- package/dist/ts/ts/Core/Helper/HashCodes.js +4 -4
- package/dist/ts/ts/Core/Helper/Identifier.js +100 -2
- package/dist/ts/ts/Core/Helper/Regex.js +134 -2
- package/dist/ts/ts/Core/Helper/SemVer.js +23 -2
- package/dist/ts/ts/Core/IdentifierSetters.d.ts +3 -1
- package/dist/ts/ts/Core/IdentifierSetters.d.ts.map +1 -1
- package/dist/ts/ts/Core/IdentifierSetters.js +27 -1
- package/dist/ts/ts/Core/OntologyAnnotation.js +4 -1
- package/dist/ts/ts/Core/OntologySourceReference.js +8 -1
- package/dist/ts/ts/Core/Person.js +8 -1
- package/dist/ts/ts/Core/Process/ColumnIndex.js +121 -4
- package/dist/ts/ts/Core/Process/Component.js +37 -4
- package/dist/ts/ts/Core/Process/Factor.js +9 -4
- package/dist/ts/ts/Core/Process/FactorValue.js +61 -4
- package/dist/ts/ts/Core/Process/Material.js +14 -4
- package/dist/ts/ts/Core/Process/MaterialAttribute.js +41 -3
- package/dist/ts/ts/Core/Process/MaterialAttributeValue.js +67 -4
- package/dist/ts/ts/Core/Process/MaterialType.js +15 -1
- package/dist/ts/ts/Core/Process/Process.js +150 -7
- package/dist/ts/ts/Core/Process/ProcessInput.js +48 -8
- package/dist/ts/ts/Core/Process/ProcessOutput.js +44 -7
- package/dist/ts/ts/Core/Process/ProcessParameterValue.js +10 -5
- package/dist/ts/ts/Core/Process/ProcessSequence.js +127 -6
- package/dist/ts/ts/Core/Process/Protocol.js +78 -4
- package/dist/ts/ts/Core/Process/ProtocolParameter.js +6 -2
- package/dist/ts/ts/Core/Process/Sample.js +21 -3
- package/dist/ts/ts/Core/Process/Source.js +13 -3
- package/dist/ts/ts/Core/Publication.js +8 -1
- package/dist/ts/ts/Core/Table/ArcTable.js +34 -25
- package/dist/ts/ts/Core/Table/ArcTableAux.js +150 -23
- package/dist/ts/ts/Core/Table/ArcTables.js +24 -15
- package/dist/ts/ts/Core/Table/CompositeCell.js +7 -3
- package/dist/ts/ts/Core/Table/CompositeColumn.js +8 -4
- package/dist/ts/ts/Core/Table/CompositeHeader.js +18 -15
- package/dist/ts/ts/Core/Template.js +12 -2
- package/dist/ts/ts/Core/Templates.js +8 -4
- package/dist/ts/ts/Core/Value.js +7 -3
- package/dist/ts/ts/CrossAsync.js +11 -1
- package/dist/ts/ts/FileSystem/Commit.js +18 -0
- package/dist/ts/ts/FileSystem/FileSystem.js +8 -3
- package/dist/ts/ts/FileSystem/FileSystemTree.d.ts +1 -0
- package/dist/ts/ts/FileSystem/FileSystemTree.d.ts.map +1 -1
- package/dist/ts/ts/FileSystem/FileSystemTree.js +20 -13
- package/dist/ts/ts/FileSystem/Path.d.ts +2 -0
- package/dist/ts/ts/FileSystem/Path.d.ts.map +1 -1
- package/dist/ts/ts/FileSystem/Path.js +17 -3
- package/dist/ts/ts/Json/Assay.d.ts +1 -1
- package/dist/ts/ts/Json/Assay.js +28 -28
- package/dist/ts/ts/Json/Comment.js +10 -10
- package/dist/ts/ts/Json/Data.js +6 -6
- package/dist/ts/ts/Json/DataMap/DataContext.js +4 -4
- package/dist/ts/ts/Json/DataMap/DataMap.js +2 -2
- package/dist/ts/ts/Json/Decode.js +14 -9
- package/dist/ts/ts/Json/Encode.js +43 -11
- package/dist/ts/ts/Json/Investigation.js +40 -22
- package/dist/ts/ts/Json/OntologyAnnotation.js +5 -5
- package/dist/ts/ts/Json/OntologySourceReference.js +2 -2
- package/dist/ts/ts/Json/Person.js +26 -26
- package/dist/ts/ts/Json/Process/Component.d.ts +6 -4
- package/dist/ts/ts/Json/Process/Component.d.ts.map +1 -1
- package/dist/ts/ts/Json/Process/Component.js +27 -7
- package/dist/ts/ts/Json/Process/Factor.js +3 -3
- package/dist/ts/ts/Json/Process/FactorValue.js +8 -8
- package/dist/ts/ts/Json/Process/Material.js +9 -9
- package/dist/ts/ts/Json/Process/MaterialAttribute.js +1 -1
- package/dist/ts/ts/Json/Process/MaterialAttributeValue.js +8 -8
- package/dist/ts/ts/Json/Process/Process.js +12 -12
- package/dist/ts/ts/Json/Process/ProcessInput.js +4 -4
- package/dist/ts/ts/Json/Process/ProcessOutput.js +3 -3
- package/dist/ts/ts/Json/Process/ProcessParameterValue.js +11 -8
- package/dist/ts/ts/Json/Process/Protocol.js +13 -13
- package/dist/ts/ts/Json/Process/ProtocolParameter.d.ts +4 -2
- package/dist/ts/ts/Json/Process/ProtocolParameter.d.ts.map +1 -1
- package/dist/ts/ts/Json/Process/ProtocolParameter.js +21 -12
- package/dist/ts/ts/Json/Process/Sample.js +14 -14
- package/dist/ts/ts/Json/Process/Source.js +9 -9
- package/dist/ts/ts/Json/Process/Value.js +1 -1
- package/dist/ts/ts/Json/PropertyValue.js +1 -1
- package/dist/ts/ts/Json/Publication.js +6 -6
- package/dist/ts/ts/Json/ROCrate/LDContext.js +1 -0
- package/dist/ts/ts/Json/ROCrate/LDGraph.js +3 -3
- package/dist/ts/ts/Json/ROCrate/LDNode.js +19 -19
- package/dist/ts/ts/Json/Run.d.ts +11 -0
- package/dist/ts/ts/Json/Run.d.ts.map +1 -0
- package/dist/ts/ts/Json/Run.js +76 -0
- package/dist/ts/ts/Json/StringTable.js +1 -1
- package/dist/ts/ts/Json/Study.js +34 -34
- package/dist/ts/ts/Json/Table/ArcTable.js +29 -29
- package/dist/ts/ts/Json/Table/CellTable.js +6 -6
- package/dist/ts/ts/Json/Table/CompositeCell.js +4 -4
- package/dist/ts/ts/Json/Table/CompositeHeader.js +2 -2
- package/dist/ts/ts/Json/Table/IOType.js +1 -1
- package/dist/ts/ts/Json/Table/OATable.js +7 -7
- package/dist/ts/ts/Json/Table/Templates.js +92 -6
- package/dist/ts/ts/Json/Workflow.d.ts +11 -0
- package/dist/ts/ts/Json/Workflow.d.ts.map +1 -0
- package/dist/ts/ts/Json/Workflow.js +93 -0
- package/dist/ts/ts/Json/context/rocrate/isa_assay_context.js +27 -1
- package/dist/ts/ts/Json/context/rocrate/isa_comment_context.js +17 -1
- package/dist/ts/ts/Json/context/rocrate/isa_data_context.js +19 -1
- package/dist/ts/ts/Json/context/rocrate/isa_investigation_context.js +27 -1
- package/dist/ts/ts/Json/context/rocrate/isa_material_context.js +20 -1
- package/dist/ts/ts/Json/context/rocrate/isa_ontology_annotation_context.js +18 -1
- package/dist/ts/ts/Json/context/rocrate/isa_ontology_source_reference_context.js +20 -1
- package/dist/ts/ts/Json/context/rocrate/isa_organization_context.js +16 -1
- package/dist/ts/ts/Json/context/rocrate/isa_person_context.js +25 -1
- package/dist/ts/ts/Json/context/rocrate/isa_process_context.js +24 -1
- package/dist/ts/ts/Json/context/rocrate/isa_protocol_context.js +23 -1
- package/dist/ts/ts/Json/context/rocrate/isa_publication_context.js +20 -1
- package/dist/ts/ts/Json/context/rocrate/isa_sample_context.js +19 -1
- package/dist/ts/ts/Json/context/rocrate/isa_source_context.js +19 -1
- package/dist/ts/ts/Json/context/rocrate/isa_study_context.js +35 -1
- package/dist/ts/ts/Json/context/rocrate/rocrate_context.js +61 -0
- package/dist/ts/ts/Json.d.ts +34 -2
- package/dist/ts/ts/Json.d.ts.map +1 -1
- package/dist/ts/ts/Json.js +129 -2
- package/dist/ts/ts/JsonIO/Assay.js +15 -3
- package/dist/ts/ts/JsonIO/Investigation.js +15 -3
- package/dist/ts/ts/JsonIO/LDObject.js +17 -3
- package/dist/ts/ts/JsonIO/OntologyAnnotation.js +12 -2
- package/dist/ts/ts/JsonIO/Person.d.ts +16 -0
- package/dist/ts/ts/JsonIO/Person.d.ts.map +1 -0
- package/dist/ts/ts/JsonIO/Person.js +67 -0
- package/dist/ts/ts/JsonIO/Run.d.ts +10 -0
- package/dist/ts/ts/JsonIO/Run.d.ts.map +1 -0
- package/dist/ts/ts/JsonIO/Run.js +50 -0
- package/dist/ts/ts/JsonIO/Study.js +15 -3
- package/dist/ts/ts/JsonIO/Table/Compression.js +3 -3
- package/dist/ts/ts/JsonIO/Table/Templates.js +60 -5
- package/dist/ts/ts/JsonIO/Workflow.d.ts +10 -0
- package/dist/ts/ts/JsonIO/Workflow.d.ts.map +1 -0
- package/dist/ts/ts/JsonIO/Workflow.js +50 -0
- package/dist/ts/ts/License.d.ts +39 -0
- package/dist/ts/ts/License.d.ts.map +1 -0
- package/dist/ts/ts/License.js +123 -0
- package/dist/ts/ts/ROCrate/Generic/Comment.js +5 -1
- package/dist/ts/ts/ROCrate/Generic/CreativeWork.d.ts +69 -0
- package/dist/ts/ts/ROCrate/Generic/CreativeWork.d.ts.map +1 -0
- package/dist/ts/ts/ROCrate/Generic/CreativeWork.js +450 -0
- package/dist/ts/ts/ROCrate/Generic/Dataset.d.ts +1 -0
- package/dist/ts/ts/ROCrate/Generic/Dataset.d.ts.map +1 -1
- package/dist/ts/ts/ROCrate/Generic/Dataset.js +27 -1
- package/dist/ts/ts/ROCrate/Generic/DefinedTerm.js +5 -1
- package/dist/ts/ts/ROCrate/Generic/File.js +5 -1
- package/dist/ts/ts/ROCrate/Generic/LabProcess.js +5 -1
- package/dist/ts/ts/ROCrate/Generic/LabProtocol.js +5 -1
- package/dist/ts/ts/ROCrate/Generic/Organization.js +5 -1
- package/dist/ts/ts/ROCrate/Generic/Person.js +7 -2
- package/dist/ts/ts/ROCrate/Generic/PostalAddress.js +5 -1
- package/dist/ts/ts/ROCrate/Generic/PropertyValue.js +19 -15
- package/dist/ts/ts/ROCrate/Generic/Sample.js +5 -1
- package/dist/ts/ts/ROCrate/Generic/ScholarlyArticle.js +5 -1
- package/dist/ts/ts/ROCrate/LDContext.js +15 -6
- package/dist/ts/ts/ROCrate/LDObject.js +53 -17
- package/dist/ts/ts/ROCrateIO.d.ts +9 -3
- package/dist/ts/ts/ROCrateIO.d.ts.map +1 -1
- package/dist/ts/ts/ROCrateIO.js +67 -14
- package/dist/ts/ts/Spreadsheet/AnnotationTable/ArcTable.js +18 -15
- package/dist/ts/ts/Spreadsheet/AnnotationTable/CompositeCell.js +5 -4
- package/dist/ts/ts/Spreadsheet/AnnotationTable/CompositeColumn.js +40 -17
- package/dist/ts/ts/Spreadsheet/AnnotationTable/CompositeHeader.js +4 -4
- package/dist/ts/ts/Spreadsheet/ArcAssay.js +30 -15
- package/dist/ts/ts/Spreadsheet/ArcInvestigation.js +32 -18
- package/dist/ts/ts/Spreadsheet/ArcRun.js +23 -8
- package/dist/ts/ts/Spreadsheet/ArcStudy.js +22 -7
- package/dist/ts/ts/Spreadsheet/ArcWorkflow.js +23 -8
- package/dist/ts/ts/Spreadsheet/CollectionAux.js +75 -5
- package/dist/ts/ts/Spreadsheet/DataMap.js +1 -1
- package/dist/ts/ts/Spreadsheet/DataMapTable/DataMapColumn.js +4 -4
- package/dist/ts/ts/Spreadsheet/DataMapTable/DataMapHeader.js +8 -8
- package/dist/ts/ts/Spreadsheet/DataMapTable/DataMapTable.js +4 -4
- package/dist/ts/ts/Spreadsheet/Metadata/Assays.js +6 -6
- package/dist/ts/ts/Spreadsheet/Metadata/Comment.js +1 -1
- package/dist/ts/ts/Spreadsheet/Metadata/Contacts.js +2 -2
- package/dist/ts/ts/Spreadsheet/Metadata/Conversions.js +6 -3
- package/dist/ts/ts/Spreadsheet/Metadata/DesignDescriptors.js +9 -3
- package/dist/ts/ts/Spreadsheet/Metadata/Factors.js +6 -4
- package/dist/ts/ts/Spreadsheet/Metadata/OntologyAnnotation.js +7 -5
- package/dist/ts/ts/Spreadsheet/Metadata/OntologySourceReference.js +1 -1
- package/dist/ts/ts/Spreadsheet/Metadata/Protocols.js +10 -8
- package/dist/ts/ts/Spreadsheet/Metadata/Publication.js +5 -5
- package/dist/ts/ts/Spreadsheet/Metadata/Run.js +6 -6
- package/dist/ts/ts/Spreadsheet/Metadata/SparseTable.js +246 -10
- package/dist/ts/ts/Spreadsheet/Metadata/Study.js +19 -13
- package/dist/ts/ts/Spreadsheet/Metadata/Workflow.js +5 -5
- package/dist/ts/ts/Template.Web.js +5 -1
- package/dist/ts/ts/ValidationPackages/ValidationPackage.js +8 -1
- package/dist/ts/ts/ValidationPackages/ValidationPackagesConfig.js +10 -3
- package/dist/ts/ts/WebRequest/WebRequest.Node.js +1 -0
- package/dist/ts/ts/Xlsx.d.ts +21 -1
- package/dist/ts/ts/Xlsx.d.ts.map +1 -1
- package/dist/ts/ts/Xlsx.js +81 -1
- package/dist/ts/ts/Yaml/ValidationPackage.js +18 -2
- package/dist/ts/ts/Yaml/ValidationPackagesConfig.js +5 -2
- package/dist/ts/ts/fable_modules/DynamicObj.7.0.1/DynamicObj.fs.js +27 -4
- package/dist/ts/ts/fable_modules/DynamicObj.7.0.1/FableJS.fs.js +14 -3
- package/dist/ts/ts/fable_modules/DynamicObj.7.0.1/HashCodes.fs.js +30 -4
- package/dist/ts/ts/fable_modules/DynamicObj.7.0.1/PropertyHelper.fs.js +5 -1
- package/dist/ts/ts/fable_modules/DynamicObj.7.0.1/ReflectionUtils.fs.js +65 -2
- package/dist/ts/ts/fable_modules/Fable.Fetch.2.6.0/Fetch.fs.js +257 -1
- package/dist/ts/ts/fable_modules/Fable.Promise.3.2.0/Promise.fs.js +71 -1
- package/dist/ts/ts/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js +11 -1
- package/dist/ts/ts/fable_modules/Fable.SimpleHttp.3.5.0/Http.fs.js +188 -11
- package/dist/ts/ts/fable_modules/Fable.SimpleHttp.3.5.0/Types.fs.js +80 -2
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/Cells/FsCell.fs.js +63 -4
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/Cells/FsCellsCollection.fs.js +17 -7
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/DSL/CellBuilder.fs.js +198 -0
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/DSL/Expression.fs.js +46 -0
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/DSL/RowBuilder.fs.js +131 -0
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/DSL/Types.fs.js +307 -0
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/FsAddress.fs.js +38 -2
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/FsColumn.fs.js +11 -4
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/FsRow.fs.js +12 -5
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/FsWorkbook.fs.js +9 -2
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/FsWorksheet.fs.js +14 -7
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/HashCodes.fs.js +31 -1
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/Json/Cell.fs.js +65 -0
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/Json/Column.fs.js +38 -0
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/Json/Row.fs.js +38 -0
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/Json/Table.fs.js +34 -0
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/Json/Value.fs.js +49 -3
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/Json/Workbook.fs.js +44 -0
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/Json/Worksheet.fs.js +129 -0
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/Ranges/FsRange.fs.js +9 -2
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/Ranges/FsRangeAddress.fs.js +82 -3
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/Ranges/FsRangeBase.fs.js +12 -3
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/Ranges/FsRangeColumn.fs.js +17 -2
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/Ranges/FsRangeRow.fs.js +9 -2
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/Tables/FsTable.fs.js +12 -5
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/Tables/FsTableField.fs.js +12 -3
- package/dist/ts/ts/fable_modules/FsSpreadsheet.Js.7.0.0-alpha.1/Cell.fs.js +2 -2
- package/dist/ts/ts/fable_modules/FsSpreadsheet.Js.7.0.0-alpha.1/FsExtensions.fs.js +42 -3
- package/dist/ts/ts/fable_modules/FsSpreadsheet.Js.7.0.0-alpha.1/Json.fs.js +53 -0
- package/dist/ts/ts/fable_modules/FsSpreadsheet.Js.7.0.0-alpha.1/Table.fs.js +9 -9
- package/dist/ts/ts/fable_modules/FsSpreadsheet.Js.7.0.0-alpha.1/Workbook.fs.js +1 -1
- package/dist/ts/ts/fable_modules/FsSpreadsheet.Js.7.0.0-alpha.1/Worksheet.fs.js +2 -2
- package/dist/ts/ts/fable_modules/FsSpreadsheet.Js.7.0.0-alpha.1/Xlsx.fs.js +5 -1
- package/dist/ts/ts/fable_modules/Thoth.Json.Core.0.7.0/Decode.fs.js +730 -23
- package/dist/ts/ts/fable_modules/Thoth.Json.Core.0.7.0/Encode.fs.js +192 -7
- package/dist/ts/ts/fable_modules/Thoth.Json.Core.0.7.0/Types.fs.js +45 -1
- package/dist/ts/ts/fable_modules/Thoth.Json.JavaScript.0.4.1/Decode.fs.js +15 -2
- package/dist/ts/ts/fable_modules/YAMLicious.0.0.3/Decode.fs.js +1383 -15
- package/dist/ts/ts/fable_modules/YAMLicious.0.0.3/Encode.fs.js +45 -4
- package/dist/ts/ts/fable_modules/YAMLicious.0.0.3/Interop/JsInterop.fs.js +10 -0
- package/dist/ts/ts/fable_modules/YAMLicious.0.0.3/Persil.fs.js +5 -5
- package/dist/ts/ts/fable_modules/YAMLicious.0.0.3/Preprocessing.fs.js +16 -6
- package/dist/ts/ts/fable_modules/YAMLicious.0.0.3/Reader.fs.js +26 -23
- package/dist/ts/ts/fable_modules/YAMLicious.0.0.3/RegexActivePatterns.fs.js +1 -1
- package/dist/ts/ts/fable_modules/YAMLicious.0.0.3/Writer.fs.js +8 -8
- package/dist/ts/ts/fable_modules/YAMLicious.0.0.3/YAMLiciousTypes.fs.js +18 -2
- package/package.json +1 -1
- package/dist/ts/ts/FileSystem/DefaultGitattributes.d.ts +0 -2
- package/dist/ts/ts/FileSystem/DefaultGitattributes.d.ts.map +0 -1
- package/dist/ts/ts/FileSystem/DefaultGitattributes.js +0 -3
- package/dist/ts/ts/FileSystem/DefaultGitignore.d.ts +0 -2
- package/dist/ts/ts/FileSystem/DefaultGitignore.d.ts.map +0 -1
- package/dist/ts/ts/FileSystem/DefaultGitignore.js +0 -3
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { equals } from './Util.js';
|
|
1
2
|
import { Union } from './Types.js';
|
|
2
3
|
|
|
3
4
|
const CaseRules = {
|
|
@@ -73,6 +74,15 @@ function keyValueList(fields, caseRule = CaseRules.None) {
|
|
|
73
74
|
}
|
|
74
75
|
return obj;
|
|
75
76
|
}
|
|
77
|
+
// TODO: Move these methods to Map and Set modules
|
|
78
|
+
function containsValue(v, map) {
|
|
79
|
+
for (const kv of map) {
|
|
80
|
+
if (equals(v, kv[1])) {
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
76
86
|
function tryGetValue(map, key, defaultValue) {
|
|
77
87
|
if (map.has(key)) {
|
|
78
88
|
defaultValue.contents = map.get(key);
|
|
@@ -87,6 +97,13 @@ function addToSet(v, set) {
|
|
|
87
97
|
set.add(v);
|
|
88
98
|
return true;
|
|
89
99
|
}
|
|
100
|
+
function tryAddToDict(dict, k, v) {
|
|
101
|
+
if (dict.has(k)) {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
dict.set(k, v);
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
90
107
|
function addToDict(dict, k, v) {
|
|
91
108
|
if (dict.has(k)) {
|
|
92
109
|
throw new Error("An item with the same key has already been added. Key: " + k);
|
|
@@ -101,5 +118,13 @@ function getItemFromDict(map, key) {
|
|
|
101
118
|
throw new Error(`The given key '${key}' was not present in the dictionary.`);
|
|
102
119
|
}
|
|
103
120
|
}
|
|
121
|
+
function getItemFromDictOrCreate(map, key, createValue) {
|
|
122
|
+
if (map.has(key)) {
|
|
123
|
+
return map.get(key);
|
|
124
|
+
}
|
|
125
|
+
const value = createValue(key);
|
|
126
|
+
map.set(key, value);
|
|
127
|
+
return value;
|
|
128
|
+
}
|
|
104
129
|
|
|
105
|
-
export { addToDict, addToSet, getItemFromDict, keyValueList, tryGetValue };
|
|
130
|
+
export { addToDict, addToSet, containsValue, getItemFromDict, getItemFromDictOrCreate, keyValueList, tryAddToDict, tryGetValue };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { getEnumerator, disposeSafe, toIterator, equals
|
|
2
|
-
import { concat, iterateIndexed, toArray, map, iterate
|
|
1
|
+
import { defaultOf, getEnumerator, disposeSafe, toIterator, equals } from './Util.js';
|
|
2
|
+
import { concat, iterateIndexed, toArray, delay, map, iterate } from './Seq.js';
|
|
3
3
|
import { value } from './Option.js';
|
|
4
4
|
import { setItem } from './Array.js';
|
|
5
5
|
import { FSharpRef } from './Types.js';
|
|
6
|
-
import {
|
|
6
|
+
import { class_type } from './Reflection.js';
|
|
7
|
+
import { tryGetValue, getItemFromDict } from './MapUtil.js';
|
|
7
8
|
import { format } from './String.js';
|
|
8
9
|
|
|
9
10
|
class Dictionary {
|
|
@@ -53,11 +54,11 @@ class Dictionary {
|
|
|
53
54
|
"System.Collections.Generic.ICollection`1.Contains2B595"(item) {
|
|
54
55
|
const this$ = this;
|
|
55
56
|
const matchValue = Dictionary__TryFind_2B595(this$, item[0]);
|
|
56
|
-
let matchResult;
|
|
57
|
+
let matchResult, p_1;
|
|
57
58
|
if (matchValue != null) {
|
|
58
59
|
if (equals(value(matchValue)[1], item[1])) {
|
|
59
60
|
matchResult = 0;
|
|
60
|
-
value(matchValue);
|
|
61
|
+
p_1 = value(matchValue);
|
|
61
62
|
}
|
|
62
63
|
else {
|
|
63
64
|
matchResult = 1;
|
|
@@ -183,6 +184,12 @@ class Dictionary {
|
|
|
183
184
|
}, this$);
|
|
184
185
|
}
|
|
185
186
|
}
|
|
187
|
+
function Dictionary_$reflection(gen0, gen1) {
|
|
188
|
+
return class_type("Fable.Collections.Dictionary", [gen0, gen1], Dictionary);
|
|
189
|
+
}
|
|
190
|
+
function Dictionary_$ctor_6623D9B3(pairs, comparer) {
|
|
191
|
+
return new Dictionary(pairs, comparer);
|
|
192
|
+
}
|
|
186
193
|
function Dictionary__TryFindIndex_2B595(this$, k) {
|
|
187
194
|
const h = this$.comparer.GetHashCode(k) | 0;
|
|
188
195
|
let matchValue;
|
|
@@ -218,6 +225,9 @@ function Dictionary__TryFind_2B595(this$, k) {
|
|
|
218
225
|
return undefined;
|
|
219
226
|
}
|
|
220
227
|
}
|
|
228
|
+
function Dictionary__get_Comparer(this$) {
|
|
229
|
+
return this$.comparer;
|
|
230
|
+
}
|
|
221
231
|
function Dictionary__Clear(this$) {
|
|
222
232
|
this$.hashMap.clear();
|
|
223
233
|
}
|
|
@@ -251,7 +261,7 @@ function Dictionary__set_Item_5BDDA1(this$, k, v) {
|
|
|
251
261
|
getItemFromDict(this$.hashMap, matchValue[1])[matchValue[2]] = [k, v];
|
|
252
262
|
}
|
|
253
263
|
else {
|
|
254
|
-
void (getItemFromDict(this$.hashMap, matchValue[1]).push([k, v]));
|
|
264
|
+
const value = void (getItemFromDict(this$.hashMap, matchValue[1]).push([k, v]));
|
|
255
265
|
}
|
|
256
266
|
}
|
|
257
267
|
else {
|
|
@@ -265,7 +275,7 @@ function Dictionary__Add_5BDDA1(this$, k, v) {
|
|
|
265
275
|
throw new Error(format("An item with the same key has already been added. Key: {0}", k));
|
|
266
276
|
}
|
|
267
277
|
else {
|
|
268
|
-
void (getItemFromDict(this$.hashMap, matchValue[1]).push([k, v]));
|
|
278
|
+
const value = void (getItemFromDict(this$.hashMap, matchValue[1]).push([k, v]));
|
|
269
279
|
}
|
|
270
280
|
}
|
|
271
281
|
else {
|
|
@@ -317,4 +327,4 @@ function Dictionary__Remove_2B595(this$, k) {
|
|
|
317
327
|
}
|
|
318
328
|
}
|
|
319
329
|
|
|
320
|
-
export { Dictionary, Dictionary__Add_5BDDA1, Dictionary__Clear, Dictionary__ContainsKey_2B595, Dictionary__Remove_2B595, Dictionary__TryFind_2B595, Dictionary__get_Count, Dictionary__get_Item_2B595, Dictionary__set_Item_5BDDA1 };
|
|
330
|
+
export { Dictionary, Dictionary_$ctor_6623D9B3, Dictionary_$reflection, Dictionary__Add_5BDDA1, Dictionary__Clear, Dictionary__ContainsKey_2B595, Dictionary__Remove_2B595, Dictionary__TryFind_2B595, Dictionary__get_Comparer, Dictionary__get_Count, Dictionary__get_Item_2B595, Dictionary__set_Item_5BDDA1 };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { getEnumerator, disposeSafe, toIterator
|
|
1
|
+
import { defaultOf, getEnumerator, disposeSafe, toIterator } from './Util.js';
|
|
2
2
|
import { concat, iterateIndexed, map, iterate } from './Seq.js';
|
|
3
3
|
import { setItem } from './Array.js';
|
|
4
|
+
import { some } from './Option.js';
|
|
4
5
|
import { FSharpRef } from './Types.js';
|
|
5
|
-
import {
|
|
6
|
+
import { class_type } from './Reflection.js';
|
|
7
|
+
import { tryGetValue, getItemFromDict } from './MapUtil.js';
|
|
6
8
|
|
|
7
9
|
class HashSet {
|
|
8
10
|
constructor(items, comparer) {
|
|
@@ -109,6 +111,12 @@ class HashSet {
|
|
|
109
111
|
}, this$);
|
|
110
112
|
}
|
|
111
113
|
}
|
|
114
|
+
function HashSet_$reflection(gen0) {
|
|
115
|
+
return class_type("Fable.Collections.HashSet", [gen0], HashSet);
|
|
116
|
+
}
|
|
117
|
+
function HashSet_$ctor_Z6150332D(items, comparer) {
|
|
118
|
+
return new HashSet(items, comparer);
|
|
119
|
+
}
|
|
112
120
|
function HashSet__TryFindIndex_2B595(this$, k) {
|
|
113
121
|
const h = this$.comparer.GetHashCode(k) | 0;
|
|
114
122
|
let matchValue;
|
|
@@ -123,6 +131,30 @@ function HashSet__TryFindIndex_2B595(this$, k) {
|
|
|
123
131
|
return [false, h, -1];
|
|
124
132
|
}
|
|
125
133
|
}
|
|
134
|
+
function HashSet__TryFind_2B595(this$, k) {
|
|
135
|
+
const matchValue = HashSet__TryFindIndex_2B595(this$, k);
|
|
136
|
+
let matchResult;
|
|
137
|
+
if (matchValue[0]) {
|
|
138
|
+
if (matchValue[2] > -1) {
|
|
139
|
+
matchResult = 0;
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
matchResult = 1;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
matchResult = 1;
|
|
147
|
+
}
|
|
148
|
+
switch (matchResult) {
|
|
149
|
+
case 0:
|
|
150
|
+
return some(getItemFromDict(this$.hashMap, matchValue[1])[matchValue[2]]);
|
|
151
|
+
default:
|
|
152
|
+
return undefined;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
function HashSet__get_Comparer(this$) {
|
|
156
|
+
return this$.comparer;
|
|
157
|
+
}
|
|
126
158
|
function HashSet__Clear(this$) {
|
|
127
159
|
this$.hashMap.clear();
|
|
128
160
|
}
|
|
@@ -147,7 +179,7 @@ function HashSet__Add_2B595(this$, k) {
|
|
|
147
179
|
return false;
|
|
148
180
|
}
|
|
149
181
|
else {
|
|
150
|
-
void (getItemFromDict(this$.hashMap, matchValue[1]).push(k));
|
|
182
|
+
const value = void (getItemFromDict(this$.hashMap, matchValue[1]).push(k));
|
|
151
183
|
return true;
|
|
152
184
|
}
|
|
153
185
|
}
|
|
@@ -201,4 +233,4 @@ function HashSet__Remove_2B595(this$, k) {
|
|
|
201
233
|
}
|
|
202
234
|
}
|
|
203
235
|
|
|
204
|
-
export { HashSet, HashSet__Add_2B595, HashSet__Clear, HashSet__Contains_2B595, HashSet__Remove_2B595, HashSet__get_Count };
|
|
236
|
+
export { HashSet, HashSet_$ctor_Z6150332D, HashSet_$reflection, HashSet__Add_2B595, HashSet__Clear, HashSet__Contains_2B595, HashSet__Remove_2B595, HashSet__get_Comparer, HashSet__get_Count };
|
|
@@ -46,6 +46,17 @@ function unwrap(opt) {
|
|
|
46
46
|
function some(x) {
|
|
47
47
|
return x == null || x instanceof Some ? new Some(x) : x;
|
|
48
48
|
}
|
|
49
|
+
function ofNullable(x) {
|
|
50
|
+
// This will fail with unit probably, an alternative would be:
|
|
51
|
+
// return x === null ? undefined : (x === undefined ? new Some(x) : x);
|
|
52
|
+
return x == null ? undefined : x;
|
|
53
|
+
}
|
|
54
|
+
function toNullable(x) {
|
|
55
|
+
return x == null ? null : value(x);
|
|
56
|
+
}
|
|
57
|
+
function flatten(x) {
|
|
58
|
+
return x == null ? undefined : value(x);
|
|
59
|
+
}
|
|
49
60
|
function toArray(opt) {
|
|
50
61
|
return (opt == null) ? [] : [value(opt)];
|
|
51
62
|
}
|
|
@@ -55,11 +66,34 @@ function defaultArg(opt, defaultValue) {
|
|
|
55
66
|
function defaultArgWith(opt, defThunk) {
|
|
56
67
|
return (opt != null) ? value(opt) : defThunk();
|
|
57
68
|
}
|
|
69
|
+
function orElse(opt, ifNone) {
|
|
70
|
+
return opt == null ? ifNone : opt;
|
|
71
|
+
}
|
|
72
|
+
function orElseWith(opt, ifNoneThunk) {
|
|
73
|
+
return opt == null ? ifNoneThunk() : opt;
|
|
74
|
+
}
|
|
75
|
+
function filter(predicate, opt) {
|
|
76
|
+
return (opt != null) ? (predicate(value(opt)) ? opt : undefined) : opt;
|
|
77
|
+
}
|
|
58
78
|
function map(mapping, opt) {
|
|
59
79
|
return (opt != null) ? some(mapping(value(opt))) : undefined;
|
|
60
80
|
}
|
|
81
|
+
function map2(mapping, opt1, opt2) {
|
|
82
|
+
return (opt1 != null && opt2 != null) ? mapping(value(opt1), value(opt2)) : undefined;
|
|
83
|
+
}
|
|
84
|
+
function map3(mapping, opt1, opt2, opt3) {
|
|
85
|
+
return (opt1 != null && opt2 != null && opt3 != null) ? mapping(value(opt1), value(opt2), value(opt3)) : undefined;
|
|
86
|
+
}
|
|
61
87
|
function bind(binder, opt) {
|
|
62
88
|
return opt != null ? binder(value(opt)) : undefined;
|
|
63
89
|
}
|
|
90
|
+
function tryOp(op, arg) {
|
|
91
|
+
try {
|
|
92
|
+
return some(op(arg));
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
64
98
|
|
|
65
|
-
export { Some, bind, defaultArg, defaultArgWith, map, some, toArray, unwrap, value };
|
|
99
|
+
export { Some, bind, defaultArg, defaultArgWith, filter, flatten, map, map2, map3, ofNullable, orElse, orElseWith, some, toArray, toNullable, tryOp, unwrap, value };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { compare } from './Util.js';
|
|
2
2
|
import { delay, unfold } from './Seq.js';
|
|
3
|
+
import { fromZero, op_Addition, toInt64, toUInt64 } from './BigInt.js';
|
|
4
|
+
import { fromParts, op_Addition as op_Addition$1 } from './Decimal.js';
|
|
3
5
|
|
|
4
6
|
function makeRangeStepFunction(step, stop, zero, add) {
|
|
5
7
|
const stepComparedWithZero = compare(step, zero) | 0;
|
|
@@ -16,8 +18,31 @@ function integralRangeStep(start, step, stop, zero, add) {
|
|
|
16
18
|
const stepFn = makeRangeStepFunction(step, stop, zero, add);
|
|
17
19
|
return delay(() => unfold(stepFn, start));
|
|
18
20
|
}
|
|
21
|
+
function rangeBigInt(start, step, stop) {
|
|
22
|
+
return integralRangeStep(start, step, stop, fromZero(), op_Addition);
|
|
23
|
+
}
|
|
24
|
+
function rangeDecimal(start, step, stop) {
|
|
25
|
+
return integralRangeStep(start, step, stop, fromParts(0, 0, 0, false, 0), op_Addition$1);
|
|
26
|
+
}
|
|
19
27
|
function rangeDouble(start, step, stop) {
|
|
20
28
|
return integralRangeStep(start, step, stop, 0, (x, y) => (x + y));
|
|
21
29
|
}
|
|
30
|
+
function rangeInt64(start, step, stop) {
|
|
31
|
+
return integralRangeStep(start, step, stop, 0n, (x, y) => toInt64(op_Addition(x, y)));
|
|
32
|
+
}
|
|
33
|
+
function rangeUInt64(start, step, stop) {
|
|
34
|
+
return integralRangeStep(start, step, stop, 0n, (x, y) => toUInt64(op_Addition(x, y)));
|
|
35
|
+
}
|
|
36
|
+
function rangeChar(start, stop) {
|
|
37
|
+
const intStop = ~~stop.charCodeAt(0) | 0;
|
|
38
|
+
return delay(() => unfold((c) => {
|
|
39
|
+
if (c <= intStop) {
|
|
40
|
+
return [String.fromCharCode(c), c + 1];
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
}, ~~start.charCodeAt(0)));
|
|
46
|
+
}
|
|
22
47
|
|
|
23
|
-
export { integralRangeStep, makeRangeStepFunction, rangeDouble };
|
|
48
|
+
export { integralRangeStep, makeRangeStepFunction, rangeBigInt, rangeChar, rangeDecimal, rangeDouble, rangeInt64, rangeUInt64 };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { Union, Record } from './Types.js';
|
|
1
2
|
import { stringHash, combineHashCodes, equalArraysWith } from './Util.js';
|
|
3
|
+
import './Decimal.js';
|
|
4
|
+
import { Big } from './lib/big.js';
|
|
2
5
|
|
|
3
6
|
class CaseInfo {
|
|
4
7
|
constructor(declaringType, tag, name, fields) {
|
|
@@ -8,6 +11,13 @@ class CaseInfo {
|
|
|
8
11
|
this.fields = fields;
|
|
9
12
|
}
|
|
10
13
|
}
|
|
14
|
+
class MethodInfo {
|
|
15
|
+
constructor(name, parameters, returnType) {
|
|
16
|
+
this.name = name;
|
|
17
|
+
this.parameters = parameters;
|
|
18
|
+
this.returnType = returnType;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
11
21
|
class TypeInfo {
|
|
12
22
|
constructor(fullname, generics, construct, parent, fields, cases, enumCases) {
|
|
13
23
|
this.fullname = fullname;
|
|
@@ -28,6 +38,11 @@ class TypeInfo {
|
|
|
28
38
|
return equals(this, other);
|
|
29
39
|
}
|
|
30
40
|
}
|
|
41
|
+
class GenericParameter extends TypeInfo {
|
|
42
|
+
constructor(name) {
|
|
43
|
+
super(name);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
31
46
|
function getGenerics(t) {
|
|
32
47
|
return t.generics != null ? t.generics : [];
|
|
33
48
|
}
|
|
@@ -49,6 +64,12 @@ function equals(t1, t2) {
|
|
|
49
64
|
function class_type(fullname, generics, construct, parent) {
|
|
50
65
|
return new TypeInfo(fullname, generics, construct, parent);
|
|
51
66
|
}
|
|
67
|
+
function record_type(fullname, generics, construct, fields) {
|
|
68
|
+
return new TypeInfo(fullname, generics, construct, undefined, fields);
|
|
69
|
+
}
|
|
70
|
+
function anonRecord_type(...fields) {
|
|
71
|
+
return new TypeInfo("", undefined, undefined, undefined, () => fields);
|
|
72
|
+
}
|
|
52
73
|
function union_type(fullname, generics, construct, cases) {
|
|
53
74
|
const t = new TypeInfo(fullname, generics, construct, undefined, undefined, () => {
|
|
54
75
|
const caseNames = construct.prototype.cases();
|
|
@@ -56,7 +77,55 @@ function union_type(fullname, generics, construct, cases) {
|
|
|
56
77
|
});
|
|
57
78
|
return t;
|
|
58
79
|
}
|
|
80
|
+
function tuple_type(...generics) {
|
|
81
|
+
return new TypeInfo("System.Tuple`" + generics.length, generics);
|
|
82
|
+
}
|
|
83
|
+
function delegate_type(...generics) {
|
|
84
|
+
return new TypeInfo("System.Func`" + generics.length, generics);
|
|
85
|
+
}
|
|
86
|
+
function lambda_type(argType, returnType) {
|
|
87
|
+
return new TypeInfo("Microsoft.FSharp.Core.FSharpFunc`2", [argType, returnType]);
|
|
88
|
+
}
|
|
89
|
+
function option_type(generic) {
|
|
90
|
+
return new TypeInfo("Microsoft.FSharp.Core.FSharpOption`1", [generic]);
|
|
91
|
+
}
|
|
92
|
+
function list_type(generic) {
|
|
93
|
+
return new TypeInfo("Microsoft.FSharp.Collections.FSharpList`1", [generic]);
|
|
94
|
+
}
|
|
95
|
+
function array_type(generic) {
|
|
96
|
+
return new TypeInfo("[]", [generic]);
|
|
97
|
+
}
|
|
98
|
+
function enum_type(fullname, underlyingType, enumCases) {
|
|
99
|
+
return new TypeInfo(fullname, [underlyingType], undefined, undefined, undefined, undefined, enumCases);
|
|
100
|
+
}
|
|
101
|
+
function measure_type(fullname) {
|
|
102
|
+
return new TypeInfo(fullname);
|
|
103
|
+
}
|
|
104
|
+
function generic_type(name) {
|
|
105
|
+
return new GenericParameter(name);
|
|
106
|
+
}
|
|
107
|
+
const obj_type = new TypeInfo("System.Object");
|
|
108
|
+
const unit_type = new TypeInfo("Microsoft.FSharp.Core.Unit");
|
|
109
|
+
const char_type = new TypeInfo("System.Char");
|
|
59
110
|
const string_type = new TypeInfo("System.String");
|
|
111
|
+
const bool_type = new TypeInfo("System.Boolean");
|
|
112
|
+
const int8_type = new TypeInfo("System.SByte");
|
|
113
|
+
const uint8_type = new TypeInfo("System.Byte");
|
|
114
|
+
const int16_type = new TypeInfo("System.Int16");
|
|
115
|
+
const uint16_type = new TypeInfo("System.UInt16");
|
|
116
|
+
const int32_type = new TypeInfo("System.Int32");
|
|
117
|
+
const uint32_type = new TypeInfo("System.UInt32");
|
|
118
|
+
const int64_type = new TypeInfo("System.Int64");
|
|
119
|
+
const uint64_type = new TypeInfo("System.UInt64");
|
|
120
|
+
const int128_type = new TypeInfo("System.Int128");
|
|
121
|
+
const uint128_type = new TypeInfo("System.UInt128");
|
|
122
|
+
const nativeint_type = new TypeInfo("System.IntPtr");
|
|
123
|
+
const unativeint_type = new TypeInfo("System.UIntPtr");
|
|
124
|
+
const float16_type = new TypeInfo("System.Half");
|
|
125
|
+
const float32_type = new TypeInfo("System.Single");
|
|
126
|
+
const float64_type = new TypeInfo("System.Double");
|
|
127
|
+
const decimal_type = new TypeInfo("System.Decimal");
|
|
128
|
+
const bigint_type = new TypeInfo("System.Numerics.BigInteger");
|
|
60
129
|
function name(info) {
|
|
61
130
|
if (Array.isArray(info)) {
|
|
62
131
|
return info[0];
|
|
@@ -87,9 +156,153 @@ function fullName(t) {
|
|
|
87
156
|
return t.fullname + "[" + t.generics.map((x) => fullName(x)).join(",") + "]";
|
|
88
157
|
}
|
|
89
158
|
}
|
|
159
|
+
function namespace(t) {
|
|
160
|
+
const elemType = getElementType(t);
|
|
161
|
+
if (elemType != null) {
|
|
162
|
+
return namespace(elemType);
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
const i = t.fullname.lastIndexOf(".");
|
|
166
|
+
return i === -1 ? "" : t.fullname.substr(0, i);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
function isArray(t) {
|
|
170
|
+
return getElementType(t) != null;
|
|
171
|
+
}
|
|
90
172
|
function getElementType(t) {
|
|
91
173
|
return t.fullname === "[]" && t.generics?.length === 1 ? t.generics[0] : undefined;
|
|
92
174
|
}
|
|
175
|
+
function isGenericType(t) {
|
|
176
|
+
return t.generics != null && t.generics.length > 0;
|
|
177
|
+
}
|
|
178
|
+
function isGenericParameter(t) {
|
|
179
|
+
return t instanceof GenericParameter;
|
|
180
|
+
}
|
|
181
|
+
function isEnum(t) {
|
|
182
|
+
return t.enumCases != null && t.enumCases.length > 0;
|
|
183
|
+
}
|
|
184
|
+
function isSubclassOf(t1, t2) {
|
|
185
|
+
return (t2.fullname === obj_type.fullname) || (t1.parent != null && (t1.parent.Equals(t2) || isSubclassOf(t1.parent, t2)));
|
|
186
|
+
}
|
|
187
|
+
function isErasedToNumber(t) {
|
|
188
|
+
return isEnum(t) || [
|
|
189
|
+
int8_type.fullname,
|
|
190
|
+
uint8_type.fullname,
|
|
191
|
+
int16_type.fullname,
|
|
192
|
+
uint16_type.fullname,
|
|
193
|
+
int32_type.fullname,
|
|
194
|
+
uint32_type.fullname,
|
|
195
|
+
float16_type.fullname,
|
|
196
|
+
float32_type.fullname,
|
|
197
|
+
float64_type.fullname,
|
|
198
|
+
].includes(t.fullname);
|
|
199
|
+
}
|
|
200
|
+
function isErasedToBigInt(t) {
|
|
201
|
+
return isEnum(t) || [
|
|
202
|
+
int64_type.fullname,
|
|
203
|
+
uint64_type.fullname,
|
|
204
|
+
int128_type.fullname,
|
|
205
|
+
uint128_type.fullname,
|
|
206
|
+
nativeint_type.fullname,
|
|
207
|
+
unativeint_type.fullname,
|
|
208
|
+
bigint_type.fullname,
|
|
209
|
+
].includes(t.fullname);
|
|
210
|
+
}
|
|
211
|
+
function isInstanceOfType(t, o) {
|
|
212
|
+
if (t.fullname === obj_type.fullname)
|
|
213
|
+
return true;
|
|
214
|
+
switch (typeof o) {
|
|
215
|
+
case "boolean":
|
|
216
|
+
return t.fullname === bool_type.fullname;
|
|
217
|
+
case "string":
|
|
218
|
+
return t.fullname === string_type.fullname;
|
|
219
|
+
case "function":
|
|
220
|
+
return isFunction(t);
|
|
221
|
+
case "number":
|
|
222
|
+
return isErasedToNumber(t);
|
|
223
|
+
case "bigint":
|
|
224
|
+
return isErasedToBigInt(t);
|
|
225
|
+
default:
|
|
226
|
+
return t.construct != null && o instanceof t.construct;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* This doesn't replace types for fields (records) or cases (unions)
|
|
231
|
+
* but it should be enough for type comparison purposes
|
|
232
|
+
*/
|
|
233
|
+
function getGenericTypeDefinition(t) {
|
|
234
|
+
return t.generics == null ? t : new TypeInfo(t.fullname, t.generics.map(() => obj_type));
|
|
235
|
+
}
|
|
236
|
+
function getEnumUnderlyingType(t) {
|
|
237
|
+
return t.generics?.[0];
|
|
238
|
+
}
|
|
239
|
+
function getEnumValues(t) {
|
|
240
|
+
if (isEnum(t) && t.enumCases != null) {
|
|
241
|
+
return t.enumCases.map((kv) => kv[1]);
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
throw new Error(`${t.fullname} is not an enum type`);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
function getEnumNames(t) {
|
|
248
|
+
if (isEnum(t) && t.enumCases != null) {
|
|
249
|
+
return t.enumCases.map((kv) => kv[0]);
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
throw new Error(`${t.fullname} is not an enum type`);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
function getEnumCase(t, v) {
|
|
256
|
+
if (t.enumCases != null) {
|
|
257
|
+
if (typeof v === "string") {
|
|
258
|
+
for (const kv of t.enumCases) {
|
|
259
|
+
if (kv[0] === v) {
|
|
260
|
+
return kv;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
throw new Error(`'${v}' was not found in ${t.fullname}`);
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
for (const kv of t.enumCases) {
|
|
267
|
+
if (kv[1] === v) {
|
|
268
|
+
return kv;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
// .NET returns the number even if it doesn't match any of the cases
|
|
272
|
+
return ["", v];
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
throw new Error(`${t.fullname} is not an enum type`);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
function parseEnum(t, str) {
|
|
280
|
+
// TODO: better int parsing here, parseInt ceils floats: "4.8" -> 4
|
|
281
|
+
const value = parseInt(str, 10);
|
|
282
|
+
return getEnumCase(t, isNaN(value) ? str : value)[1];
|
|
283
|
+
}
|
|
284
|
+
function tryParseEnum(t, str, defValue) {
|
|
285
|
+
try {
|
|
286
|
+
defValue.contents = parseEnum(t, str);
|
|
287
|
+
return true;
|
|
288
|
+
}
|
|
289
|
+
catch {
|
|
290
|
+
return false;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
function getEnumName(t, v) {
|
|
294
|
+
return getEnumCase(t, v)[0];
|
|
295
|
+
}
|
|
296
|
+
function isEnumDefined(t, v) {
|
|
297
|
+
try {
|
|
298
|
+
const kv = getEnumCase(t, v);
|
|
299
|
+
return kv[0] != null && kv[0] !== "";
|
|
300
|
+
}
|
|
301
|
+
catch {
|
|
302
|
+
// supress error
|
|
303
|
+
}
|
|
304
|
+
return false;
|
|
305
|
+
}
|
|
93
306
|
// FSharpType
|
|
94
307
|
function getUnionCases(t) {
|
|
95
308
|
if (t.cases != null) {
|
|
@@ -107,5 +320,146 @@ function getRecordElements(t) {
|
|
|
107
320
|
throw new Error(`${t.fullname} is not an F# record type`);
|
|
108
321
|
}
|
|
109
322
|
}
|
|
323
|
+
function getTupleElements(t) {
|
|
324
|
+
if (isTuple(t) && t.generics != null) {
|
|
325
|
+
return t.generics;
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
throw new Error(`${t.fullname} is not a tuple type`);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
function getFunctionElements(t) {
|
|
332
|
+
if (isFunction(t) && t.generics != null) {
|
|
333
|
+
const gen = t.generics;
|
|
334
|
+
return [gen[0], gen[1]];
|
|
335
|
+
}
|
|
336
|
+
else {
|
|
337
|
+
throw new Error(`${t.fullname} is not an F# function type`);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
function isUnion(t) {
|
|
341
|
+
return t instanceof TypeInfo ? t.cases != null : t instanceof Union;
|
|
342
|
+
}
|
|
343
|
+
function isRecord(t) {
|
|
344
|
+
return t instanceof TypeInfo ? t.fields != null : t instanceof Record;
|
|
345
|
+
}
|
|
346
|
+
function isTuple(t) {
|
|
347
|
+
return t.fullname.startsWith("System.Tuple");
|
|
348
|
+
}
|
|
349
|
+
// In .NET this is false for delegates
|
|
350
|
+
function isFunction(t) {
|
|
351
|
+
return t.fullname === "Microsoft.FSharp.Core.FSharpFunc`2";
|
|
352
|
+
}
|
|
353
|
+
// FSharpValue
|
|
354
|
+
function getUnionFields(v, t) {
|
|
355
|
+
const cases = getUnionCases(t);
|
|
356
|
+
const case_ = cases[v.tag];
|
|
357
|
+
if (case_ == null) {
|
|
358
|
+
throw new Error(`Cannot find case ${v.name} in union type`);
|
|
359
|
+
}
|
|
360
|
+
return [case_, v.fields];
|
|
361
|
+
}
|
|
362
|
+
function getUnionCaseFields(uci) {
|
|
363
|
+
return uci.fields == null ? [] : uci.fields;
|
|
364
|
+
}
|
|
365
|
+
// This is used as replacement of `FSharpValue.GetRecordFields`
|
|
366
|
+
// For `FSharpTypes.GetRecordFields` see `getRecordElements`
|
|
367
|
+
// Object.keys returns keys in the order they were added to the object
|
|
368
|
+
function getRecordFields(v) {
|
|
369
|
+
return Object.keys(v).map((k) => v[k]);
|
|
370
|
+
}
|
|
371
|
+
function getRecordField(v, field) {
|
|
372
|
+
return v[field[0]];
|
|
373
|
+
}
|
|
374
|
+
function getTupleFields(v) {
|
|
375
|
+
return v;
|
|
376
|
+
}
|
|
377
|
+
function getTupleField(v, i) {
|
|
378
|
+
return v[i];
|
|
379
|
+
}
|
|
380
|
+
function makeUnion(uci, values) {
|
|
381
|
+
const expectedLength = (uci.fields || []).length;
|
|
382
|
+
if (values.length !== expectedLength) {
|
|
383
|
+
throw new Error(`Expected an array of length ${expectedLength} but got ${values.length}`);
|
|
384
|
+
}
|
|
385
|
+
const construct = uci.declaringType.construct;
|
|
386
|
+
if (construct == null) {
|
|
387
|
+
return {};
|
|
388
|
+
}
|
|
389
|
+
const isSingleCase = uci.declaringType.cases ? uci.declaringType.cases().length == 1 : false;
|
|
390
|
+
if (isSingleCase) {
|
|
391
|
+
return new construct(...values);
|
|
392
|
+
}
|
|
393
|
+
else {
|
|
394
|
+
return new construct(uci.tag, values);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
function makeRecord(t, values) {
|
|
398
|
+
const fields = getRecordElements(t);
|
|
399
|
+
if (fields.length !== values.length) {
|
|
400
|
+
throw new Error(`Expected an array of length ${fields.length} but got ${values.length}`);
|
|
401
|
+
}
|
|
402
|
+
return t.construct != null
|
|
403
|
+
? new t.construct(...values)
|
|
404
|
+
: fields.reduce((obj, [key, _t], i) => {
|
|
405
|
+
obj[key] = values[i];
|
|
406
|
+
return obj;
|
|
407
|
+
}, {});
|
|
408
|
+
}
|
|
409
|
+
function makeTuple(values, _t) {
|
|
410
|
+
return values;
|
|
411
|
+
}
|
|
412
|
+
function makeGenericType(t, generics) {
|
|
413
|
+
return new TypeInfo(t.fullname, generics, t.construct, t.parent, t.fields, t.cases);
|
|
414
|
+
}
|
|
415
|
+
function createInstance(t, consArgs) {
|
|
416
|
+
// TODO: Check if consArgs length is same as t.construct?
|
|
417
|
+
// (Arg types can still be different)
|
|
418
|
+
if (typeof t.construct === "function") {
|
|
419
|
+
return new t.construct(...(consArgs ?? []));
|
|
420
|
+
}
|
|
421
|
+
else if (isErasedToNumber(t)) {
|
|
422
|
+
return 0;
|
|
423
|
+
}
|
|
424
|
+
else if (isErasedToBigInt(t)) {
|
|
425
|
+
return 0n;
|
|
426
|
+
}
|
|
427
|
+
else {
|
|
428
|
+
switch (t.fullname) {
|
|
429
|
+
case obj_type.fullname:
|
|
430
|
+
return {};
|
|
431
|
+
case bool_type.fullname:
|
|
432
|
+
return false;
|
|
433
|
+
case decimal_type.fullname:
|
|
434
|
+
return new Big(0);
|
|
435
|
+
case char_type.fullname:
|
|
436
|
+
// Even though char is a value type, it's erased to string, and Unchecked.defaultof<char> is null
|
|
437
|
+
return null;
|
|
438
|
+
default:
|
|
439
|
+
throw new Error(`Cannot access constructor of ${t.fullname}`);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
function getValue(propertyInfo, v) {
|
|
444
|
+
return v[propertyInfo[0]];
|
|
445
|
+
}
|
|
446
|
+
// Fable.Core.Reflection
|
|
447
|
+
function assertUnion(x) {
|
|
448
|
+
if (!(x instanceof Union)) {
|
|
449
|
+
throw new Error(`Value is not an F# union type`);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
function getCaseTag(x) {
|
|
453
|
+
assertUnion(x);
|
|
454
|
+
return x.tag;
|
|
455
|
+
}
|
|
456
|
+
function getCaseName(x) {
|
|
457
|
+
assertUnion(x);
|
|
458
|
+
return x.cases()[x.tag];
|
|
459
|
+
}
|
|
460
|
+
function getCaseFields(x) {
|
|
461
|
+
assertUnion(x);
|
|
462
|
+
return x.fields;
|
|
463
|
+
}
|
|
110
464
|
|
|
111
|
-
export { CaseInfo, TypeInfo, class_type, equals, fullName, getElementType, getGenerics, getHashCode, getRecordElements, getUnionCases, name, string_type, union_type };
|
|
465
|
+
export { CaseInfo, GenericParameter, MethodInfo, TypeInfo, anonRecord_type, array_type, bigint_type, bool_type, char_type, class_type, createInstance, decimal_type, delegate_type, enum_type, equals, float16_type, float32_type, float64_type, fullName, generic_type, getCaseFields, getCaseName, getCaseTag, getElementType, getEnumName, getEnumNames, getEnumUnderlyingType, getEnumValues, getFunctionElements, getGenericTypeDefinition, getGenerics, getHashCode, getRecordElements, getRecordField, getRecordFields, getTupleElements, getTupleField, getTupleFields, getUnionCaseFields, getUnionCases, getUnionFields, getValue, int128_type, int16_type, int32_type, int64_type, int8_type, isArray, isEnum, isEnumDefined, isFunction, isGenericParameter, isGenericType, isInstanceOfType, isRecord, isSubclassOf, isTuple, isUnion, lambda_type, list_type, makeGenericType, makeRecord, makeTuple, makeUnion, measure_type, name, namespace, nativeint_type, obj_type, option_type, parseEnum, record_type, string_type, tryParseEnum, tuple_type, uint128_type, uint16_type, uint32_type, uint64_type, uint8_type, unativeint_type, union_type, unit_type };
|