geolib
Version:
Library to provide basic geospatial operations like distance calculation, decoding of sexagesimal coordinates etc.
1 lines • 463 B
JavaScript
;Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;const getCoordinateKey=(point,keysToLookup)=>{if(point===undefined||point===null){throw new Error(`'${point}' is no valid coordinate.`)}return keysToLookup.reduce((foundKey,key)=>{if(Object.prototype.hasOwnProperty.call(point,key)&&key!==undefined&&foundKey===undefined){foundKey=key;return key}return foundKey},undefined)};var _default=exports.default=getCoordinateKey;