import { positionKey } from "./keys" ; import { DataWithPosition , Position } from "./types" ; interface GetPosition { ( dataWithPosition ) : Position ; ( dataWithPosition ) : undefined ; } export const getPosition = ( dataWithPosition ) => { if ( typeof dataWithPosition === "undefined" ) { return undefined ; } return dataWithPosition [ positionKey ] ; } ;