Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function getSceneDefinition(project: Project, point: Coordinate, rotation: Rotation) {
const parcels = getParcelOrientation(project, point, rotation)
const base = parcels.reduce((base, parcel) => (parcel.x <= base.x && parcel.y <= base.y ? parcel : base), parcels[0])
return {
...sceneJson,
scene: {
...sceneJson.scene,
parcels: parcels.map(parcelToString),
base: parcelToString(base)
},
source: {
origin: 'builder',
projectId: project.id
}
}
}