mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-25 20:33:11 +00:00
style: prettier bahiaGeometryModuleFactory
This commit is contained in:
parent
8188c9a386
commit
479af4f2ef
1 changed files with 2 additions and 7 deletions
|
|
@ -3,10 +3,7 @@ import { feature } from 'topojson-client'
|
||||||
import type { BahiaFeature } from '@/lib/bahiaGeometriesTypes'
|
import type { BahiaFeature } from '@/lib/bahiaGeometriesTypes'
|
||||||
import type { GeometryCollection, Topology } from 'topojson-specification'
|
import type { GeometryCollection, Topology } from 'topojson-specification'
|
||||||
|
|
||||||
type GeometryModuleBase<
|
type GeometryModuleBase<Properties extends Record<string, unknown>, TObjectName extends string> = {
|
||||||
Properties extends Record<string, unknown>,
|
|
||||||
TObjectName extends string,
|
|
||||||
> = {
|
|
||||||
topology: Topology<{ [key in TObjectName]: GeometryCollection<Properties> }>
|
topology: Topology<{ [key in TObjectName]: GeometryCollection<Properties> }>
|
||||||
features: readonly BahiaFeature<Properties>[]
|
features: readonly BahiaFeature<Properties>[]
|
||||||
}
|
}
|
||||||
|
|
@ -69,9 +66,7 @@ export function buildGeometryModuleFromTopology<
|
||||||
return base
|
return base
|
||||||
}
|
}
|
||||||
|
|
||||||
const featuresByKey = new Map(
|
const featuresByKey = new Map(features.map((entry) => [entry.properties[keyProperty], entry]))
|
||||||
features.map((entry) => [entry.properties[keyProperty], entry]),
|
|
||||||
)
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...base,
|
...base,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue