@nshiab/simple-data-analysis-core 2.0.9 → 2.1.0
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/esm/class/SDAError.d.ts +6 -6
- package/esm/class/SDAError.js +6 -6
- package/esm/class/Simple.d.ts +9 -9
- package/esm/class/Simple.js +9 -9
- package/esm/class/SimpleDB.d.ts +80 -76
- package/esm/class/SimpleDB.d.ts.map +1 -1
- package/esm/class/SimpleDB.js +80 -76
- package/esm/class/SimpleTable.d.ts +2795 -1139
- package/esm/class/SimpleTable.d.ts.map +1 -1
- package/esm/class/SimpleTable.js +2781 -1149
- package/esm/helpers/buildApproximateMutualReachabilityMst.d.ts +45 -0
- package/esm/helpers/buildApproximateMutualReachabilityMst.d.ts.map +1 -0
- package/esm/helpers/buildApproximateMutualReachabilityMst.js +212 -0
- package/esm/helpers/buildChronologicalGraphComponentsSql.d.ts +14 -0
- package/esm/helpers/buildChronologicalGraphComponentsSql.d.ts.map +1 -0
- package/esm/helpers/buildChronologicalGraphComponentsSql.js +167 -0
- package/esm/helpers/buildExactMutualReachabilityMst.d.ts +28 -0
- package/esm/helpers/buildExactMutualReachabilityMst.d.ts.map +1 -0
- package/esm/helpers/buildExactMutualReachabilityMst.js +97 -0
- package/esm/helpers/buildGraphTemporalCostStateSql.d.ts +12 -0
- package/esm/helpers/buildGraphTemporalCostStateSql.d.ts.map +1 -0
- package/esm/helpers/buildGraphTemporalCostStateSql.js +86 -0
- package/esm/helpers/buildGraphTemporalReachabilitySql.d.ts +13 -0
- package/esm/helpers/buildGraphTemporalReachabilitySql.d.ts.map +1 -0
- package/esm/helpers/buildGraphTemporalReachabilitySql.js +70 -0
- package/esm/helpers/buildSparseMutualReachabilityMst.d.ts +10 -0
- package/esm/helpers/buildSparseMutualReachabilityMst.d.ts.map +1 -0
- package/esm/helpers/buildSparseMutualReachabilityMst.js +47 -0
- package/esm/helpers/buildUmapGraph.d.ts +2 -5
- package/esm/helpers/buildUmapGraph.d.ts.map +1 -1
- package/esm/helpers/buildUmapGraph.js +6 -100
- package/esm/helpers/buildVectorNeighbors.d.ts +45 -0
- package/esm/helpers/buildVectorNeighbors.d.ts.map +1 -0
- package/esm/helpers/buildVectorNeighbors.js +170 -0
- package/esm/helpers/buildWeakGraphComponentsSql.d.ts +3 -0
- package/esm/helpers/buildWeakGraphComponentsSql.d.ts.map +1 -0
- package/esm/helpers/buildWeakGraphComponentsSql.js +32 -0
- package/esm/helpers/camelCase.d.ts +7 -5
- package/esm/helpers/camelCase.d.ts.map +1 -1
- package/esm/helpers/camelCase.js +7 -5
- package/esm/helpers/capitalize.d.ts +6 -4
- package/esm/helpers/capitalize.d.ts.map +1 -1
- package/esm/helpers/capitalize.js +6 -4
- package/esm/helpers/clusterHdbscan.d.ts +18 -0
- package/esm/helpers/clusterHdbscan.d.ts.map +1 -0
- package/esm/helpers/clusterHdbscan.js +342 -0
- package/esm/helpers/computeCovariance.d.ts +16 -0
- package/esm/helpers/computeCovariance.d.ts.map +1 -0
- package/esm/helpers/computeCovariance.js +99 -0
- package/esm/helpers/computeMahalanobisDistances.d.ts +14 -0
- package/esm/helpers/computeMahalanobisDistances.d.ts.map +1 -0
- package/esm/helpers/computeMahalanobisDistances.js +87 -0
- package/esm/helpers/createDirectory.d.ts +4 -3
- package/esm/helpers/createDirectory.d.ts.map +1 -1
- package/esm/helpers/createDirectory.js +4 -3
- package/esm/helpers/dataToArrays.d.ts +6 -4
- package/esm/helpers/dataToArrays.d.ts.map +1 -1
- package/esm/helpers/dataToArrays.js +6 -4
- package/esm/helpers/extractTypes.d.ts +1 -1
- package/esm/helpers/extractTypes.js +4 -9
- package/esm/helpers/factorCovariance.d.ts +17 -0
- package/esm/helpers/factorCovariance.d.ts.map +1 -0
- package/esm/helpers/factorCovariance.js +189 -0
- package/esm/helpers/findGeoColumn.d.ts +6 -4
- package/esm/helpers/findGeoColumn.d.ts.map +1 -1
- package/esm/helpers/findGeoColumn.js +6 -4
- package/esm/helpers/findGeoColumnFromSchema.d.ts +8 -5
- package/esm/helpers/findGeoColumnFromSchema.d.ts.map +1 -1
- package/esm/helpers/findGeoColumnFromSchema.js +8 -5
- package/esm/helpers/formatDate.d.ts +12 -6
- package/esm/helpers/formatDate.d.ts.map +1 -1
- package/esm/helpers/formatDate.js +12 -6
- package/esm/helpers/formatMissingTables.d.ts +8 -5
- package/esm/helpers/formatMissingTables.d.ts.map +1 -1
- package/esm/helpers/formatMissingTables.js +8 -5
- package/esm/helpers/formatNumber.d.ts +19 -10
- package/esm/helpers/formatNumber.d.ts.map +1 -1
- package/esm/helpers/formatNumber.js +32 -17
- package/esm/helpers/getGraphEdgeIdColumn.d.ts +9 -0
- package/esm/helpers/getGraphEdgeIdColumn.d.ts.map +1 -0
- package/esm/helpers/getGraphEdgeIdColumn.js +25 -0
- package/esm/helpers/getGraphEndpointColumns.d.ts +11 -0
- package/esm/helpers/getGraphEndpointColumns.d.ts.map +1 -0
- package/esm/helpers/getGraphEndpointColumns.js +160 -0
- package/esm/helpers/getGraphWeightColumn.d.ts +10 -0
- package/esm/helpers/getGraphWeightColumn.d.ts.map +1 -0
- package/esm/helpers/getGraphWeightColumn.js +40 -0
- package/esm/helpers/graphRouteResultSchema.d.ts +4 -0
- package/esm/helpers/graphRouteResultSchema.d.ts.map +1 -0
- package/esm/helpers/graphRouteResultSchema.js +12 -0
- package/esm/helpers/graphRouteResultSelect.d.ts +4 -0
- package/esm/helpers/graphRouteResultSelect.d.ts.map +1 -0
- package/esm/helpers/graphRouteResultSelect.js +22 -0
- package/esm/helpers/hasGeometryColumn.d.ts +4 -3
- package/esm/helpers/hasGeometryColumn.d.ts.map +1 -1
- package/esm/helpers/hasGeometryColumn.js +4 -3
- package/esm/helpers/inspectGraphConnectivity.d.ts +10 -0
- package/esm/helpers/inspectGraphConnectivity.d.ts.map +1 -0
- package/esm/helpers/inspectGraphConnectivity.js +55 -0
- package/esm/helpers/mergeOptions.d.ts +24 -13
- package/esm/helpers/mergeOptions.d.ts.map +1 -1
- package/esm/helpers/mergeOptions.js +24 -13
- package/esm/helpers/parseValue.d.ts +6 -4
- package/esm/helpers/parseValue.d.ts.map +1 -1
- package/esm/helpers/parseValue.js +6 -4
- package/esm/helpers/prepareGraphRouteSql.d.ts +31 -0
- package/esm/helpers/prepareGraphRouteSql.d.ts.map +1 -0
- package/esm/helpers/prepareGraphRouteSql.js +86 -0
- package/esm/helpers/prepareGraphStarts.d.ts +9 -0
- package/esm/helpers/prepareGraphStarts.d.ts.map +1 -0
- package/esm/helpers/prepareGraphStarts.js +68 -0
- package/esm/helpers/prepareGraphTemporalSql.d.ts +28 -0
- package/esm/helpers/prepareGraphTemporalSql.d.ts.map +1 -0
- package/esm/helpers/prepareGraphTemporalSql.js +154 -0
- package/esm/helpers/prepareGraphTraversal.d.ts +19 -0
- package/esm/helpers/prepareGraphTraversal.d.ts.map +1 -0
- package/esm/helpers/prepareGraphTraversal.js +79 -0
- package/esm/helpers/prepareNumericFeatures.d.ts +41 -0
- package/esm/helpers/prepareNumericFeatures.d.ts.map +1 -0
- package/esm/helpers/prepareNumericFeatures.js +210 -0
- package/esm/helpers/prettyDuration.d.ts +14 -8
- package/esm/helpers/prettyDuration.d.ts.map +1 -1
- package/esm/helpers/prettyDuration.js +14 -8
- package/esm/helpers/printTable.d.ts +18 -13
- package/esm/helpers/printTable.d.ts.map +1 -1
- package/esm/helpers/printTable.js +18 -13
- package/esm/helpers/publishPreparedColumns.d.ts +37 -0
- package/esm/helpers/publishPreparedColumns.d.ts.map +1 -0
- package/esm/helpers/publishPreparedColumns.js +113 -0
- package/esm/helpers/queryDB.d.ts +24 -13
- package/esm/helpers/queryDB.d.ts.map +1 -1
- package/esm/helpers/queryDB.js +24 -13
- package/esm/helpers/queueAsyncBarrier.d.ts +12 -7
- package/esm/helpers/queueAsyncBarrier.d.ts.map +1 -1
- package/esm/helpers/queueAsyncBarrier.js +12 -7
- package/esm/helpers/queueGraphResult.d.ts +18 -0
- package/esm/helpers/queueGraphResult.d.ts.map +1 -0
- package/esm/helpers/queueGraphResult.js +39 -0
- package/esm/helpers/quoteIdentifier.d.ts +4 -3
- package/esm/helpers/quoteIdentifier.d.ts.map +1 -1
- package/esm/helpers/quoteIdentifier.js +4 -3
- package/esm/helpers/quoteQualifiedIdentifier.d.ts +6 -4
- package/esm/helpers/quoteQualifiedIdentifier.d.ts.map +1 -1
- package/esm/helpers/quoteQualifiedIdentifier.js +6 -4
- package/esm/helpers/runQuery.d.ts.map +1 -1
- package/esm/helpers/runQuery.js +17 -3
- package/esm/helpers/selectFuzzyReplacements.d.ts +11 -0
- package/esm/helpers/selectFuzzyReplacements.d.ts.map +1 -0
- package/esm/helpers/selectFuzzyReplacements.js +124 -0
- package/esm/helpers/stabilizeCosineVectors.d.ts +14 -0
- package/esm/helpers/stabilizeCosineVectors.d.ts.map +1 -0
- package/esm/helpers/stabilizeCosineVectors.js +34 -0
- package/esm/helpers/stringToArray.d.ts +4 -3
- package/esm/helpers/stringToArray.d.ts.map +1 -1
- package/esm/helpers/stringToArray.js +4 -3
- package/esm/helpers/updateColumnsWithJS.d.ts +12 -6
- package/esm/helpers/updateColumnsWithJS.d.ts.map +1 -1
- package/esm/helpers/updateColumnsWithJS.js +12 -6
- package/esm/helpers/validateGraphRouteResultSchema.d.ts +4 -0
- package/esm/helpers/validateGraphRouteResultSchema.d.ts.map +1 -0
- package/esm/helpers/validateGraphRouteResultSchema.js +13 -0
- package/esm/helpers/validateGraphTemporalEvents.d.ts +7 -0
- package/esm/helpers/validateGraphTemporalEvents.d.ts.map +1 -0
- package/esm/helpers/validateGraphTemporalEvents.js +47 -0
- package/esm/helpers/validateNumericalAnalysis.d.ts +10 -6
- package/esm/helpers/validateNumericalAnalysis.d.ts.map +1 -1
- package/esm/helpers/validateNumericalAnalysis.js +10 -6
- package/esm/helpers/validateVectorRowIds.d.ts +4 -0
- package/esm/helpers/validateVectorRowIds.d.ts.map +1 -0
- package/esm/helpers/validateVectorRowIds.js +16 -0
- package/esm/helpers/vectorDistanceExpression.d.ts +6 -0
- package/esm/helpers/vectorDistanceExpression.d.ts.map +1 -0
- package/esm/helpers/vectorDistanceExpression.js +11 -0
- package/esm/helpers/wrapString.d.ts +10 -7
- package/esm/helpers/wrapString.d.ts.map +1 -1
- package/esm/helpers/wrapString.js +10 -7
- package/esm/methods/addId.d.ts +5 -0
- package/esm/methods/addId.d.ts.map +1 -0
- package/esm/methods/addId.js +38 -0
- package/esm/methods/commonNeighbors.d.ts +10 -0
- package/esm/methods/commonNeighbors.d.ts.map +1 -0
- package/esm/methods/commonNeighbors.js +101 -0
- package/esm/methods/connectedComponents.d.ts +9 -0
- package/esm/methods/connectedComponents.d.ts.map +1 -0
- package/esm/methods/connectedComponents.js +147 -0
- package/esm/methods/degree.d.ts +9 -0
- package/esm/methods/degree.d.ts.map +1 -0
- package/esm/methods/degree.js +135 -0
- package/esm/methods/distances.d.ts +12 -0
- package/esm/methods/distances.d.ts.map +1 -0
- package/esm/methods/distances.js +164 -0
- package/esm/methods/findCycles.d.ts +12 -0
- package/esm/methods/findCycles.d.ts.map +1 -0
- package/esm/methods/findCycles.js +330 -0
- package/esm/methods/fuzzyClean.d.ts.map +1 -1
- package/esm/methods/fuzzyClean.js +17 -136
- package/esm/methods/fuzzyJoin.js +70 -16
- package/esm/methods/getTypes.d.ts +1 -1
- package/esm/methods/hdbscan.d.ts +5 -0
- package/esm/methods/hdbscan.d.ts.map +1 -0
- package/esm/methods/hdbscan.js +208 -0
- package/esm/methods/mahalanobis.d.ts +5 -0
- package/esm/methods/mahalanobis.d.ts.map +1 -0
- package/esm/methods/mahalanobis.js +92 -0
- package/esm/methods/neighbors.d.ts +9 -0
- package/esm/methods/neighbors.d.ts.map +1 -0
- package/esm/methods/neighbors.js +81 -0
- package/esm/methods/normalizeVector.d.ts +5 -0
- package/esm/methods/normalizeVector.d.ts.map +1 -0
- package/esm/methods/normalizeVector.js +132 -0
- package/esm/methods/paths.d.ts +12 -0
- package/esm/methods/paths.d.ts.map +1 -0
- package/esm/methods/paths.js +287 -0
- package/esm/methods/reachable.d.ts +11 -0
- package/esm/methods/reachable.d.ts.map +1 -0
- package/esm/methods/reachable.js +131 -0
- package/esm/methods/rowToVector.d.ts +5 -0
- package/esm/methods/rowToVector.d.ts.map +1 -0
- package/esm/methods/rowToVector.js +77 -0
- package/esm/methods/shortestPath.d.ts +12 -0
- package/esm/methods/shortestPath.d.ts.map +1 -0
- package/esm/methods/shortestPath.js +337 -0
- package/esm/methods/topologicalSort.d.ts +7 -0
- package/esm/methods/topologicalSort.d.ts.map +1 -0
- package/esm/methods/topologicalSort.js +164 -0
- package/llm.md +2106 -143
- package/llms.txt +1 -1
- package/package.json +1 -1
- package/script/class/SDAError.d.ts +6 -6
- package/script/class/SDAError.js +6 -6
- package/script/class/Simple.d.ts +9 -9
- package/script/class/Simple.js +9 -9
- package/script/class/SimpleDB.d.ts +80 -76
- package/script/class/SimpleDB.d.ts.map +1 -1
- package/script/class/SimpleDB.js +80 -76
- package/script/class/SimpleTable.d.ts +2795 -1139
- package/script/class/SimpleTable.d.ts.map +1 -1
- package/script/class/SimpleTable.js +2781 -1149
- package/script/helpers/buildApproximateMutualReachabilityMst.d.ts +45 -0
- package/script/helpers/buildApproximateMutualReachabilityMst.d.ts.map +1 -0
- package/script/helpers/buildApproximateMutualReachabilityMst.js +219 -0
- package/script/helpers/buildChronologicalGraphComponentsSql.d.ts +14 -0
- package/script/helpers/buildChronologicalGraphComponentsSql.d.ts.map +1 -0
- package/script/helpers/buildChronologicalGraphComponentsSql.js +174 -0
- package/script/helpers/buildExactMutualReachabilityMst.d.ts +28 -0
- package/script/helpers/buildExactMutualReachabilityMst.d.ts.map +1 -0
- package/script/helpers/buildExactMutualReachabilityMst.js +103 -0
- package/script/helpers/buildGraphTemporalCostStateSql.d.ts +12 -0
- package/script/helpers/buildGraphTemporalCostStateSql.d.ts.map +1 -0
- package/script/helpers/buildGraphTemporalCostStateSql.js +92 -0
- package/script/helpers/buildGraphTemporalReachabilitySql.d.ts +13 -0
- package/script/helpers/buildGraphTemporalReachabilitySql.d.ts.map +1 -0
- package/script/helpers/buildGraphTemporalReachabilitySql.js +76 -0
- package/script/helpers/buildSparseMutualReachabilityMst.d.ts +10 -0
- package/script/helpers/buildSparseMutualReachabilityMst.d.ts.map +1 -0
- package/script/helpers/buildSparseMutualReachabilityMst.js +50 -0
- package/script/helpers/buildUmapGraph.d.ts +2 -5
- package/script/helpers/buildUmapGraph.d.ts.map +1 -1
- package/script/helpers/buildUmapGraph.js +6 -100
- package/script/helpers/buildVectorNeighbors.d.ts +45 -0
- package/script/helpers/buildVectorNeighbors.d.ts.map +1 -0
- package/script/helpers/buildVectorNeighbors.js +176 -0
- package/script/helpers/buildWeakGraphComponentsSql.d.ts +3 -0
- package/script/helpers/buildWeakGraphComponentsSql.d.ts.map +1 -0
- package/script/helpers/buildWeakGraphComponentsSql.js +38 -0
- package/script/helpers/camelCase.d.ts +7 -5
- package/script/helpers/camelCase.d.ts.map +1 -1
- package/script/helpers/camelCase.js +7 -5
- package/script/helpers/capitalize.d.ts +6 -4
- package/script/helpers/capitalize.d.ts.map +1 -1
- package/script/helpers/capitalize.js +6 -4
- package/script/helpers/clusterHdbscan.d.ts +18 -0
- package/script/helpers/clusterHdbscan.d.ts.map +1 -0
- package/script/helpers/clusterHdbscan.js +346 -0
- package/script/helpers/computeCovariance.d.ts +16 -0
- package/script/helpers/computeCovariance.d.ts.map +1 -0
- package/script/helpers/computeCovariance.js +105 -0
- package/script/helpers/computeMahalanobisDistances.d.ts +14 -0
- package/script/helpers/computeMahalanobisDistances.d.ts.map +1 -0
- package/script/helpers/computeMahalanobisDistances.js +93 -0
- package/script/helpers/createDirectory.d.ts +4 -3
- package/script/helpers/createDirectory.d.ts.map +1 -1
- package/script/helpers/createDirectory.js +4 -3
- package/script/helpers/dataToArrays.d.ts +6 -4
- package/script/helpers/dataToArrays.d.ts.map +1 -1
- package/script/helpers/dataToArrays.js +6 -4
- package/script/helpers/extractTypes.d.ts +1 -1
- package/script/helpers/extractTypes.js +4 -9
- package/script/helpers/factorCovariance.d.ts +17 -0
- package/script/helpers/factorCovariance.d.ts.map +1 -0
- package/script/helpers/factorCovariance.js +194 -0
- package/script/helpers/findGeoColumn.d.ts +6 -4
- package/script/helpers/findGeoColumn.d.ts.map +1 -1
- package/script/helpers/findGeoColumn.js +6 -4
- package/script/helpers/findGeoColumnFromSchema.d.ts +8 -5
- package/script/helpers/findGeoColumnFromSchema.d.ts.map +1 -1
- package/script/helpers/findGeoColumnFromSchema.js +8 -5
- package/script/helpers/formatDate.d.ts +12 -6
- package/script/helpers/formatDate.d.ts.map +1 -1
- package/script/helpers/formatDate.js +12 -6
- package/script/helpers/formatMissingTables.d.ts +8 -5
- package/script/helpers/formatMissingTables.d.ts.map +1 -1
- package/script/helpers/formatMissingTables.js +8 -5
- package/script/helpers/formatNumber.d.ts +19 -10
- package/script/helpers/formatNumber.d.ts.map +1 -1
- package/script/helpers/formatNumber.js +32 -17
- package/script/helpers/getGraphEdgeIdColumn.d.ts +9 -0
- package/script/helpers/getGraphEdgeIdColumn.d.ts.map +1 -0
- package/script/helpers/getGraphEdgeIdColumn.js +31 -0
- package/script/helpers/getGraphEndpointColumns.d.ts +11 -0
- package/script/helpers/getGraphEndpointColumns.d.ts.map +1 -0
- package/script/helpers/getGraphEndpointColumns.js +166 -0
- package/script/helpers/getGraphWeightColumn.d.ts +10 -0
- package/script/helpers/getGraphWeightColumn.d.ts.map +1 -0
- package/script/helpers/getGraphWeightColumn.js +46 -0
- package/script/helpers/graphRouteResultSchema.d.ts +4 -0
- package/script/helpers/graphRouteResultSchema.d.ts.map +1 -0
- package/script/helpers/graphRouteResultSchema.js +18 -0
- package/script/helpers/graphRouteResultSelect.d.ts +4 -0
- package/script/helpers/graphRouteResultSelect.d.ts.map +1 -0
- package/script/helpers/graphRouteResultSelect.js +28 -0
- package/script/helpers/hasGeometryColumn.d.ts +4 -3
- package/script/helpers/hasGeometryColumn.d.ts.map +1 -1
- package/script/helpers/hasGeometryColumn.js +4 -3
- package/script/helpers/inspectGraphConnectivity.d.ts +10 -0
- package/script/helpers/inspectGraphConnectivity.d.ts.map +1 -0
- package/script/helpers/inspectGraphConnectivity.js +58 -0
- package/script/helpers/mergeOptions.d.ts +24 -13
- package/script/helpers/mergeOptions.d.ts.map +1 -1
- package/script/helpers/mergeOptions.js +24 -13
- package/script/helpers/parseValue.d.ts +6 -4
- package/script/helpers/parseValue.d.ts.map +1 -1
- package/script/helpers/parseValue.js +6 -4
- package/script/helpers/prepareGraphRouteSql.d.ts +31 -0
- package/script/helpers/prepareGraphRouteSql.d.ts.map +1 -0
- package/script/helpers/prepareGraphRouteSql.js +127 -0
- package/script/helpers/prepareGraphStarts.d.ts +9 -0
- package/script/helpers/prepareGraphStarts.d.ts.map +1 -0
- package/script/helpers/prepareGraphStarts.js +71 -0
- package/script/helpers/prepareGraphTemporalSql.d.ts +28 -0
- package/script/helpers/prepareGraphTemporalSql.d.ts.map +1 -0
- package/script/helpers/prepareGraphTemporalSql.js +161 -0
- package/script/helpers/prepareGraphTraversal.d.ts +19 -0
- package/script/helpers/prepareGraphTraversal.d.ts.map +1 -0
- package/script/helpers/prepareGraphTraversal.js +87 -0
- package/script/helpers/prepareNumericFeatures.d.ts +41 -0
- package/script/helpers/prepareNumericFeatures.d.ts.map +1 -0
- package/script/helpers/prepareNumericFeatures.js +217 -0
- package/script/helpers/prettyDuration.d.ts +14 -8
- package/script/helpers/prettyDuration.d.ts.map +1 -1
- package/script/helpers/prettyDuration.js +14 -8
- package/script/helpers/printTable.d.ts +18 -13
- package/script/helpers/printTable.d.ts.map +1 -1
- package/script/helpers/printTable.js +18 -13
- package/script/helpers/publishPreparedColumns.d.ts +37 -0
- package/script/helpers/publishPreparedColumns.d.ts.map +1 -0
- package/script/helpers/publishPreparedColumns.js +119 -0
- package/script/helpers/queryDB.d.ts +24 -13
- package/script/helpers/queryDB.d.ts.map +1 -1
- package/script/helpers/queryDB.js +24 -13
- package/script/helpers/queueAsyncBarrier.d.ts +12 -7
- package/script/helpers/queueAsyncBarrier.d.ts.map +1 -1
- package/script/helpers/queueAsyncBarrier.js +12 -7
- package/script/helpers/queueGraphResult.d.ts +18 -0
- package/script/helpers/queueGraphResult.d.ts.map +1 -0
- package/script/helpers/queueGraphResult.js +45 -0
- package/script/helpers/quoteIdentifier.d.ts +4 -3
- package/script/helpers/quoteIdentifier.d.ts.map +1 -1
- package/script/helpers/quoteIdentifier.js +4 -3
- package/script/helpers/quoteQualifiedIdentifier.d.ts +6 -4
- package/script/helpers/quoteQualifiedIdentifier.d.ts.map +1 -1
- package/script/helpers/quoteQualifiedIdentifier.js +6 -4
- package/script/helpers/runQuery.d.ts.map +1 -1
- package/script/helpers/runQuery.js +17 -3
- package/script/helpers/selectFuzzyReplacements.d.ts +11 -0
- package/script/helpers/selectFuzzyReplacements.d.ts.map +1 -0
- package/script/helpers/selectFuzzyReplacements.js +127 -0
- package/script/helpers/stabilizeCosineVectors.d.ts +14 -0
- package/script/helpers/stabilizeCosineVectors.d.ts.map +1 -0
- package/script/helpers/stabilizeCosineVectors.js +40 -0
- package/script/helpers/stringToArray.d.ts +4 -3
- package/script/helpers/stringToArray.d.ts.map +1 -1
- package/script/helpers/stringToArray.js +4 -3
- package/script/helpers/updateColumnsWithJS.d.ts +12 -6
- package/script/helpers/updateColumnsWithJS.d.ts.map +1 -1
- package/script/helpers/updateColumnsWithJS.js +12 -6
- package/script/helpers/validateGraphRouteResultSchema.d.ts +4 -0
- package/script/helpers/validateGraphRouteResultSchema.d.ts.map +1 -0
- package/script/helpers/validateGraphRouteResultSchema.js +19 -0
- package/script/helpers/validateGraphTemporalEvents.d.ts +7 -0
- package/script/helpers/validateGraphTemporalEvents.d.ts.map +1 -0
- package/script/helpers/validateGraphTemporalEvents.js +53 -0
- package/script/helpers/validateNumericalAnalysis.d.ts +10 -6
- package/script/helpers/validateNumericalAnalysis.d.ts.map +1 -1
- package/script/helpers/validateNumericalAnalysis.js +10 -6
- package/script/helpers/validateVectorRowIds.d.ts +4 -0
- package/script/helpers/validateVectorRowIds.d.ts.map +1 -0
- package/script/helpers/validateVectorRowIds.js +19 -0
- package/script/helpers/vectorDistanceExpression.d.ts +6 -0
- package/script/helpers/vectorDistanceExpression.d.ts.map +1 -0
- package/script/helpers/vectorDistanceExpression.js +14 -0
- package/script/helpers/wrapString.d.ts +10 -7
- package/script/helpers/wrapString.d.ts.map +1 -1
- package/script/helpers/wrapString.js +10 -7
- package/script/methods/addId.d.ts +5 -0
- package/script/methods/addId.d.ts.map +1 -0
- package/script/methods/addId.js +44 -0
- package/script/methods/commonNeighbors.d.ts +10 -0
- package/script/methods/commonNeighbors.d.ts.map +1 -0
- package/script/methods/commonNeighbors.js +140 -0
- package/script/methods/connectedComponents.d.ts +9 -0
- package/script/methods/connectedComponents.d.ts.map +1 -0
- package/script/methods/connectedComponents.js +186 -0
- package/script/methods/degree.d.ts +9 -0
- package/script/methods/degree.d.ts.map +1 -0
- package/script/methods/degree.js +141 -0
- package/script/methods/distances.d.ts +12 -0
- package/script/methods/distances.d.ts.map +1 -0
- package/script/methods/distances.js +203 -0
- package/script/methods/findCycles.d.ts +12 -0
- package/script/methods/findCycles.d.ts.map +1 -0
- package/script/methods/findCycles.js +369 -0
- package/script/methods/fuzzyClean.d.ts.map +1 -1
- package/script/methods/fuzzyClean.js +17 -136
- package/script/methods/fuzzyJoin.js +70 -16
- package/script/methods/getTypes.d.ts +1 -1
- package/script/methods/hdbscan.d.ts +5 -0
- package/script/methods/hdbscan.d.ts.map +1 -0
- package/script/methods/hdbscan.js +214 -0
- package/script/methods/mahalanobis.d.ts +5 -0
- package/script/methods/mahalanobis.d.ts.map +1 -0
- package/script/methods/mahalanobis.js +98 -0
- package/script/methods/neighbors.d.ts +9 -0
- package/script/methods/neighbors.d.ts.map +1 -0
- package/script/methods/neighbors.js +120 -0
- package/script/methods/normalizeVector.d.ts +5 -0
- package/script/methods/normalizeVector.d.ts.map +1 -0
- package/script/methods/normalizeVector.js +138 -0
- package/script/methods/paths.d.ts +12 -0
- package/script/methods/paths.d.ts.map +1 -0
- package/script/methods/paths.js +326 -0
- package/script/methods/reachable.d.ts +11 -0
- package/script/methods/reachable.d.ts.map +1 -0
- package/script/methods/reachable.js +170 -0
- package/script/methods/rowToVector.d.ts +5 -0
- package/script/methods/rowToVector.d.ts.map +1 -0
- package/script/methods/rowToVector.js +83 -0
- package/script/methods/shortestPath.d.ts +12 -0
- package/script/methods/shortestPath.d.ts.map +1 -0
- package/script/methods/shortestPath.js +376 -0
- package/script/methods/topologicalSort.d.ts +7 -0
- package/script/methods/topologicalSort.d.ts.map +1 -0
- package/script/methods/topologicalSort.js +170 -0
|
@@ -8,11 +8,6 @@ const quoteIdentifier_js_1 = __importDefault(require("./quoteIdentifier.js"));
|
|
|
8
8
|
/**
|
|
9
9
|
* Returns the only geometry column in a table schema.
|
|
10
10
|
*
|
|
11
|
-
* @param types - The table schema to inspect.
|
|
12
|
-
* @param method - The SDA method requesting a geometry column.
|
|
13
|
-
* @param tableName - The name of the table represented by the schema.
|
|
14
|
-
* @returns The name of the only geometry column.
|
|
15
|
-
*
|
|
16
11
|
* @example
|
|
17
12
|
* ```ts
|
|
18
13
|
* const column = findGeoColumnFromSchema(
|
|
@@ -21,6 +16,14 @@ const quoteIdentifier_js_1 = __importDefault(require("./quoteIdentifier.js"));
|
|
|
21
16
|
* "places",
|
|
22
17
|
* );
|
|
23
18
|
* ```
|
|
19
|
+
*
|
|
20
|
+
* @param types - The table schema to inspect.
|
|
21
|
+
*
|
|
22
|
+
* @param method - The SDA method requesting a geometry column.
|
|
23
|
+
*
|
|
24
|
+
* @param tableName - The name of the table represented by the schema.
|
|
25
|
+
*
|
|
26
|
+
* @returns The name of the only geometry column.
|
|
24
27
|
*/
|
|
25
28
|
function findGeoColumnFromSchema(types, method, tableName) {
|
|
26
29
|
const geometryColumns = Object.keys(types).filter((column) => types[column].toLowerCase().includes("geometry")).sort();
|
|
@@ -2,12 +2,6 @@
|
|
|
2
2
|
* Formats a `Date` object into a human-readable string using only the format
|
|
3
3
|
* strings actually used in the project.
|
|
4
4
|
*
|
|
5
|
-
* @param date - The `Date` object to format.
|
|
6
|
-
* @param format - The format string to use. Only `"Month DD, YYYY, at HH:MM period"` and `"Month DD"` are supported.
|
|
7
|
-
* @param options - Optional settings.
|
|
8
|
-
* @param options.utc - If `true`, format the date in UTC instead of local time. Defaults to `false`.
|
|
9
|
-
* @returns The formatted date string.
|
|
10
|
-
*
|
|
11
5
|
* @example
|
|
12
6
|
* ```ts
|
|
13
7
|
* // Format a date with time (local time).
|
|
@@ -15,18 +9,30 @@
|
|
|
15
9
|
* const formatted = formatDate(date, "Month DD, YYYY, at HH:MM period");
|
|
16
10
|
* console.log(formatted); // "January 1, 2023, at 1:35 a.m."
|
|
17
11
|
* ```
|
|
12
|
+
*
|
|
18
13
|
* @example
|
|
19
14
|
* ```ts
|
|
20
15
|
* // Format a date as month and day only (UTC).
|
|
21
16
|
* const formatted = formatDate(new Date("2023-01-01"), "Month DD", { utc: true });
|
|
22
17
|
* console.log(formatted); // "January 1"
|
|
23
18
|
* ```
|
|
19
|
+
*
|
|
24
20
|
* @example
|
|
25
21
|
* ```ts
|
|
26
22
|
* // Minutes of ":00" are omitted.
|
|
27
23
|
* const formatted = formatDate(new Date("2023-01-01T01:00:00"), "Month DD, YYYY, at HH:MM period", { utc: true });
|
|
28
24
|
* console.log(formatted); // "January 1, 2023, at 1 a.m."
|
|
29
25
|
* ```
|
|
26
|
+
*
|
|
27
|
+
* @param date - The `Date` object to format.
|
|
28
|
+
*
|
|
29
|
+
* @param format - The format string to use. Only `"Month DD, YYYY, at HH:MM period"` and `"Month DD"` are supported.
|
|
30
|
+
*
|
|
31
|
+
* @param options - Optional settings.
|
|
32
|
+
*
|
|
33
|
+
* @param options.utc - If `true`, format the date in UTC instead of local time. Defaults to `false`.
|
|
34
|
+
*
|
|
35
|
+
* @returns The formatted date string.
|
|
30
36
|
*/
|
|
31
37
|
export default function formatDate(date: Date, format: "Month DD, YYYY, at HH:MM period" | "Month DD", options?: {
|
|
32
38
|
utc?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatDate.d.ts","sourceRoot":"","sources":["../../src/helpers/formatDate.ts"],"names":[],"mappings":"AAeA
|
|
1
|
+
{"version":3,"file":"formatDate.d.ts","sourceRoot":"","sources":["../../src/helpers/formatDate.ts"],"names":[],"mappings":"AAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAChC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,iCAAiC,GAAG,UAAU,EACtD,OAAO,GAAE;IAAE,GAAG,CAAC,EAAE,OAAO,CAAA;CAAO,GAC9B,MAAM,CA2BR"}
|
|
@@ -19,12 +19,6 @@ const MONTHS = [
|
|
|
19
19
|
* Formats a `Date` object into a human-readable string using only the format
|
|
20
20
|
* strings actually used in the project.
|
|
21
21
|
*
|
|
22
|
-
* @param date - The `Date` object to format.
|
|
23
|
-
* @param format - The format string to use. Only `"Month DD, YYYY, at HH:MM period"` and `"Month DD"` are supported.
|
|
24
|
-
* @param options - Optional settings.
|
|
25
|
-
* @param options.utc - If `true`, format the date in UTC instead of local time. Defaults to `false`.
|
|
26
|
-
* @returns The formatted date string.
|
|
27
|
-
*
|
|
28
22
|
* @example
|
|
29
23
|
* ```ts
|
|
30
24
|
* // Format a date with time (local time).
|
|
@@ -32,18 +26,30 @@ const MONTHS = [
|
|
|
32
26
|
* const formatted = formatDate(date, "Month DD, YYYY, at HH:MM period");
|
|
33
27
|
* console.log(formatted); // "January 1, 2023, at 1:35 a.m."
|
|
34
28
|
* ```
|
|
29
|
+
*
|
|
35
30
|
* @example
|
|
36
31
|
* ```ts
|
|
37
32
|
* // Format a date as month and day only (UTC).
|
|
38
33
|
* const formatted = formatDate(new Date("2023-01-01"), "Month DD", { utc: true });
|
|
39
34
|
* console.log(formatted); // "January 1"
|
|
40
35
|
* ```
|
|
36
|
+
*
|
|
41
37
|
* @example
|
|
42
38
|
* ```ts
|
|
43
39
|
* // Minutes of ":00" are omitted.
|
|
44
40
|
* const formatted = formatDate(new Date("2023-01-01T01:00:00"), "Month DD, YYYY, at HH:MM period", { utc: true });
|
|
45
41
|
* console.log(formatted); // "January 1, 2023, at 1 a.m."
|
|
46
42
|
* ```
|
|
43
|
+
*
|
|
44
|
+
* @param date - The `Date` object to format.
|
|
45
|
+
*
|
|
46
|
+
* @param format - The format string to use. Only `"Month DD, YYYY, at HH:MM period"` and `"Month DD"` are supported.
|
|
47
|
+
*
|
|
48
|
+
* @param options - Optional settings.
|
|
49
|
+
*
|
|
50
|
+
* @param options.utc - If `true`, format the date in UTC instead of local time. Defaults to `false`.
|
|
51
|
+
*
|
|
52
|
+
* @returns The formatted date string.
|
|
47
53
|
*/
|
|
48
54
|
function formatDate(date, format, options = {}) {
|
|
49
55
|
const getFullYear = options.utc ? date.getUTCFullYear : date.getFullYear;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Formats a missing-table error with the requested and available table names.
|
|
3
3
|
*
|
|
4
|
-
* @param method - The SDA method looking up the tables.
|
|
5
|
-
* @param missingTables - The requested table names that were not found.
|
|
6
|
-
* @param availableTables - The table names currently available.
|
|
7
|
-
* @returns An actionable missing-table error message.
|
|
8
|
-
*
|
|
9
4
|
* @example
|
|
10
5
|
* ```ts
|
|
11
6
|
* const message = formatMissingTables(
|
|
@@ -14,6 +9,14 @@
|
|
|
14
9
|
* ["votes", "districts"],
|
|
15
10
|
* );
|
|
16
11
|
* ```
|
|
12
|
+
*
|
|
13
|
+
* @param method - The SDA method looking up the tables.
|
|
14
|
+
*
|
|
15
|
+
* @param missingTables - The requested table names that were not found.
|
|
16
|
+
*
|
|
17
|
+
* @param availableTables - The table names currently available.
|
|
18
|
+
*
|
|
19
|
+
* @returns An actionable missing-table error message.
|
|
17
20
|
*/
|
|
18
21
|
export default function formatMissingTables(method: string, missingTables: string[], availableTables: string[]): string;
|
|
19
22
|
//# sourceMappingURL=formatMissingTables.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatMissingTables.d.ts","sourceRoot":"","sources":["../../src/helpers/formatMissingTables.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"formatMissingTables.d.ts","sourceRoot":"","sources":["../../src/helpers/formatMissingTables.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CACzC,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,MAAM,EAAE,EACvB,eAAe,EAAE,MAAM,EAAE,GACxB,MAAM,CAUR"}
|
|
@@ -8,11 +8,6 @@ const quoteIdentifier_js_1 = __importDefault(require("./quoteIdentifier.js"));
|
|
|
8
8
|
/**
|
|
9
9
|
* Formats a missing-table error with the requested and available table names.
|
|
10
10
|
*
|
|
11
|
-
* @param method - The SDA method looking up the tables.
|
|
12
|
-
* @param missingTables - The requested table names that were not found.
|
|
13
|
-
* @param availableTables - The table names currently available.
|
|
14
|
-
* @returns An actionable missing-table error message.
|
|
15
|
-
*
|
|
16
11
|
* @example
|
|
17
12
|
* ```ts
|
|
18
13
|
* const message = formatMissingTables(
|
|
@@ -21,6 +16,14 @@ const quoteIdentifier_js_1 = __importDefault(require("./quoteIdentifier.js"));
|
|
|
21
16
|
* ["votes", "districts"],
|
|
22
17
|
* );
|
|
23
18
|
* ```
|
|
19
|
+
*
|
|
20
|
+
* @param method - The SDA method looking up the tables.
|
|
21
|
+
*
|
|
22
|
+
* @param missingTables - The requested table names that were not found.
|
|
23
|
+
*
|
|
24
|
+
* @param availableTables - The table names currently available.
|
|
25
|
+
*
|
|
26
|
+
* @returns An actionable missing-table error message.
|
|
24
27
|
*/
|
|
25
28
|
function formatMissingTables(method, missingTables, availableTables) {
|
|
26
29
|
const missing = [...missingTables].sort();
|
|
@@ -1,40 +1,49 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Formats a number with thousands separators, decimals, abbreviations, and more.
|
|
3
3
|
*
|
|
4
|
-
* @param number - The number to be formatted.
|
|
5
|
-
* @param options - An object containing various formatting options.
|
|
6
|
-
* @param options.decimals - The number of decimal places to round to.
|
|
7
|
-
* @param options.significantDigits - The number of significant digits to round to.
|
|
8
|
-
* @param options.abbreviation - If `true`, the number will be abbreviated (e.g., 1,200,000 becomes "1.2M").
|
|
9
|
-
* @param options.prefix - A string to prepend before the formatted number.
|
|
10
|
-
* @param options.suffix - A string to append after the formatted number.
|
|
11
|
-
*
|
|
12
|
-
* @returns The formatted number as a string.
|
|
13
|
-
*
|
|
14
4
|
* @example
|
|
15
5
|
* ```ts
|
|
16
6
|
* // Basic usage: Format a number with thousands separator.
|
|
17
7
|
* const num1 = formatNumber(1234567.89);
|
|
18
8
|
* console.log(num1); // "1,234,567.89"
|
|
19
9
|
* ```
|
|
10
|
+
*
|
|
20
11
|
* @example
|
|
21
12
|
* ```ts
|
|
22
13
|
* // With significant digits and suffix.
|
|
23
14
|
* const num2 = formatNumber(66.666, { significantDigits: 3, suffix: "%" });
|
|
24
15
|
* console.log(num2); // "66.7%"
|
|
25
16
|
* ```
|
|
17
|
+
*
|
|
26
18
|
* @example
|
|
27
19
|
* ```ts
|
|
28
20
|
* // Abbreviation.
|
|
29
21
|
* const num3 = formatNumber(12000, { abbreviation: true });
|
|
30
22
|
* console.log(num3); // "12K"
|
|
31
23
|
* ```
|
|
24
|
+
*
|
|
32
25
|
* @example
|
|
33
26
|
* ```ts
|
|
34
27
|
* // With decimal places.
|
|
35
28
|
* const num4 = formatNumber(123.456, { decimals: 1 });
|
|
36
29
|
* console.log(num4); // "123.5"
|
|
37
30
|
* ```
|
|
31
|
+
*
|
|
32
|
+
* @param number - The number to be formatted.
|
|
33
|
+
*
|
|
34
|
+
* @param options - An object containing various formatting options.
|
|
35
|
+
*
|
|
36
|
+
* @param options.decimals - The number of decimal places to round to.
|
|
37
|
+
*
|
|
38
|
+
* @param options.significantDigits - The number of significant digits to round to.
|
|
39
|
+
*
|
|
40
|
+
* @param options.abbreviation - If `true`, the number will be abbreviated (e.g., 1,200,000 becomes "1.2M").
|
|
41
|
+
*
|
|
42
|
+
* @param options.prefix - A string to prepend before the formatted number.
|
|
43
|
+
*
|
|
44
|
+
* @param options.suffix - A string to append after the formatted number.
|
|
45
|
+
*
|
|
46
|
+
* @returns The formatted number as a string.
|
|
38
47
|
*/
|
|
39
48
|
export default function formatNumber(number: number, options?: {
|
|
40
49
|
decimals?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatNumber.d.ts","sourceRoot":"","sources":["../../src/helpers/formatNumber.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"formatNumber.d.ts","sourceRoot":"","sources":["../../src/helpers/formatNumber.ts"],"names":[],"mappings":"AAsDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE;IACP,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACZ,GACL,MAAM,CAgER"}
|
|
@@ -4,25 +4,31 @@ exports.default = formatNumber;
|
|
|
4
4
|
/**
|
|
5
5
|
* Rounds a number based on specified criteria: a fixed number of decimal places or to a specific number of significant digits.
|
|
6
6
|
*
|
|
7
|
-
* @param number - The number to be rounded.
|
|
8
|
-
* @param options - An object containing options for rounding.
|
|
9
|
-
* @param options.decimals - The number of decimal places to keep when rounding.
|
|
10
|
-
* @param options.significantDigits - The number of significant digits to retain.
|
|
11
|
-
* @returns The rounded number.
|
|
12
|
-
* @throws {Error} If more than one rounding option is provided.
|
|
13
|
-
*
|
|
14
7
|
* @example
|
|
15
8
|
* ```ts
|
|
16
9
|
* // Round to one decimal place.
|
|
17
10
|
* const result = round(1234.567, { decimals: 1 });
|
|
18
11
|
* console.log(result); // 1234.6
|
|
19
12
|
* ```
|
|
13
|
+
*
|
|
20
14
|
* @example
|
|
21
15
|
* ```ts
|
|
22
16
|
* // Round to 3 significant digits.
|
|
23
17
|
* const result = round(0.004622, { significantDigits: 3 });
|
|
24
18
|
* console.log(result); // 0.00462
|
|
25
19
|
* ```
|
|
20
|
+
*
|
|
21
|
+
* @param number - The number to be rounded.
|
|
22
|
+
*
|
|
23
|
+
* @param options - An object containing options for rounding.
|
|
24
|
+
*
|
|
25
|
+
* @param options.decimals - The number of decimal places to keep when rounding.
|
|
26
|
+
*
|
|
27
|
+
* @param options.significantDigits - The number of significant digits to retain.
|
|
28
|
+
*
|
|
29
|
+
* @returns The rounded number.
|
|
30
|
+
*
|
|
31
|
+
* @throws {Error} If more than one rounding option is provided.
|
|
26
32
|
*/
|
|
27
33
|
function round(number, options = {}) {
|
|
28
34
|
if (typeof options.decimals === "number" &&
|
|
@@ -42,40 +48,49 @@ function round(number, options = {}) {
|
|
|
42
48
|
/**
|
|
43
49
|
* Formats a number with thousands separators, decimals, abbreviations, and more.
|
|
44
50
|
*
|
|
45
|
-
* @param number - The number to be formatted.
|
|
46
|
-
* @param options - An object containing various formatting options.
|
|
47
|
-
* @param options.decimals - The number of decimal places to round to.
|
|
48
|
-
* @param options.significantDigits - The number of significant digits to round to.
|
|
49
|
-
* @param options.abbreviation - If `true`, the number will be abbreviated (e.g., 1,200,000 becomes "1.2M").
|
|
50
|
-
* @param options.prefix - A string to prepend before the formatted number.
|
|
51
|
-
* @param options.suffix - A string to append after the formatted number.
|
|
52
|
-
*
|
|
53
|
-
* @returns The formatted number as a string.
|
|
54
|
-
*
|
|
55
51
|
* @example
|
|
56
52
|
* ```ts
|
|
57
53
|
* // Basic usage: Format a number with thousands separator.
|
|
58
54
|
* const num1 = formatNumber(1234567.89);
|
|
59
55
|
* console.log(num1); // "1,234,567.89"
|
|
60
56
|
* ```
|
|
57
|
+
*
|
|
61
58
|
* @example
|
|
62
59
|
* ```ts
|
|
63
60
|
* // With significant digits and suffix.
|
|
64
61
|
* const num2 = formatNumber(66.666, { significantDigits: 3, suffix: "%" });
|
|
65
62
|
* console.log(num2); // "66.7%"
|
|
66
63
|
* ```
|
|
64
|
+
*
|
|
67
65
|
* @example
|
|
68
66
|
* ```ts
|
|
69
67
|
* // Abbreviation.
|
|
70
68
|
* const num3 = formatNumber(12000, { abbreviation: true });
|
|
71
69
|
* console.log(num3); // "12K"
|
|
72
70
|
* ```
|
|
71
|
+
*
|
|
73
72
|
* @example
|
|
74
73
|
* ```ts
|
|
75
74
|
* // With decimal places.
|
|
76
75
|
* const num4 = formatNumber(123.456, { decimals: 1 });
|
|
77
76
|
* console.log(num4); // "123.5"
|
|
78
77
|
* ```
|
|
78
|
+
*
|
|
79
|
+
* @param number - The number to be formatted.
|
|
80
|
+
*
|
|
81
|
+
* @param options - An object containing various formatting options.
|
|
82
|
+
*
|
|
83
|
+
* @param options.decimals - The number of decimal places to round to.
|
|
84
|
+
*
|
|
85
|
+
* @param options.significantDigits - The number of significant digits to round to.
|
|
86
|
+
*
|
|
87
|
+
* @param options.abbreviation - If `true`, the number will be abbreviated (e.g., 1,200,000 becomes "1.2M").
|
|
88
|
+
*
|
|
89
|
+
* @param options.prefix - A string to prepend before the formatted number.
|
|
90
|
+
*
|
|
91
|
+
* @param options.suffix - A string to append after the formatted number.
|
|
92
|
+
*
|
|
93
|
+
* @returns The formatted number as a string.
|
|
79
94
|
*/
|
|
80
95
|
function formatNumber(number, options = {}) {
|
|
81
96
|
if (typeof number !== "number") {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TableSchema } from "./pendingOps.js";
|
|
2
|
+
export type GraphEdgeIdColumn = {
|
|
3
|
+
column: string;
|
|
4
|
+
family: "string" | "numeric";
|
|
5
|
+
idType: string;
|
|
6
|
+
};
|
|
7
|
+
/** Resolves a route edge-ID column and its exact comparison type. */
|
|
8
|
+
export default function getGraphEdgeIdColumn(schema: TableSchema, requestedEdgeId: string, method: string): GraphEdgeIdColumn;
|
|
9
|
+
//# sourceMappingURL=getGraphEdgeIdColumn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getGraphEdgeIdColumn.d.ts","sourceRoot":"","sources":["../../src/helpers/getGraphEdgeIdColumn.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGnD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,qEAAqE;AACrE,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAC1C,MAAM,EAAE,WAAW,EACnB,eAAe,EAAE,MAAM,EACvB,MAAM,EAAE,MAAM,GACb,iBAAiB,CAmCnB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = getGraphEdgeIdColumn;
|
|
7
|
+
const foldIdentifier_js_1 = __importDefault(require("./foldIdentifier.js"));
|
|
8
|
+
const getGraphEndpointColumns_js_1 = __importDefault(require("./getGraphEndpointColumns.js"));
|
|
9
|
+
const quoteIdentifier_js_1 = __importDefault(require("./quoteIdentifier.js"));
|
|
10
|
+
/** Resolves a route edge-ID column and its exact comparison type. */
|
|
11
|
+
function getGraphEdgeIdColumn(schema, requestedEdgeId, method) {
|
|
12
|
+
const folded = (0, foldIdentifier_js_1.default)(requestedEdgeId);
|
|
13
|
+
const column = Object.keys(schema).find((name) => (0, foldIdentifier_js_1.default)(name) === folded);
|
|
14
|
+
if (column === undefined) {
|
|
15
|
+
throw new Error(`${method} the column ${(0, quoteIdentifier_js_1.default)(requestedEdgeId)} does not exist. Check for typos, or load the data first.`);
|
|
16
|
+
}
|
|
17
|
+
try {
|
|
18
|
+
const resolved = (0, getGraphEndpointColumns_js_1.default)({ [column]: schema[column] }, column, column, method);
|
|
19
|
+
return {
|
|
20
|
+
column,
|
|
21
|
+
family: resolved.family,
|
|
22
|
+
idType: resolved.idType,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
if (error instanceof TypeError) {
|
|
27
|
+
throw new TypeError(`${method} requires string or whole-number edge IDs, but column ${(0, quoteIdentifier_js_1.default)(column)} has type ${schema[column]}.`);
|
|
28
|
+
}
|
|
29
|
+
throw error;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TableSchema } from "./pendingOps.js";
|
|
2
|
+
export type GraphEndpointColumns = {
|
|
3
|
+
source: string;
|
|
4
|
+
target: string;
|
|
5
|
+
idType: string;
|
|
6
|
+
family: "string" | "numeric";
|
|
7
|
+
floating: boolean;
|
|
8
|
+
};
|
|
9
|
+
/** Resolves and validates a graph's endpoint columns from an existing schema. */
|
|
10
|
+
export default function getGraphEndpointColumns(schema: TableSchema, requestedSource: string, requestedTarget: string, method: string): GraphEndpointColumns;
|
|
11
|
+
//# sourceMappingURL=getGraphEndpointColumns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getGraphEndpointColumns.d.ts","sourceRoot":"","sources":["../../src/helpers/getGraphEndpointColumns.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC7B,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAqBF,iFAAiF;AACjF,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAC7C,MAAM,EAAE,WAAW,EACnB,eAAe,EAAE,MAAM,EACvB,eAAe,EAAE,MAAM,EACvB,MAAM,EAAE,MAAM,GACb,oBAAoB,CAiEtB"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = getGraphEndpointColumns;
|
|
7
|
+
const foldIdentifier_js_1 = __importDefault(require("./foldIdentifier.js"));
|
|
8
|
+
const quoteIdentifier_js_1 = __importDefault(require("./quoteIdentifier.js"));
|
|
9
|
+
const integerTypes = {
|
|
10
|
+
TINYINT: { signed: true, bits: 8, digits: 3 },
|
|
11
|
+
SMALLINT: { signed: true, bits: 16, digits: 5 },
|
|
12
|
+
INTEGER: { signed: true, bits: 32, digits: 10 },
|
|
13
|
+
BIGINT: { signed: true, bits: 64, digits: 19 },
|
|
14
|
+
HUGEINT: { signed: true, bits: 128, digits: 39 },
|
|
15
|
+
UTINYINT: { signed: false, bits: 8, digits: 3 },
|
|
16
|
+
USMALLINT: { signed: false, bits: 16, digits: 5 },
|
|
17
|
+
UINTEGER: { signed: false, bits: 32, digits: 10 },
|
|
18
|
+
UBIGINT: { signed: false, bits: 64, digits: 20 },
|
|
19
|
+
UHUGEINT: { signed: false, bits: 128, digits: 39 },
|
|
20
|
+
};
|
|
21
|
+
/** Resolves and validates a graph's endpoint columns from an existing schema. */
|
|
22
|
+
function getGraphEndpointColumns(schema, requestedSource, requestedTarget, method) {
|
|
23
|
+
const source = findColumn(schema, requestedSource);
|
|
24
|
+
const target = findColumn(schema, requestedTarget);
|
|
25
|
+
const missing = [
|
|
26
|
+
source === undefined ? requestedSource : undefined,
|
|
27
|
+
target === undefined ? requestedTarget : undefined,
|
|
28
|
+
].filter((column) => column !== undefined);
|
|
29
|
+
if (missing.length > 0) {
|
|
30
|
+
const plural = missing.length > 1;
|
|
31
|
+
throw new Error(`${method} the column${plural ? "s" : ""} ${missing.map(quoteIdentifier_js_1.default).join(", ")} ${plural ? "do" : "does"} not exist. Check for typos, or load the data first.`);
|
|
32
|
+
}
|
|
33
|
+
const sourceType = normalizeType(schema[source]);
|
|
34
|
+
const targetType = normalizeType(schema[target]);
|
|
35
|
+
const sourceKind = typeKind(sourceType);
|
|
36
|
+
const targetKind = typeKind(targetType);
|
|
37
|
+
if (sourceKind === undefined || targetKind === undefined) {
|
|
38
|
+
const unsupported = sourceKind === undefined
|
|
39
|
+
? { column: source, type: sourceType }
|
|
40
|
+
: { column: target, type: targetType };
|
|
41
|
+
throw new TypeError(`${method} requires string or numeric endpoint IDs, but column ${(0, quoteIdentifier_js_1.default)(unsupported.column)} has type ${unsupported.type}.`);
|
|
42
|
+
}
|
|
43
|
+
if (sourceKind.family !== targetKind.family) {
|
|
44
|
+
throw new TypeError(`${method} requires compatible source and target ID types, but ${(0, quoteIdentifier_js_1.default)(source)} has type ${sourceType} and ${(0, quoteIdentifier_js_1.default)(target)} has type ${targetType}.`);
|
|
45
|
+
}
|
|
46
|
+
if (sourceKind.family === "string") {
|
|
47
|
+
return {
|
|
48
|
+
source: source,
|
|
49
|
+
target: target,
|
|
50
|
+
idType: "VARCHAR",
|
|
51
|
+
family: "string",
|
|
52
|
+
floating: false,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const idType = compatibleNumericType(sourceType, targetType);
|
|
56
|
+
if (idType === undefined) {
|
|
57
|
+
throw new TypeError(`${method} cannot combine endpoint types ${sourceType} and ${targetType} without losing ID precision. Convert both columns to one compatible exact numeric type first.`);
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
source: source,
|
|
61
|
+
target: target,
|
|
62
|
+
idType,
|
|
63
|
+
family: "numeric",
|
|
64
|
+
floating: isFloating(sourceType) || isFloating(targetType),
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function findColumn(schema, requested) {
|
|
68
|
+
const folded = (0, foldIdentifier_js_1.default)(requested);
|
|
69
|
+
return Object.keys(schema).find((column) => (0, foldIdentifier_js_1.default)(column) === folded);
|
|
70
|
+
}
|
|
71
|
+
function normalizeType(type) {
|
|
72
|
+
return type.toUpperCase().replace(/^REAL$/, "FLOAT");
|
|
73
|
+
}
|
|
74
|
+
function typeKind(type) {
|
|
75
|
+
if (type === "VARCHAR")
|
|
76
|
+
return { family: "string" };
|
|
77
|
+
if (integerTypes[type] !== undefined || isDecimal(type) || isFloating(type) ||
|
|
78
|
+
type === "BIGNUM") {
|
|
79
|
+
return { family: "numeric" };
|
|
80
|
+
}
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
function compatibleNumericType(left, right) {
|
|
84
|
+
if (left === right)
|
|
85
|
+
return left;
|
|
86
|
+
if (isFloating(left) || isFloating(right)) {
|
|
87
|
+
return isFloating(left) && isFloating(right) ? "DOUBLE" : undefined;
|
|
88
|
+
}
|
|
89
|
+
if (left === "BIGNUM" || right === "BIGNUM") {
|
|
90
|
+
const other = left === "BIGNUM" ? right : left;
|
|
91
|
+
return integerTypes[other] !== undefined || decimalScale(other) === 0
|
|
92
|
+
? "BIGNUM"
|
|
93
|
+
: undefined;
|
|
94
|
+
}
|
|
95
|
+
const leftInteger = integerTypes[left];
|
|
96
|
+
const rightInteger = integerTypes[right];
|
|
97
|
+
if (leftInteger !== undefined && rightInteger !== undefined) {
|
|
98
|
+
return commonIntegerType(leftInteger, rightInteger);
|
|
99
|
+
}
|
|
100
|
+
const leftDecimal = parseDecimal(left);
|
|
101
|
+
const rightDecimal = parseDecimal(right);
|
|
102
|
+
if (leftDecimal === undefined && rightDecimal === undefined)
|
|
103
|
+
return undefined;
|
|
104
|
+
const scale = Math.max(leftDecimal?.scale ?? 0, rightDecimal?.scale ?? 0);
|
|
105
|
+
const integerDigits = Math.max(leftDecimal === undefined
|
|
106
|
+
? leftInteger.digits
|
|
107
|
+
: leftDecimal.precision - leftDecimal.scale, rightDecimal === undefined
|
|
108
|
+
? rightInteger.digits
|
|
109
|
+
: rightDecimal.precision - rightDecimal.scale);
|
|
110
|
+
const precision = integerDigits + scale;
|
|
111
|
+
return precision <= 38 ? `DECIMAL(${precision},${scale})` : undefined;
|
|
112
|
+
}
|
|
113
|
+
function commonIntegerType(left, right) {
|
|
114
|
+
if (left.signed === right.signed) {
|
|
115
|
+
const bits = Math.max(left.bits, right.bits);
|
|
116
|
+
return integerTypeName(left.signed, bits);
|
|
117
|
+
}
|
|
118
|
+
const signed = left.signed ? left : right;
|
|
119
|
+
const unsigned = left.signed ? right : left;
|
|
120
|
+
const requiredBits = Math.max(signed.bits, nextBits(unsigned.bits));
|
|
121
|
+
return requiredBits > 128 ? undefined : integerTypeName(true, requiredBits);
|
|
122
|
+
}
|
|
123
|
+
function nextBits(bits) {
|
|
124
|
+
if (bits <= 8)
|
|
125
|
+
return 16;
|
|
126
|
+
if (bits <= 16)
|
|
127
|
+
return 32;
|
|
128
|
+
if (bits <= 32)
|
|
129
|
+
return 64;
|
|
130
|
+
if (bits <= 64)
|
|
131
|
+
return 128;
|
|
132
|
+
return 256;
|
|
133
|
+
}
|
|
134
|
+
function integerTypeName(signed, bits) {
|
|
135
|
+
const names = signed
|
|
136
|
+
? {
|
|
137
|
+
8: "TINYINT",
|
|
138
|
+
16: "SMALLINT",
|
|
139
|
+
32: "INTEGER",
|
|
140
|
+
64: "BIGINT",
|
|
141
|
+
128: "HUGEINT",
|
|
142
|
+
}
|
|
143
|
+
: {
|
|
144
|
+
8: "UTINYINT",
|
|
145
|
+
16: "USMALLINT",
|
|
146
|
+
32: "UINTEGER",
|
|
147
|
+
64: "UBIGINT",
|
|
148
|
+
128: "UHUGEINT",
|
|
149
|
+
};
|
|
150
|
+
return names[bits];
|
|
151
|
+
}
|
|
152
|
+
function isFloating(type) {
|
|
153
|
+
return type === "FLOAT" || type === "DOUBLE";
|
|
154
|
+
}
|
|
155
|
+
function isDecimal(type) {
|
|
156
|
+
return /^DECIMAL\(\d+,\d+\)$/.test(type);
|
|
157
|
+
}
|
|
158
|
+
function parseDecimal(type) {
|
|
159
|
+
const match = /^DECIMAL\((\d+),(\d+)\)$/.exec(type);
|
|
160
|
+
return match === null
|
|
161
|
+
? undefined
|
|
162
|
+
: { precision: Number(match[1]), scale: Number(match[2]) };
|
|
163
|
+
}
|
|
164
|
+
function decimalScale(type) {
|
|
165
|
+
return parseDecimal(type)?.scale;
|
|
166
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TableSchema } from "./pendingOps.js";
|
|
2
|
+
type GraphWeightColumn = {
|
|
3
|
+
column: string;
|
|
4
|
+
distanceType: string;
|
|
5
|
+
type: string;
|
|
6
|
+
};
|
|
7
|
+
/** Resolves a numeric graph weight and a precision-preserving sum type. */
|
|
8
|
+
export default function getGraphWeightColumn(schema: TableSchema, requestedWeight: string, method: string): GraphWeightColumn;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=getGraphWeightColumn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getGraphWeightColumn.d.ts","sourceRoot":"","sources":["../../src/helpers/getGraphWeightColumn.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGnD,KAAK,iBAAiB,GAAG;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAcF,2EAA2E;AAC3E,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAC1C,MAAM,EAAE,WAAW,EACnB,eAAe,EAAE,MAAM,EACvB,MAAM,EAAE,MAAM,GACb,iBAAiB,CAsCnB"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = getGraphWeightColumn;
|
|
7
|
+
const foldIdentifier_js_1 = __importDefault(require("./foldIdentifier.js"));
|
|
8
|
+
const quoteIdentifier_js_1 = __importDefault(require("./quoteIdentifier.js"));
|
|
9
|
+
const integerTypes = new Set([
|
|
10
|
+
"TINYINT",
|
|
11
|
+
"SMALLINT",
|
|
12
|
+
"INTEGER",
|
|
13
|
+
"BIGINT",
|
|
14
|
+
"UTINYINT",
|
|
15
|
+
"USMALLINT",
|
|
16
|
+
"UINTEGER",
|
|
17
|
+
"UBIGINT",
|
|
18
|
+
]);
|
|
19
|
+
const wideIntegerTypes = new Set(["HUGEINT", "UHUGEINT", "BIGNUM"]);
|
|
20
|
+
/** Resolves a numeric graph weight and a precision-preserving sum type. */
|
|
21
|
+
function getGraphWeightColumn(schema, requestedWeight, method) {
|
|
22
|
+
const folded = (0, foldIdentifier_js_1.default)(requestedWeight);
|
|
23
|
+
const column = Object.keys(schema).find((name) => (0, foldIdentifier_js_1.default)(name) === folded);
|
|
24
|
+
if (column === undefined) {
|
|
25
|
+
throw new Error(`${method} the column ${(0, quoteIdentifier_js_1.default)(requestedWeight)} does not exist. Check for typos, or load the data first.`);
|
|
26
|
+
}
|
|
27
|
+
const type = schema[column].toUpperCase().replace(/^REAL$/, "FLOAT");
|
|
28
|
+
if (integerTypes.has(type)) {
|
|
29
|
+
return { column, type, distanceType: "HUGEINT" };
|
|
30
|
+
}
|
|
31
|
+
if (wideIntegerTypes.has(type)) {
|
|
32
|
+
return { column, type, distanceType: "BIGNUM" };
|
|
33
|
+
}
|
|
34
|
+
if (type === "FLOAT" || type === "DOUBLE") {
|
|
35
|
+
return { column, type, distanceType: type };
|
|
36
|
+
}
|
|
37
|
+
const decimal = /^DECIMAL\((\d+),(\d+)\)$/.exec(type);
|
|
38
|
+
if (decimal !== null) {
|
|
39
|
+
return {
|
|
40
|
+
column,
|
|
41
|
+
type,
|
|
42
|
+
distanceType: `DECIMAL(38,${Number(decimal[2])})`,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
throw new TypeError(`${method} requires a numeric weight column, but column ${(0, quoteIdentifier_js_1.default)(column)} has type ${type}.`);
|
|
46
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { TableSchema } from "./pendingOps.js";
|
|
2
|
+
/** Derives the route result schema while preserving input columns and types. */
|
|
3
|
+
export default function graphRouteResultSchema(schema: TableSchema, distanceType: string, method: string): TableSchema;
|
|
4
|
+
//# sourceMappingURL=graphRouteResultSchema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphRouteResultSchema.d.ts","sourceRoot":"","sources":["../../src/helpers/graphRouteResultSchema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGnD,gFAAgF;AAChF,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAC5C,MAAM,EAAE,WAAW,EACnB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,GACb,WAAW,CASb"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = graphRouteResultSchema;
|
|
7
|
+
const validateGraphRouteResultSchema_js_1 = __importDefault(require("./validateGraphRouteResultSchema.js"));
|
|
8
|
+
/** Derives the route result schema while preserving input columns and types. */
|
|
9
|
+
function graphRouteResultSchema(schema, distanceType, method) {
|
|
10
|
+
(0, validateGraphRouteResultSchema_js_1.default)(schema, method);
|
|
11
|
+
return {
|
|
12
|
+
pathId: "BIGINT",
|
|
13
|
+
step: "BIGINT",
|
|
14
|
+
weight: distanceType,
|
|
15
|
+
total: distanceType,
|
|
16
|
+
...schema,
|
|
17
|
+
};
|
|
18
|
+
}
|