@nfdi4plants/arctrl 3.0.0-beta.5 → 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.js +27 -3
- 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.js +26 -26
- 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.js +9 -6
- 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 +10 -7
- package/dist/ts/ts/Json/Process/Protocol.js +12 -12
- package/dist/ts/ts/Json/Process/ProtocolParameter.js +3 -3
- 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.js +7 -7
- package/dist/ts/ts/Json/StringTable.js +1 -1
- package/dist/ts/ts/Json/Study.js +32 -32
- 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.js +11 -11
- 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 +13 -1
- package/dist/ts/ts/Json.d.ts.map +1 -1
- package/dist/ts/ts/Json.js +89 -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.js +9 -3
- 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.js +9 -3
- 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.js +41 -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,7 +1,12 @@
|
|
|
1
1
|
import { Helpers_allocateArrayFromCons } from './Native.js';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { some, defaultArg, map as map$1, value } from './Option.js';
|
|
3
|
+
import { max as max$1, min as min$1 } from './Double.js';
|
|
4
|
+
import { defaultOf, copyToArray, getEnumerator, disposeSafe, equals } from './Util.js';
|
|
5
|
+
import { SR_indexOutOfBounds } from './Global.js';
|
|
4
6
|
|
|
7
|
+
function indexNotFound() {
|
|
8
|
+
throw new Error("An index satisfying the predicate was not found in the collection.");
|
|
9
|
+
}
|
|
5
10
|
function differentLengths() {
|
|
6
11
|
throw new Error("Arrays had different lengths");
|
|
7
12
|
}
|
|
@@ -17,10 +22,31 @@ function append(array1, array2, cons) {
|
|
|
17
22
|
}
|
|
18
23
|
return newArray;
|
|
19
24
|
}
|
|
25
|
+
function filter(predicate, array) {
|
|
26
|
+
return array.filter(predicate);
|
|
27
|
+
}
|
|
20
28
|
function fill(target, targetIndex, count, value) {
|
|
21
29
|
const start = targetIndex | 0;
|
|
22
30
|
return target.fill(value, start, (start + count));
|
|
23
31
|
}
|
|
32
|
+
function getSubArray(array, start, count) {
|
|
33
|
+
const start_1 = start | 0;
|
|
34
|
+
return array.slice(start_1, (start_1 + count));
|
|
35
|
+
}
|
|
36
|
+
function last(array) {
|
|
37
|
+
if (array.length === 0) {
|
|
38
|
+
throw new Error("The input array was empty\\nParameter name: array");
|
|
39
|
+
}
|
|
40
|
+
return item(array.length - 1, array);
|
|
41
|
+
}
|
|
42
|
+
function tryLast(array) {
|
|
43
|
+
if (array.length === 0) {
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
return some(item(array.length - 1, array));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
24
50
|
function mapIndexed(f, source, cons) {
|
|
25
51
|
const len = source.length | 0;
|
|
26
52
|
const target = Helpers_allocateArrayFromCons(cons, len);
|
|
@@ -37,6 +63,36 @@ function map(f, source, cons) {
|
|
|
37
63
|
}
|
|
38
64
|
return target;
|
|
39
65
|
}
|
|
66
|
+
function mapIndexed2(f, source1, source2, cons) {
|
|
67
|
+
if (source1.length !== source2.length) {
|
|
68
|
+
throw new Error("Arrays had different lengths");
|
|
69
|
+
}
|
|
70
|
+
const result = Helpers_allocateArrayFromCons(cons, source1.length);
|
|
71
|
+
for (let i = 0; i <= (source1.length - 1); i++) {
|
|
72
|
+
setItem(result, i, f(i, item(i, source1), item(i, source2)));
|
|
73
|
+
}
|
|
74
|
+
return result;
|
|
75
|
+
}
|
|
76
|
+
function map2(f, source1, source2, cons) {
|
|
77
|
+
if (source1.length !== source2.length) {
|
|
78
|
+
throw new Error("Arrays had different lengths");
|
|
79
|
+
}
|
|
80
|
+
const result = Helpers_allocateArrayFromCons(cons, source1.length);
|
|
81
|
+
for (let i = 0; i <= (source1.length - 1); i++) {
|
|
82
|
+
setItem(result, i, f(item(i, source1), item(i, source2)));
|
|
83
|
+
}
|
|
84
|
+
return result;
|
|
85
|
+
}
|
|
86
|
+
function mapIndexed3(f, source1, source2, source3, cons) {
|
|
87
|
+
if ((source1.length !== source2.length) ? true : (source2.length !== source3.length)) {
|
|
88
|
+
throw new Error("Arrays had different lengths");
|
|
89
|
+
}
|
|
90
|
+
const result = Helpers_allocateArrayFromCons(cons, source1.length);
|
|
91
|
+
for (let i = 0; i <= (source1.length - 1); i++) {
|
|
92
|
+
setItem(result, i, f(i, item(i, source1), item(i, source2), item(i, source3)));
|
|
93
|
+
}
|
|
94
|
+
return result;
|
|
95
|
+
}
|
|
40
96
|
function map3(f, source1, source2, source3, cons) {
|
|
41
97
|
if ((source1.length !== source2.length) ? true : (source2.length !== source3.length)) {
|
|
42
98
|
throw new Error("Arrays had different lengths");
|
|
@@ -47,6 +103,50 @@ function map3(f, source1, source2, source3, cons) {
|
|
|
47
103
|
}
|
|
48
104
|
return result;
|
|
49
105
|
}
|
|
106
|
+
function mapFold(mapping, state, array, cons) {
|
|
107
|
+
const matchValue = array.length | 0;
|
|
108
|
+
if (matchValue === 0) {
|
|
109
|
+
return [[], state];
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
let acc = state;
|
|
113
|
+
const res = Helpers_allocateArrayFromCons(cons, matchValue);
|
|
114
|
+
for (let i = 0; i <= (array.length - 1); i++) {
|
|
115
|
+
const patternInput = mapping(acc, item(i, array));
|
|
116
|
+
setItem(res, i, patternInput[0]);
|
|
117
|
+
acc = patternInput[1];
|
|
118
|
+
}
|
|
119
|
+
return [res, acc];
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function mapFoldBack(mapping, array, state, cons) {
|
|
123
|
+
const matchValue = array.length | 0;
|
|
124
|
+
if (matchValue === 0) {
|
|
125
|
+
return [[], state];
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
let acc = state;
|
|
129
|
+
const res = Helpers_allocateArrayFromCons(cons, matchValue);
|
|
130
|
+
for (let i = array.length - 1; i >= 0; i--) {
|
|
131
|
+
const patternInput = mapping(item(i, array), acc);
|
|
132
|
+
setItem(res, i, patternInput[0]);
|
|
133
|
+
acc = patternInput[1];
|
|
134
|
+
}
|
|
135
|
+
return [res, acc];
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function indexed(source) {
|
|
139
|
+
const len = source.length | 0;
|
|
140
|
+
const target = new Array(len);
|
|
141
|
+
for (let i = 0; i <= (len - 1); i++) {
|
|
142
|
+
setItem(target, i, [i, item(i, source)]);
|
|
143
|
+
}
|
|
144
|
+
return target;
|
|
145
|
+
}
|
|
146
|
+
function truncate(count, array) {
|
|
147
|
+
const count_1 = max$1(0, count) | 0;
|
|
148
|
+
return array.slice(0, (0 + count_1));
|
|
149
|
+
}
|
|
50
150
|
function concat(arrays, cons) {
|
|
51
151
|
const arrays_1 = Array.isArray(arrays) ? arrays : (Array.from(arrays));
|
|
52
152
|
const matchValue = arrays_1.length | 0;
|
|
@@ -77,6 +177,9 @@ function concat(arrays, cons) {
|
|
|
77
177
|
function collect(mapping, array, cons) {
|
|
78
178
|
return concat(map(mapping, array, defaultOf()), cons);
|
|
79
179
|
}
|
|
180
|
+
function where(predicate, array) {
|
|
181
|
+
return array.filter(predicate);
|
|
182
|
+
}
|
|
80
183
|
function indexOf(array, item_1, start, count, eq) {
|
|
81
184
|
const start_1 = defaultArg(start, 0) | 0;
|
|
82
185
|
const end$0027 = defaultArg(map$1((c) => (start_1 + c), count), array.length) | 0;
|
|
@@ -93,6 +196,7 @@ function indexOf(array, item_1, start, count, eq) {
|
|
|
93
196
|
i_mut = (i + 1);
|
|
94
197
|
continue loop;
|
|
95
198
|
}
|
|
199
|
+
break;
|
|
96
200
|
}
|
|
97
201
|
};
|
|
98
202
|
return loop(start_1) | 0;
|
|
@@ -100,6 +204,9 @@ function indexOf(array, item_1, start, count, eq) {
|
|
|
100
204
|
function contains(value, array, eq) {
|
|
101
205
|
return indexOf(array, value, undefined, undefined, eq) >= 0;
|
|
102
206
|
}
|
|
207
|
+
function empty(cons) {
|
|
208
|
+
return Helpers_allocateArrayFromCons(cons, 0);
|
|
209
|
+
}
|
|
103
210
|
function singleton(value, cons) {
|
|
104
211
|
const ar = Helpers_allocateArrayFromCons(cons, 1);
|
|
105
212
|
setItem(ar, 0, value);
|
|
@@ -115,6 +222,55 @@ function initialize(count, initializer, cons) {
|
|
|
115
222
|
}
|
|
116
223
|
return result;
|
|
117
224
|
}
|
|
225
|
+
function pairwise(array) {
|
|
226
|
+
if (array.length < 2) {
|
|
227
|
+
return [];
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
const count = (array.length - 1) | 0;
|
|
231
|
+
const result = new Array(count);
|
|
232
|
+
for (let i = 0; i <= (count - 1); i++) {
|
|
233
|
+
setItem(result, i, [item(i, array), item(i + 1, array)]);
|
|
234
|
+
}
|
|
235
|
+
return result;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
function replicate(count, initial, cons) {
|
|
239
|
+
if (count < 0) {
|
|
240
|
+
throw new Error("The input must be non-negative\\nParameter name: count");
|
|
241
|
+
}
|
|
242
|
+
const result = Helpers_allocateArrayFromCons(cons, count);
|
|
243
|
+
for (let i = 0; i <= (result.length - 1); i++) {
|
|
244
|
+
setItem(result, i, initial);
|
|
245
|
+
}
|
|
246
|
+
return result;
|
|
247
|
+
}
|
|
248
|
+
function copy(array) {
|
|
249
|
+
return array.slice();
|
|
250
|
+
}
|
|
251
|
+
function copyTo(source, sourceIndex, target, targetIndex, count) {
|
|
252
|
+
copyToArray(source, sourceIndex, target, targetIndex, count);
|
|
253
|
+
}
|
|
254
|
+
function reverse(array) {
|
|
255
|
+
const array_2 = array.slice();
|
|
256
|
+
return array_2.reverse();
|
|
257
|
+
}
|
|
258
|
+
function scan(folder, state, array, cons) {
|
|
259
|
+
const res = Helpers_allocateArrayFromCons(cons, array.length + 1);
|
|
260
|
+
setItem(res, 0, state);
|
|
261
|
+
for (let i = 0; i <= (array.length - 1); i++) {
|
|
262
|
+
setItem(res, i + 1, folder(item(i, res), item(i, array)));
|
|
263
|
+
}
|
|
264
|
+
return res;
|
|
265
|
+
}
|
|
266
|
+
function scanBack(folder, array, state, cons) {
|
|
267
|
+
const res = Helpers_allocateArrayFromCons(cons, array.length + 1);
|
|
268
|
+
setItem(res, array.length, state);
|
|
269
|
+
for (let i = array.length - 1; i >= 0; i--) {
|
|
270
|
+
setItem(res, i, folder(item(i, array), item(i + 1, res)));
|
|
271
|
+
}
|
|
272
|
+
return res;
|
|
273
|
+
}
|
|
118
274
|
function skip(count, array, cons) {
|
|
119
275
|
if (count > array.length) {
|
|
120
276
|
throw new Error("count is greater than array length\\nParameter name: count");
|
|
@@ -123,10 +279,50 @@ function skip(count, array, cons) {
|
|
|
123
279
|
return Helpers_allocateArrayFromCons(cons, 0);
|
|
124
280
|
}
|
|
125
281
|
else {
|
|
126
|
-
const count_1 = (count) | 0;
|
|
282
|
+
const count_1 = ((count < 0) ? 0 : count) | 0;
|
|
127
283
|
return array.slice(count_1);
|
|
128
284
|
}
|
|
129
285
|
}
|
|
286
|
+
function skipWhile(predicate, array, cons) {
|
|
287
|
+
let count = 0;
|
|
288
|
+
while ((count < array.length) && predicate(item(count, array))) {
|
|
289
|
+
count = ((count + 1) | 0);
|
|
290
|
+
}
|
|
291
|
+
if (count === array.length) {
|
|
292
|
+
return Helpers_allocateArrayFromCons(cons, 0);
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
const count_1 = count | 0;
|
|
296
|
+
return array.slice(count_1);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
function take(count, array, cons) {
|
|
300
|
+
if (count < 0) {
|
|
301
|
+
throw new Error("The input must be non-negative\\nParameter name: count");
|
|
302
|
+
}
|
|
303
|
+
if (count > array.length) {
|
|
304
|
+
throw new Error("count is greater than array length\\nParameter name: count");
|
|
305
|
+
}
|
|
306
|
+
if (count === 0) {
|
|
307
|
+
return Helpers_allocateArrayFromCons(cons, 0);
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
return array.slice(0, (0 + count));
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
function takeWhile(predicate, array, cons) {
|
|
314
|
+
let count = 0;
|
|
315
|
+
while ((count < array.length) && predicate(item(count, array))) {
|
|
316
|
+
count = ((count + 1) | 0);
|
|
317
|
+
}
|
|
318
|
+
if (count === 0) {
|
|
319
|
+
return Helpers_allocateArrayFromCons(cons, 0);
|
|
320
|
+
}
|
|
321
|
+
else {
|
|
322
|
+
const count_1 = count | 0;
|
|
323
|
+
return array.slice(0, (0 + count_1));
|
|
324
|
+
}
|
|
325
|
+
}
|
|
130
326
|
function addInPlace(x, array) {
|
|
131
327
|
array.push(x);
|
|
132
328
|
}
|
|
@@ -166,9 +362,59 @@ function removeInPlace(item_1, array, eq) {
|
|
|
166
362
|
return false;
|
|
167
363
|
}
|
|
168
364
|
}
|
|
365
|
+
function removeAllInPlace(predicate, array) {
|
|
366
|
+
const countRemoveAll = (count) => {
|
|
367
|
+
const i = (array.findIndex(predicate)) | 0;
|
|
368
|
+
if (i > -1) {
|
|
369
|
+
array.splice(i, 1);
|
|
370
|
+
return (countRemoveAll(count) + 1) | 0;
|
|
371
|
+
}
|
|
372
|
+
else {
|
|
373
|
+
return count | 0;
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
return countRemoveAll(0) | 0;
|
|
377
|
+
}
|
|
378
|
+
function partition(f, source, cons) {
|
|
379
|
+
const len = source.length | 0;
|
|
380
|
+
const res1 = Helpers_allocateArrayFromCons(cons, len);
|
|
381
|
+
const res2 = Helpers_allocateArrayFromCons(cons, len);
|
|
382
|
+
let iTrue = 0;
|
|
383
|
+
let iFalse = 0;
|
|
384
|
+
for (let i = 0; i <= (len - 1); i++) {
|
|
385
|
+
if (f(item(i, source))) {
|
|
386
|
+
setItem(res1, iTrue, item(i, source));
|
|
387
|
+
iTrue = ((iTrue + 1) | 0);
|
|
388
|
+
}
|
|
389
|
+
else {
|
|
390
|
+
setItem(res2, iFalse, item(i, source));
|
|
391
|
+
iFalse = ((iFalse + 1) | 0);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
return [truncate(iTrue, res1), truncate(iFalse, res2)];
|
|
395
|
+
}
|
|
396
|
+
function find(predicate, array) {
|
|
397
|
+
const matchValue = array.find(predicate);
|
|
398
|
+
if (matchValue == null) {
|
|
399
|
+
return indexNotFound();
|
|
400
|
+
}
|
|
401
|
+
else {
|
|
402
|
+
return value(matchValue);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
169
405
|
function tryFind(predicate, array) {
|
|
170
406
|
return array.find(predicate);
|
|
171
407
|
}
|
|
408
|
+
function findIndex(predicate, array) {
|
|
409
|
+
const matchValue = (array.findIndex(predicate)) | 0;
|
|
410
|
+
if (matchValue > -1) {
|
|
411
|
+
return matchValue | 0;
|
|
412
|
+
}
|
|
413
|
+
else {
|
|
414
|
+
indexNotFound();
|
|
415
|
+
return -1;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
172
418
|
function tryFindIndex(predicate, array) {
|
|
173
419
|
const matchValue = (array.findIndex(predicate)) | 0;
|
|
174
420
|
if (matchValue > -1) {
|
|
@@ -178,6 +424,28 @@ function tryFindIndex(predicate, array) {
|
|
|
178
424
|
return undefined;
|
|
179
425
|
}
|
|
180
426
|
}
|
|
427
|
+
function pick(chooser, array) {
|
|
428
|
+
const loop = (i_mut) => {
|
|
429
|
+
loop: while (true) {
|
|
430
|
+
const i = i_mut;
|
|
431
|
+
if (i >= array.length) {
|
|
432
|
+
return indexNotFound();
|
|
433
|
+
}
|
|
434
|
+
else {
|
|
435
|
+
const matchValue = chooser(item(i, array));
|
|
436
|
+
if (matchValue != null) {
|
|
437
|
+
return value(matchValue);
|
|
438
|
+
}
|
|
439
|
+
else {
|
|
440
|
+
i_mut = (i + 1);
|
|
441
|
+
continue loop;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
break;
|
|
445
|
+
}
|
|
446
|
+
};
|
|
447
|
+
return loop(0);
|
|
448
|
+
}
|
|
181
449
|
function tryPick(chooser, array) {
|
|
182
450
|
const loop = (i_mut) => {
|
|
183
451
|
loop: while (true) {
|
|
@@ -195,10 +463,107 @@ function tryPick(chooser, array) {
|
|
|
195
463
|
return matchValue;
|
|
196
464
|
}
|
|
197
465
|
}
|
|
466
|
+
break;
|
|
198
467
|
}
|
|
199
468
|
};
|
|
200
469
|
return loop(0);
|
|
201
470
|
}
|
|
471
|
+
function findBack(predicate, array) {
|
|
472
|
+
const loop = (i_mut) => {
|
|
473
|
+
loop: while (true) {
|
|
474
|
+
const i = i_mut;
|
|
475
|
+
if (i < 0) {
|
|
476
|
+
return indexNotFound();
|
|
477
|
+
}
|
|
478
|
+
else if (predicate(item(i, array))) {
|
|
479
|
+
return item(i, array);
|
|
480
|
+
}
|
|
481
|
+
else {
|
|
482
|
+
i_mut = (i - 1);
|
|
483
|
+
continue loop;
|
|
484
|
+
}
|
|
485
|
+
break;
|
|
486
|
+
}
|
|
487
|
+
};
|
|
488
|
+
return loop(array.length - 1);
|
|
489
|
+
}
|
|
490
|
+
function tryFindBack(predicate, array) {
|
|
491
|
+
const loop = (i_mut) => {
|
|
492
|
+
loop: while (true) {
|
|
493
|
+
const i = i_mut;
|
|
494
|
+
if (i < 0) {
|
|
495
|
+
return undefined;
|
|
496
|
+
}
|
|
497
|
+
else if (predicate(item(i, array))) {
|
|
498
|
+
return some(item(i, array));
|
|
499
|
+
}
|
|
500
|
+
else {
|
|
501
|
+
i_mut = (i - 1);
|
|
502
|
+
continue loop;
|
|
503
|
+
}
|
|
504
|
+
break;
|
|
505
|
+
}
|
|
506
|
+
};
|
|
507
|
+
return loop(array.length - 1);
|
|
508
|
+
}
|
|
509
|
+
function findLastIndex(predicate, array) {
|
|
510
|
+
const loop = (i_mut) => {
|
|
511
|
+
loop: while (true) {
|
|
512
|
+
const i = i_mut;
|
|
513
|
+
if (i < 0) {
|
|
514
|
+
return -1;
|
|
515
|
+
}
|
|
516
|
+
else if (predicate(item(i, array))) {
|
|
517
|
+
return i | 0;
|
|
518
|
+
}
|
|
519
|
+
else {
|
|
520
|
+
i_mut = (i - 1);
|
|
521
|
+
continue loop;
|
|
522
|
+
}
|
|
523
|
+
break;
|
|
524
|
+
}
|
|
525
|
+
};
|
|
526
|
+
return loop(array.length - 1) | 0;
|
|
527
|
+
}
|
|
528
|
+
function findIndexBack(predicate, array) {
|
|
529
|
+
const loop = (i_mut) => {
|
|
530
|
+
loop: while (true) {
|
|
531
|
+
const i = i_mut;
|
|
532
|
+
if (i < 0) {
|
|
533
|
+
indexNotFound();
|
|
534
|
+
return -1;
|
|
535
|
+
}
|
|
536
|
+
else if (predicate(item(i, array))) {
|
|
537
|
+
return i | 0;
|
|
538
|
+
}
|
|
539
|
+
else {
|
|
540
|
+
i_mut = (i - 1);
|
|
541
|
+
continue loop;
|
|
542
|
+
}
|
|
543
|
+
break;
|
|
544
|
+
}
|
|
545
|
+
};
|
|
546
|
+
return loop(array.length - 1) | 0;
|
|
547
|
+
}
|
|
548
|
+
function tryFindIndexBack(predicate, array) {
|
|
549
|
+
const loop = (i_mut) => {
|
|
550
|
+
loop: while (true) {
|
|
551
|
+
const i = i_mut;
|
|
552
|
+
if (i < 0) {
|
|
553
|
+
return undefined;
|
|
554
|
+
}
|
|
555
|
+
else if (predicate(item(i, array))) {
|
|
556
|
+
return i;
|
|
557
|
+
}
|
|
558
|
+
else {
|
|
559
|
+
i_mut = (i - 1);
|
|
560
|
+
continue loop;
|
|
561
|
+
}
|
|
562
|
+
break;
|
|
563
|
+
}
|
|
564
|
+
};
|
|
565
|
+
return loop(array.length - 1);
|
|
566
|
+
}
|
|
202
567
|
function choose(chooser, array, cons) {
|
|
203
568
|
const res = [];
|
|
204
569
|
for (let i = 0; i <= (array.length - 1); i++) {
|
|
@@ -215,18 +580,81 @@ function choose(chooser, array, cons) {
|
|
|
215
580
|
return map((x) => x, res, cons);
|
|
216
581
|
}
|
|
217
582
|
}
|
|
583
|
+
function foldIndexed(folder, state, array) {
|
|
584
|
+
return array.reduce(((delegateArg, delegateArg_1, delegateArg_2) => folder(delegateArg_2, delegateArg, delegateArg_1)), state);
|
|
585
|
+
}
|
|
218
586
|
function fold(folder, state, array) {
|
|
219
587
|
const folder_1 = folder;
|
|
220
588
|
return array.reduce((folder_1), state);
|
|
221
589
|
}
|
|
590
|
+
function iterate(action, array) {
|
|
591
|
+
for (let i = 0; i <= (array.length - 1); i++) {
|
|
592
|
+
action(item(i, array));
|
|
593
|
+
}
|
|
594
|
+
}
|
|
222
595
|
function iterateIndexed(action, array) {
|
|
223
596
|
for (let i = 0; i <= (array.length - 1); i++) {
|
|
224
597
|
action(i, item(i, array));
|
|
225
598
|
}
|
|
226
599
|
}
|
|
600
|
+
function iterate2(action, array1, array2) {
|
|
601
|
+
if (array1.length !== array2.length) {
|
|
602
|
+
differentLengths();
|
|
603
|
+
}
|
|
604
|
+
for (let i = 0; i <= (array1.length - 1); i++) {
|
|
605
|
+
action(item(i, array1), item(i, array2));
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
function iterateIndexed2(action, array1, array2) {
|
|
609
|
+
if (array1.length !== array2.length) {
|
|
610
|
+
differentLengths();
|
|
611
|
+
}
|
|
612
|
+
for (let i = 0; i <= (array1.length - 1); i++) {
|
|
613
|
+
action(i, item(i, array1), item(i, array2));
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
function isEmpty(array) {
|
|
617
|
+
return array.length === 0;
|
|
618
|
+
}
|
|
227
619
|
function forAll(predicate, array) {
|
|
228
620
|
return array.every(predicate);
|
|
229
621
|
}
|
|
622
|
+
function permute(f, array) {
|
|
623
|
+
const size = array.length | 0;
|
|
624
|
+
const res = array.slice();
|
|
625
|
+
const checkFlags = new Array(size);
|
|
626
|
+
iterateIndexed((i, x) => {
|
|
627
|
+
const j = f(i) | 0;
|
|
628
|
+
if ((j < 0) ? true : (j >= size)) {
|
|
629
|
+
throw new Error("Not a valid permutation");
|
|
630
|
+
}
|
|
631
|
+
setItem(res, j, x);
|
|
632
|
+
setItem(checkFlags, j, 1);
|
|
633
|
+
}, array);
|
|
634
|
+
if (!(checkFlags.every((y) => (1 === y)))) {
|
|
635
|
+
throw new Error("Not a valid permutation");
|
|
636
|
+
}
|
|
637
|
+
return res;
|
|
638
|
+
}
|
|
639
|
+
function setSlice(target, lower, upper, source) {
|
|
640
|
+
const lower_1 = defaultArg(lower, 0) | 0;
|
|
641
|
+
const upper_1 = defaultArg(upper, -1) | 0;
|
|
642
|
+
const length = (((upper_1 >= 0) ? upper_1 : (target.length - 1)) - lower_1) | 0;
|
|
643
|
+
for (let i = 0; i <= length; i++) {
|
|
644
|
+
setItem(target, i + lower_1, item(i, source));
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
function sortInPlaceBy(projection, xs, comparer) {
|
|
648
|
+
xs.sort((x, y) => comparer.Compare(projection(x), projection(y)));
|
|
649
|
+
}
|
|
650
|
+
function sortInPlace(xs, comparer) {
|
|
651
|
+
xs.sort((x, y) => comparer.Compare(x, y));
|
|
652
|
+
}
|
|
653
|
+
function sort(xs, comparer) {
|
|
654
|
+
const xs_1 = xs.slice();
|
|
655
|
+
xs_1.sort((x, y) => comparer.Compare(x, y));
|
|
656
|
+
return xs_1;
|
|
657
|
+
}
|
|
230
658
|
function sortBy(projection, xs, comparer) {
|
|
231
659
|
const xs_1 = xs.slice();
|
|
232
660
|
xs_1.sort((x, y) => comparer.Compare(projection(x), projection(y)));
|
|
@@ -237,6 +665,47 @@ function sortDescending(xs, comparer) {
|
|
|
237
665
|
xs_1.sort((x, y) => (comparer.Compare(x, y) * -1));
|
|
238
666
|
return xs_1;
|
|
239
667
|
}
|
|
668
|
+
function sortByDescending(projection, xs, comparer) {
|
|
669
|
+
const xs_1 = xs.slice();
|
|
670
|
+
xs_1.sort((x, y) => (comparer.Compare(projection(x), projection(y)) * -1));
|
|
671
|
+
return xs_1;
|
|
672
|
+
}
|
|
673
|
+
function sortWith(comparer, xs) {
|
|
674
|
+
const comparer_1 = comparer;
|
|
675
|
+
const xs_1 = xs.slice();
|
|
676
|
+
xs_1.sort(comparer_1);
|
|
677
|
+
return xs_1;
|
|
678
|
+
}
|
|
679
|
+
function allPairs(xs, ys) {
|
|
680
|
+
const len1 = xs.length | 0;
|
|
681
|
+
const len2 = ys.length | 0;
|
|
682
|
+
const res = new Array(len1 * len2);
|
|
683
|
+
for (let i = 0; i <= (xs.length - 1); i++) {
|
|
684
|
+
for (let j = 0; j <= (ys.length - 1); j++) {
|
|
685
|
+
setItem(res, (i * len2) + j, [item(i, xs), item(j, ys)]);
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
return res;
|
|
689
|
+
}
|
|
690
|
+
function unfold(generator, state) {
|
|
691
|
+
const res = [];
|
|
692
|
+
const loop = (state_1_mut) => {
|
|
693
|
+
loop: while (true) {
|
|
694
|
+
const state_1 = state_1_mut;
|
|
695
|
+
const matchValue = generator(state_1);
|
|
696
|
+
if (matchValue != null) {
|
|
697
|
+
const x = value(matchValue)[0];
|
|
698
|
+
const s = value(matchValue)[1];
|
|
699
|
+
res.push(x);
|
|
700
|
+
state_1_mut = s;
|
|
701
|
+
continue loop;
|
|
702
|
+
}
|
|
703
|
+
break;
|
|
704
|
+
}
|
|
705
|
+
};
|
|
706
|
+
loop(state);
|
|
707
|
+
return res;
|
|
708
|
+
}
|
|
240
709
|
function unzip(array) {
|
|
241
710
|
const len = array.length | 0;
|
|
242
711
|
const res1 = new Array(len);
|
|
@@ -247,6 +716,130 @@ function unzip(array) {
|
|
|
247
716
|
}, array);
|
|
248
717
|
return [res1, res2];
|
|
249
718
|
}
|
|
719
|
+
function unzip3(array) {
|
|
720
|
+
const len = array.length | 0;
|
|
721
|
+
const res1 = new Array(len);
|
|
722
|
+
const res2 = new Array(len);
|
|
723
|
+
const res3 = new Array(len);
|
|
724
|
+
iterateIndexed((i, tupledArg) => {
|
|
725
|
+
setItem(res1, i, tupledArg[0]);
|
|
726
|
+
setItem(res2, i, tupledArg[1]);
|
|
727
|
+
setItem(res3, i, tupledArg[2]);
|
|
728
|
+
}, array);
|
|
729
|
+
return [res1, res2, res3];
|
|
730
|
+
}
|
|
731
|
+
function zip(array1, array2) {
|
|
732
|
+
if (array1.length !== array2.length) {
|
|
733
|
+
differentLengths();
|
|
734
|
+
}
|
|
735
|
+
const result = new Array(array1.length);
|
|
736
|
+
for (let i = 0; i <= (array1.length - 1); i++) {
|
|
737
|
+
setItem(result, i, [item(i, array1), item(i, array2)]);
|
|
738
|
+
}
|
|
739
|
+
return result;
|
|
740
|
+
}
|
|
741
|
+
function zip3(array1, array2, array3) {
|
|
742
|
+
if ((array1.length !== array2.length) ? true : (array2.length !== array3.length)) {
|
|
743
|
+
differentLengths();
|
|
744
|
+
}
|
|
745
|
+
const result = new Array(array1.length);
|
|
746
|
+
for (let i = 0; i <= (array1.length - 1); i++) {
|
|
747
|
+
setItem(result, i, [item(i, array1), item(i, array2), item(i, array3)]);
|
|
748
|
+
}
|
|
749
|
+
return result;
|
|
750
|
+
}
|
|
751
|
+
function chunkBySize(chunkSize, array) {
|
|
752
|
+
if (chunkSize < 1) {
|
|
753
|
+
throw new Error("The input must be positive.\\nParameter name: size");
|
|
754
|
+
}
|
|
755
|
+
if (array.length === 0) {
|
|
756
|
+
return [[]];
|
|
757
|
+
}
|
|
758
|
+
else {
|
|
759
|
+
const result = [];
|
|
760
|
+
for (let x = 0; x <= (~~Math.ceil(array.length / chunkSize) - 1); x++) {
|
|
761
|
+
let slice;
|
|
762
|
+
const start_1 = (x * chunkSize) | 0;
|
|
763
|
+
slice = (array.slice(start_1, (start_1 + chunkSize)));
|
|
764
|
+
result.push(slice);
|
|
765
|
+
}
|
|
766
|
+
return result;
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
function splitAt(index, array) {
|
|
770
|
+
if ((index < 0) ? true : (index > array.length)) {
|
|
771
|
+
throw new Error((SR_indexOutOfBounds + "\\nParameter name: ") + "index");
|
|
772
|
+
}
|
|
773
|
+
return [array.slice(0, (0 + index)), array.slice(index)];
|
|
774
|
+
}
|
|
775
|
+
function compareWith(comparer, source1, source2) {
|
|
776
|
+
if (source1 == null) {
|
|
777
|
+
if (source2 == null) {
|
|
778
|
+
return 0;
|
|
779
|
+
}
|
|
780
|
+
else {
|
|
781
|
+
return -1;
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
else if (source2 == null) {
|
|
785
|
+
return 1;
|
|
786
|
+
}
|
|
787
|
+
else {
|
|
788
|
+
const len1 = source1.length | 0;
|
|
789
|
+
const len2 = source2.length | 0;
|
|
790
|
+
const len = ((len1 < len2) ? len1 : len2) | 0;
|
|
791
|
+
let i = 0;
|
|
792
|
+
let res = 0;
|
|
793
|
+
while ((res === 0) && (i < len)) {
|
|
794
|
+
res = (comparer(item(i, source1), item(i, source2)) | 0);
|
|
795
|
+
i = ((i + 1) | 0);
|
|
796
|
+
}
|
|
797
|
+
if (res !== 0) {
|
|
798
|
+
return res | 0;
|
|
799
|
+
}
|
|
800
|
+
else if (len1 > len2) {
|
|
801
|
+
return 1;
|
|
802
|
+
}
|
|
803
|
+
else if (len1 < len2) {
|
|
804
|
+
return -1;
|
|
805
|
+
}
|
|
806
|
+
else {
|
|
807
|
+
return 0;
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
function compareTo(comparer, source1, source2) {
|
|
812
|
+
if (source1 == null) {
|
|
813
|
+
if (source2 == null) {
|
|
814
|
+
return 0;
|
|
815
|
+
}
|
|
816
|
+
else {
|
|
817
|
+
return -1;
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
else if (source2 == null) {
|
|
821
|
+
return 1;
|
|
822
|
+
}
|
|
823
|
+
else {
|
|
824
|
+
const len1 = source1.length | 0;
|
|
825
|
+
const len2 = source2.length | 0;
|
|
826
|
+
if (len1 > len2) {
|
|
827
|
+
return 1;
|
|
828
|
+
}
|
|
829
|
+
else if (len1 < len2) {
|
|
830
|
+
return -1;
|
|
831
|
+
}
|
|
832
|
+
else {
|
|
833
|
+
let i = 0;
|
|
834
|
+
let res = 0;
|
|
835
|
+
while ((res === 0) && (i < len1)) {
|
|
836
|
+
res = (comparer(item(i, source1), item(i, source2)) | 0);
|
|
837
|
+
i = ((i + 1) | 0);
|
|
838
|
+
}
|
|
839
|
+
return res | 0;
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
}
|
|
250
843
|
function equalsWith(equals, array1, array2) {
|
|
251
844
|
if (array1 == null) {
|
|
252
845
|
if (array2 == null) {
|
|
@@ -279,6 +872,24 @@ function equalsWith(equals, array1, array2) {
|
|
|
279
872
|
}
|
|
280
873
|
}
|
|
281
874
|
}
|
|
875
|
+
function exactlyOne(array) {
|
|
876
|
+
switch (array.length) {
|
|
877
|
+
case 1:
|
|
878
|
+
return item(0, array);
|
|
879
|
+
case 0:
|
|
880
|
+
throw new Error("The input sequence was empty\\nParameter name: array");
|
|
881
|
+
default:
|
|
882
|
+
throw new Error("Input array too long\\nParameter name: array");
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
function tryExactlyOne(array) {
|
|
886
|
+
if (array.length === 1) {
|
|
887
|
+
return some(item(0, array));
|
|
888
|
+
}
|
|
889
|
+
else {
|
|
890
|
+
return undefined;
|
|
891
|
+
}
|
|
892
|
+
}
|
|
282
893
|
function head(array) {
|
|
283
894
|
if (array.length === 0) {
|
|
284
895
|
throw new Error("The input array was empty\\nParameter name: array");
|
|
@@ -325,9 +936,182 @@ function tryItem(index, array) {
|
|
|
325
936
|
return some(array[index]);
|
|
326
937
|
}
|
|
327
938
|
}
|
|
939
|
+
function foldBackIndexed(folder, array, state) {
|
|
940
|
+
return array.reduceRight(((delegateArg, delegateArg_1, delegateArg_2) => folder(delegateArg_2, delegateArg_1, delegateArg)), state);
|
|
941
|
+
}
|
|
328
942
|
function foldBack(folder, array, state) {
|
|
329
943
|
return array.reduceRight(((delegateArg, delegateArg_1) => folder(delegateArg_1, delegateArg)), state);
|
|
330
944
|
}
|
|
945
|
+
function foldIndexed2(folder, state, array1, array2) {
|
|
946
|
+
let acc = state;
|
|
947
|
+
if (array1.length !== array2.length) {
|
|
948
|
+
throw new Error("Arrays have different lengths");
|
|
949
|
+
}
|
|
950
|
+
for (let i = 0; i <= (array1.length - 1); i++) {
|
|
951
|
+
acc = folder(i, acc, item(i, array1), item(i, array2));
|
|
952
|
+
}
|
|
953
|
+
return acc;
|
|
954
|
+
}
|
|
955
|
+
function fold2(folder, state, array1, array2) {
|
|
956
|
+
return foldIndexed2((_arg, acc, x, y) => folder(acc, x, y), state, array1, array2);
|
|
957
|
+
}
|
|
958
|
+
function foldBackIndexed2(folder, array1, array2, state) {
|
|
959
|
+
let acc = state;
|
|
960
|
+
if (array1.length !== array2.length) {
|
|
961
|
+
differentLengths();
|
|
962
|
+
}
|
|
963
|
+
const size = array1.length | 0;
|
|
964
|
+
for (let i = 1; i <= size; i++) {
|
|
965
|
+
acc = folder(i - 1, item(size - i, array1), item(size - i, array2), acc);
|
|
966
|
+
}
|
|
967
|
+
return acc;
|
|
968
|
+
}
|
|
969
|
+
function foldBack2(f, array1, array2, state) {
|
|
970
|
+
return foldBackIndexed2((_arg, x, y, acc) => f(x, y, acc), array1, array2, state);
|
|
971
|
+
}
|
|
972
|
+
function reduce(reduction, array) {
|
|
973
|
+
if (array.length === 0) {
|
|
974
|
+
throw new Error("The input array was empty");
|
|
975
|
+
}
|
|
976
|
+
const reduction_1 = reduction;
|
|
977
|
+
return array.reduce(reduction_1);
|
|
978
|
+
}
|
|
979
|
+
function reduceBack(reduction, array) {
|
|
980
|
+
if (array.length === 0) {
|
|
981
|
+
throw new Error("The input array was empty");
|
|
982
|
+
}
|
|
983
|
+
const reduction_1 = reduction;
|
|
984
|
+
return array.reduceRight(reduction_1);
|
|
985
|
+
}
|
|
986
|
+
function forAll2(predicate, array1, array2) {
|
|
987
|
+
return fold2((acc, x, y) => (acc && predicate(x, y)), true, array1, array2);
|
|
988
|
+
}
|
|
989
|
+
function existsOffset(predicate_mut, array_mut, index_mut) {
|
|
990
|
+
existsOffset: while (true) {
|
|
991
|
+
const predicate = predicate_mut, array = array_mut, index = index_mut;
|
|
992
|
+
if (index === array.length) {
|
|
993
|
+
return false;
|
|
994
|
+
}
|
|
995
|
+
else if (predicate(item(index, array))) {
|
|
996
|
+
return true;
|
|
997
|
+
}
|
|
998
|
+
else {
|
|
999
|
+
predicate_mut = predicate;
|
|
1000
|
+
array_mut = array;
|
|
1001
|
+
index_mut = (index + 1);
|
|
1002
|
+
continue existsOffset;
|
|
1003
|
+
}
|
|
1004
|
+
break;
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
function exists(predicate, array) {
|
|
1008
|
+
return existsOffset(predicate, array, 0);
|
|
1009
|
+
}
|
|
1010
|
+
function existsOffset2(predicate_mut, array1_mut, array2_mut, index_mut) {
|
|
1011
|
+
existsOffset2: while (true) {
|
|
1012
|
+
const predicate = predicate_mut, array1 = array1_mut, array2 = array2_mut, index = index_mut;
|
|
1013
|
+
if (index === array1.length) {
|
|
1014
|
+
return false;
|
|
1015
|
+
}
|
|
1016
|
+
else if (predicate(item(index, array1), item(index, array2))) {
|
|
1017
|
+
return true;
|
|
1018
|
+
}
|
|
1019
|
+
else {
|
|
1020
|
+
predicate_mut = predicate;
|
|
1021
|
+
array1_mut = array1;
|
|
1022
|
+
array2_mut = array2;
|
|
1023
|
+
index_mut = (index + 1);
|
|
1024
|
+
continue existsOffset2;
|
|
1025
|
+
}
|
|
1026
|
+
break;
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
function exists2(predicate, array1, array2) {
|
|
1030
|
+
if (array1.length !== array2.length) {
|
|
1031
|
+
differentLengths();
|
|
1032
|
+
}
|
|
1033
|
+
return existsOffset2(predicate, array1, array2, 0);
|
|
1034
|
+
}
|
|
1035
|
+
function sum(array, adder) {
|
|
1036
|
+
let acc = adder.GetZero();
|
|
1037
|
+
for (let i = 0; i <= (array.length - 1); i++) {
|
|
1038
|
+
acc = adder.Add(acc, item(i, array));
|
|
1039
|
+
}
|
|
1040
|
+
return acc;
|
|
1041
|
+
}
|
|
1042
|
+
function sumBy(projection, array, adder) {
|
|
1043
|
+
let acc = adder.GetZero();
|
|
1044
|
+
for (let i = 0; i <= (array.length - 1); i++) {
|
|
1045
|
+
acc = adder.Add(acc, projection(item(i, array)));
|
|
1046
|
+
}
|
|
1047
|
+
return acc;
|
|
1048
|
+
}
|
|
1049
|
+
function maxBy(projection, xs, comparer) {
|
|
1050
|
+
return reduce((x, y) => ((comparer.Compare(projection(y), projection(x)) > 0) ? y : x), xs);
|
|
1051
|
+
}
|
|
1052
|
+
function max(xs, comparer) {
|
|
1053
|
+
return reduce((x, y) => ((comparer.Compare(y, x) > 0) ? y : x), xs);
|
|
1054
|
+
}
|
|
1055
|
+
function minBy(projection, xs, comparer) {
|
|
1056
|
+
return reduce((x, y) => ((comparer.Compare(projection(y), projection(x)) > 0) ? x : y), xs);
|
|
1057
|
+
}
|
|
1058
|
+
function min(xs, comparer) {
|
|
1059
|
+
return reduce((x, y) => ((comparer.Compare(y, x) > 0) ? x : y), xs);
|
|
1060
|
+
}
|
|
1061
|
+
function average(array, averager) {
|
|
1062
|
+
if (array.length === 0) {
|
|
1063
|
+
throw new Error("The input array was empty\\nParameter name: array");
|
|
1064
|
+
}
|
|
1065
|
+
let total = averager.GetZero();
|
|
1066
|
+
for (let i = 0; i <= (array.length - 1); i++) {
|
|
1067
|
+
total = averager.Add(total, item(i, array));
|
|
1068
|
+
}
|
|
1069
|
+
return averager.DivideByInt(total, array.length);
|
|
1070
|
+
}
|
|
1071
|
+
function averageBy(projection, array, averager) {
|
|
1072
|
+
if (array.length === 0) {
|
|
1073
|
+
throw new Error("The input array was empty\\nParameter name: array");
|
|
1074
|
+
}
|
|
1075
|
+
let total = averager.GetZero();
|
|
1076
|
+
for (let i = 0; i <= (array.length - 1); i++) {
|
|
1077
|
+
total = averager.Add(total, projection(item(i, array)));
|
|
1078
|
+
}
|
|
1079
|
+
return averager.DivideByInt(total, array.length);
|
|
1080
|
+
}
|
|
1081
|
+
function windowed(windowSize, source) {
|
|
1082
|
+
if (windowSize <= 0) {
|
|
1083
|
+
throw new Error("windowSize must be positive");
|
|
1084
|
+
}
|
|
1085
|
+
let res;
|
|
1086
|
+
const len = max$1(0, (source.length - windowSize) + 1) | 0;
|
|
1087
|
+
res = (new Array(len));
|
|
1088
|
+
for (let i = windowSize; i <= source.length; i++) {
|
|
1089
|
+
setItem(res, i - windowSize, source.slice(i - windowSize, (i - 1) + 1));
|
|
1090
|
+
}
|
|
1091
|
+
return res;
|
|
1092
|
+
}
|
|
1093
|
+
function splitInto(chunks, array) {
|
|
1094
|
+
if (chunks < 1) {
|
|
1095
|
+
throw new Error("The input must be positive.\\nParameter name: chunks");
|
|
1096
|
+
}
|
|
1097
|
+
if (array.length === 0) {
|
|
1098
|
+
return [[]];
|
|
1099
|
+
}
|
|
1100
|
+
else {
|
|
1101
|
+
const result = [];
|
|
1102
|
+
const chunks_1 = min$1(chunks, array.length) | 0;
|
|
1103
|
+
const minChunkSize = ~~(array.length / chunks_1) | 0;
|
|
1104
|
+
const chunksWithExtraItem = (array.length % chunks_1) | 0;
|
|
1105
|
+
for (let i = 0; i <= (chunks_1 - 1); i++) {
|
|
1106
|
+
const chunkSize = ((i < chunksWithExtraItem) ? (minChunkSize + 1) : minChunkSize) | 0;
|
|
1107
|
+
let slice;
|
|
1108
|
+
const start_1 = ((i * minChunkSize) + min$1(chunksWithExtraItem, i)) | 0;
|
|
1109
|
+
slice = (array.slice(start_1, (start_1 + chunkSize)));
|
|
1110
|
+
result.push(slice);
|
|
1111
|
+
}
|
|
1112
|
+
return result;
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
331
1115
|
function transpose(arrays, cons) {
|
|
332
1116
|
const arrays_1 = Array.isArray(arrays) ? arrays : (Array.from(arrays));
|
|
333
1117
|
const len = arrays_1.length | 0;
|
|
@@ -350,5 +1134,111 @@ function transpose(arrays, cons) {
|
|
|
350
1134
|
return result;
|
|
351
1135
|
}
|
|
352
1136
|
}
|
|
1137
|
+
function insertAt(index, y, xs, cons) {
|
|
1138
|
+
const len = xs.length | 0;
|
|
1139
|
+
if ((index < 0) ? true : (index > len)) {
|
|
1140
|
+
throw new Error((SR_indexOutOfBounds + "\\nParameter name: ") + "index");
|
|
1141
|
+
}
|
|
1142
|
+
const target = Helpers_allocateArrayFromCons(cons, len + 1);
|
|
1143
|
+
for (let i = 0; i <= (index - 1); i++) {
|
|
1144
|
+
setItem(target, i, item(i, xs));
|
|
1145
|
+
}
|
|
1146
|
+
setItem(target, index, y);
|
|
1147
|
+
for (let i_1 = index; i_1 <= (len - 1); i_1++) {
|
|
1148
|
+
setItem(target, i_1 + 1, item(i_1, xs));
|
|
1149
|
+
}
|
|
1150
|
+
return target;
|
|
1151
|
+
}
|
|
1152
|
+
function insertManyAt(index, ys, xs, cons) {
|
|
1153
|
+
const len = xs.length | 0;
|
|
1154
|
+
if ((index < 0) ? true : (index > len)) {
|
|
1155
|
+
throw new Error((SR_indexOutOfBounds + "\\nParameter name: ") + "index");
|
|
1156
|
+
}
|
|
1157
|
+
const ys_1 = Array.from(ys);
|
|
1158
|
+
const len2 = ys_1.length | 0;
|
|
1159
|
+
const target = Helpers_allocateArrayFromCons(cons, len + len2);
|
|
1160
|
+
for (let i = 0; i <= (index - 1); i++) {
|
|
1161
|
+
setItem(target, i, item(i, xs));
|
|
1162
|
+
}
|
|
1163
|
+
for (let i_1 = 0; i_1 <= (len2 - 1); i_1++) {
|
|
1164
|
+
setItem(target, index + i_1, item(i_1, ys_1));
|
|
1165
|
+
}
|
|
1166
|
+
for (let i_2 = index; i_2 <= (len - 1); i_2++) {
|
|
1167
|
+
setItem(target, i_2 + len2, item(i_2, xs));
|
|
1168
|
+
}
|
|
1169
|
+
return target;
|
|
1170
|
+
}
|
|
1171
|
+
function removeAt(index, xs) {
|
|
1172
|
+
if ((index < 0) ? true : (index >= xs.length)) {
|
|
1173
|
+
throw new Error((SR_indexOutOfBounds + "\\nParameter name: ") + "index");
|
|
1174
|
+
}
|
|
1175
|
+
let i = -1;
|
|
1176
|
+
return filter((_arg) => {
|
|
1177
|
+
i = ((i + 1) | 0);
|
|
1178
|
+
return i !== index;
|
|
1179
|
+
}, xs);
|
|
1180
|
+
}
|
|
1181
|
+
function removeManyAt(index, count, xs) {
|
|
1182
|
+
let i = -1;
|
|
1183
|
+
let status = -1;
|
|
1184
|
+
const ys = filter((_arg) => {
|
|
1185
|
+
i = ((i + 1) | 0);
|
|
1186
|
+
if (i === index) {
|
|
1187
|
+
status = 0;
|
|
1188
|
+
return false;
|
|
1189
|
+
}
|
|
1190
|
+
else if (i > index) {
|
|
1191
|
+
if (i < (index + count)) {
|
|
1192
|
+
return false;
|
|
1193
|
+
}
|
|
1194
|
+
else {
|
|
1195
|
+
status = 1;
|
|
1196
|
+
return true;
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
else {
|
|
1200
|
+
return true;
|
|
1201
|
+
}
|
|
1202
|
+
}, xs);
|
|
1203
|
+
const status_1 = (((status === 0) && ((i + 1) === (index + count))) ? 1 : status) | 0;
|
|
1204
|
+
if (status_1 < 1) {
|
|
1205
|
+
throw new Error((SR_indexOutOfBounds + "\\nParameter name: ") + ((status_1 < 0) ? "index" : "count"));
|
|
1206
|
+
}
|
|
1207
|
+
return ys;
|
|
1208
|
+
}
|
|
1209
|
+
function updateAt(index, y, xs, cons) {
|
|
1210
|
+
const len = xs.length | 0;
|
|
1211
|
+
if ((index < 0) ? true : (index >= len)) {
|
|
1212
|
+
throw new Error((SR_indexOutOfBounds + "\\nParameter name: ") + "index");
|
|
1213
|
+
}
|
|
1214
|
+
const target = Helpers_allocateArrayFromCons(cons, len);
|
|
1215
|
+
for (let i = 0; i <= (len - 1); i++) {
|
|
1216
|
+
setItem(target, i, (i === index) ? y : item(i, xs));
|
|
1217
|
+
}
|
|
1218
|
+
return target;
|
|
1219
|
+
}
|
|
1220
|
+
function resize(xs, newSize, zero, cons) {
|
|
1221
|
+
let array, array_1, start_2, count_2;
|
|
1222
|
+
if (newSize < 0) {
|
|
1223
|
+
throw new Error("The input must be non-negative.\\nParameter name: newSize");
|
|
1224
|
+
}
|
|
1225
|
+
const zero_1 = defaultArg(zero, defaultOf());
|
|
1226
|
+
if (xs.contents == null) {
|
|
1227
|
+
xs.contents = ((array = Helpers_allocateArrayFromCons(cons, newSize), array.fill(zero_1, 0, (0 + newSize))));
|
|
1228
|
+
}
|
|
1229
|
+
else {
|
|
1230
|
+
const len = xs.contents.length | 0;
|
|
1231
|
+
if (newSize < len) {
|
|
1232
|
+
xs.contents = ((array_1 = xs.contents, array_1.slice(0, (0 + newSize))));
|
|
1233
|
+
}
|
|
1234
|
+
else if (newSize > len) {
|
|
1235
|
+
const target = Helpers_allocateArrayFromCons(cons, newSize);
|
|
1236
|
+
if (len > 0) {
|
|
1237
|
+
copyTo(xs.contents, 0, target, 0, len);
|
|
1238
|
+
}
|
|
1239
|
+
xs.contents = ((start_2 = (len | 0), (count_2 = ((newSize - len) | 0), target.fill(zero_1, start_2, (start_2 + count_2)))));
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
353
1243
|
|
|
354
|
-
export { addInPlace, addRangeInPlace, append, choose, collect, concat, contains, equalsWith, fill, fold, foldBack, forAll, head, indexOf, initialize, insertRangeInPlace, item, iterateIndexed, map, map3, mapIndexed, removeInPlace, setItem, singleton, skip, sortBy, sortDescending, tail, transpose, tryFind, tryFindIndex, tryHead, tryItem, tryPick, unzip };
|
|
1244
|
+
export { addInPlace, addRangeInPlace, allPairs, append, average, averageBy, choose, chunkBySize, collect, compareTo, compareWith, concat, contains, copy, copyTo, empty, equalsWith, exactlyOne, exists, exists2, existsOffset, existsOffset2, fill, filter, find, findBack, findIndex, findIndexBack, findLastIndex, fold, fold2, foldBack, foldBack2, foldBackIndexed, foldBackIndexed2, foldIndexed, foldIndexed2, forAll, forAll2, getSubArray, head, indexOf, indexed, initialize, insertAt, insertManyAt, insertRangeInPlace, isEmpty, item, iterate, iterate2, iterateIndexed, iterateIndexed2, last, map, map2, map3, mapFold, mapFoldBack, mapIndexed, mapIndexed2, mapIndexed3, max, maxBy, min, minBy, pairwise, partition, permute, pick, reduce, reduceBack, removeAllInPlace, removeAt, removeInPlace, removeManyAt, replicate, resize, reverse, scan, scanBack, setItem, setSlice, singleton, skip, skipWhile, sort, sortBy, sortByDescending, sortDescending, sortInPlace, sortInPlaceBy, sortWith, splitAt, splitInto, sum, sumBy, tail, take, takeWhile, transpose, truncate, tryExactlyOne, tryFind, tryFindBack, tryFindIndex, tryFindIndexBack, tryHead, tryItem, tryLast, tryPick, unfold, unzip, unzip3, updateAt, where, windowed, zip, zip3 };
|