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AW,QAAQ,UACnB,kBAAqB,QAAQ,qBAGzB,SAAW,CACf,MAAS,QAAQ,QACjB,WAAc,QAAQ,aACtB,WAAc,QAAQ,aACtB,gBAAmB,QAAQ,kBAC3B,QAAW,QAAQ,UACnB,aAAgB,QAAQ,eACxB,mBAAsB,QAAQ,sBAG1B,SAAW,CACf,QAAW,QAAQ,UACnB,kBAAqB,QAAQ,oBAC7B,MAAS,QAAQ,QACjB,WAAc,QAAQ,aACtB,WAAc,QAAQ,aACtB,gBAAmB,QAAQ,kBAC3B,QAAW,QAAQ,UACnB,aAAgB,QAAQ,eACxB,mBAAsB,QAAQ,qBAC9B,KAAQ,QAAQ,OAChB,SAAY,QAAQ,WACpB,QAAW,QAAQ,gBACnB,eAAkB,QAAQ,kBAG5B,QAAQ,SAAW","file":"/npm/geojson-validation@1.0.2/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/geojson-validation@1.0.2/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\n * geoJSON validation according to the GeoJSON spefication Version 1\n * @module geoJSONValidation\n * @class Main\n * @exports {GJV}\n */\n\nconst definitions = {}\n\n/**\n * Test an object to see if it is a function\n * @method isFunction\n * @param object {Object}\n * @return {Boolean}\n */\nfunction isFunction (object) {\n  return typeof (object) === 'function'\n}\n\n/**\n * A truthy test for objects\n * @method isObject\n * @param {Object}\n * @return {Boolean}\n */\nfunction isObject (object) {\n  return object === Object(object)\n}\n\n/**\n * Formats error messages, calls the callback\n * @method done\n * @private\n * @param trace {Boolean} Whether or not to return the trace\n * @param [message]\n * @return {Boolean} is the object valid or not?\n */\nfunction _done (trace, message) {\n  let valid = false\n\n  if (typeof message === 'string') {\n    message = [message]\n  } else if (Object.prototype.toString.call(message) === '[object Array]') {\n    if (message.length === 0) {\n      valid = true\n    }\n  } else {\n    valid = true\n  }\n\n  if (trace) {\n    return message\n  } else {\n    return valid\n  }\n}\n\n/**\n * calls a custom definition if one is avalible for the given type\n * @method _customDefinitions\n * @private\n * @param type {'String'} a GeoJSON object type\n * @param object {Object} the Object being tested\n * @return {Array} an array of errors\n */\nfunction _customDefinitions (type, object) {\n  let errors\n\n  if (isFunction(definitions[type])) {\n    try {\n      errors = definitions[type](object)\n    } catch (e) {\n      errors = ['Problem with custom definition for '+type+': '+e]\n    }\n    if (typeof result === 'string') {\n      errors = [errors]\n    }\n    if (Object.prototype.toString.call(errors) === '[object Array]') {\n      return errors\n    }\n  }\n  return []\n}\n\n/**\n * Define a custom validation function for one of GeoJSON objects\n * @method define\n * @param type {GeoJSON Type} the type\n * @param definition {Function} A validation function\n * @return {Boolean} Return true if the function was loaded corectly else false\n */\nexports.define = (type, definition) => {\n  if ((type in allTypes) && isFunction(definition)) {\n    // TODO: check to see if the type is valid\n    definitions[type] = definition\n    return true\n  } else {\n    return false\n  }\n}\n\n/**\n * Determines if an object is a position or not\n * @method isPosition\n * @param position {Array}\n * @param [trace] {Boolean}\n * @return {Boolean}\n */\nexports.isPosition = (position, trace = false) => {\n  let errors = []\n\n  // It must be an array\n  if (Array.isArray(position)) {\n    // and the array must have more than one element\n    if (position.length <= 1) {\n      errors.push('Position must be at least two elements')\n    }\n\n    position.forEach((pos, index) => {\n      if (typeof pos !== 'number') {\n        errors.push('Position must only contain numbers. Item '+pos+' at index '+index+' is invalid.')\n      }\n    })\n  } else {\n    errors.push('Position must be an array')\n  }\n\n  // run custom checks\n  errors = errors.concat(_customDefinitions('Position', position))\n  return _done(trace, errors)\n}\n\n/**\n * Determines if an object is a GeoJSON Object or not\n * @method isGeoJSONObject|valid\n * @param geoJSONObject {Object}\n * @param [trace] {Boolean}\n * @return {Boolean}\n */\nexports.isGeoJSONObject = exports.valid = (geoJSONObject, trace = false) => {\n  if (!isObject(geoJSONObject)) {\n    return _done(trace, ['must be a JSON Object'])\n  } else {\n    let errors = []\n    if ('type' in geoJSONObject) {\n      if (nonGeoTypes[geoJSONObject.type]) {\n        return nonGeoTypes[geoJSONObject.type](geoJSONObject, trace)\n      } else if (geoTypes[geoJSONObject.type]) {\n        return geoTypes[geoJSONObject.type](geoJSONObject, trace)\n      } else {\n        errors.push('type must be one of: \"Point\", \"MultiPoint\", \"LineString\", \"MultiLineString\", \"Polygon\", \"MultiPolygon\", \"GeometryCollection\", \"Feature\", or \"FeatureCollection\"')\n      }\n    } else {\n      errors.push('must have a member with the name \"type\"')\n    }\n\n    // run custom checks\n    errors = errors.concat(_customDefinitions('GeoJSONObject', geoJSONObject))\n    return _done(trace, errors)\n  }\n}\n\n/**\n * Determines if an object is a Geometry Object or not\n * @method isGeometryObject\n * @param geometryObject {Object}\n * @param [trace] {Boolean}\n * @return {Boolean}\n */\nexports.isGeometryObject = (geometryObject, trace = false) => {\n  if (!isObject(geometryObject)) {\n    return _done(trace, ['must be a JSON Object'])\n  }\n\n  let errors = []\n  if ('type' in geometryObject) {\n    if (geoTypes[geometryObject.type]) {\n      return geoTypes[geometryObject.type](geometryObject, trace)\n    } else {\n      errors.push('type must be one of: \"Point\", \"MultiPoint\", \"LineString\", \"MultiLineString\", \"Polygon\", \"MultiPolygon\" or \"GeometryCollection\"')\n    }\n  } else {\n    errors.push('must have a member with the name \"type\"')\n  }\n\n  // run custom checks\n  errors = errors.concat(_customDefinitions('GeometryObject', geometryObject))\n  return _done(trace, errors)\n}\n\n/**\n * Determines if an object is a Point or not\n * @method isPoint\n * @param point {Object}\n * @param [trace] {Boolean}\n * @return {Boolean}\n */\nexports.isPoint = (point, trace = false) => {\n  if (!isObject(point)) {\n    return _done(trace, ['must be a JSON Object'])\n  }\n\n  let errors = []\n  if ('bbox' in point) {\n    const t = exports.isBbox(point.bbox, true)\n    if (t.length) {\n      errors = errors.concat(t)\n    }\n  }\n\n  if ('type' in point) {\n    if (point.type !== 'Point') {\n      errors.push('type must be \"Point\"')\n    }\n  } else {\n    errors.push('must have a member with the name \"type\"')\n  }\n\n  if ('coordinates' in point) {\n    const t = exports.isPosition(point.coordinates, true)\n    if (t.length) {\n\terrors = errors.concat(t)\n    }\n  } else {\n    errors.push('must have a member with the name \"coordinates\"')\n  }\n\n  // run custom checks\n  errors = errors.concat(_customDefinitions('Point', point))\n  return _done(trace, errors)\n}\n\n/**\n * Determines if an array can be interperted as coordinates for a MultiPoint\n * @method isMultiPointCoor\n * @param coordinates {Array}\n * @param [trace] {Boolean}\n * @return {Boolean}\n */\nexports.isMultiPointCoor = (coordinates, trace = false) => {\n  let errors = []\n\n  if (Array.isArray(coordinates)) {\n    coordinates.forEach((val, index) => {\n      const t = exports.isPosition(val, true)\n      if (t.length) {\n        // modify the err msg from \"isPosition\" to note the element number\n        t[0] = 'at ' + index + ': '.concat(t[0])\n        // build a list of invalide positions\n        errors = errors.concat(t)\n      }\n    })\n  } else {\n    errors.push('coordinates must be an array')\n  }\n  return _done(trace, errors)\n}\n/**\n * Determines if an object is a MultiPoint or not\n * @method isMultiPoint\n * @param position {Object}\n * @param [trace] {Boolean}\n * @return {Boolean}\n */\nexports.isMultiPoint = (multiPoint, trace = false) => {\n  if (!isObject(multiPoint)) {\n    return _done(trace, ['must be a JSON Object'])\n  }\n\n  let errors = []\n  if ('bbox' in multiPoint) {\n    const t = exports.isBbox(multiPoint.bbox, true)\n    if (t.length) {\n      errors = errors.concat(t)\n    }\n  }\n\n  if ('type' in multiPoint) {\n    if (multiPoint.type !== 'MultiPoint') {\n      errors.push('type must be \"MultiPoint\"')\n    }\n  } else {\n    errors.push('must have a member with the name \"type\"')\n  }\n\n  if ('coordinates' in multiPoint) {\n    const t = exports.isMultiPointCoor(multiPoint.coordinates, true)\n    if (t.length) {\n      errors = errors.concat(t)\n    }\n  } else {\n    errors.push('must have a member with the name \"coordinates\"')\n  }\n\n  // run custom checks\n  errors = errors.concat(_customDefinitions('MultiPoint', multiPoint))\n  return _done(trace, errors)\n}\n\n/**\n * Determines if an array can be interperted as coordinates for a lineString\n * @method isLineStringCoor\n * @param coordinates {Array}\n * @param [trace] {Boolean}\n * @return {Boolean}\n */\nexports.isLineStringCoor = (coordinates, trace = false) => {\n  let errors = []\n  if (Array.isArray(coordinates)) {\n    if (coordinates.length > 1) {\n      coordinates.forEach((val, index) => {\n        const t = exports.isPosition(val, true)\n        if (t.length) {\n          // modify the err msg from 'isPosition' to note the element number\n          t[0] = 'at ' + index + ': '.concat(t[0])\n          // build a list of invalide positions\n          errors = errors.concat(t)\n        }\n      })\n    } else {\n      errors.push('coordinates must have at least two elements')\n    }\n  } else {\n    errors.push('coordinates must be an array')\n  }\n\n  return _done(trace, errors)\n}\n\n/**\n * Determines if an object is a lineString or not\n * @method isLineString\n * @param lineString {Object}\n * @param [trace] {Boolean}\n * @return {Boolean}\n */\nexports.isLineString = (lineString, trace = false) => {\n  if (!isObject(lineString)) {\n    return _done(trace, ['must be a JSON Object'])\n  }\n\n  let errors = []\n  if ('bbox' in lineString) {\n    const t = exports.isBbox(lineString.bbox, true)\n    if (t.length) {\n      errors = errors.concat(t)\n    }\n  }\n\n  if ('type' in lineString) {\n    if (lineString.type !== 'LineString') {\n      errors.push('type must be \"LineString\"')\n    }\n  } else {\n    errors.push('must have a member with the name \"type\"')\n  }\n\n  if ('coordinates' in lineString) {\n    const t = exports.isLineStringCoor(lineString.coordinates, true)\n    if (t.length) {\n      errors = errors.concat(t)\n    }\n  } else {\n    errors.push('must have a member with the name \"coordinates\"')\n  }\n\n  // run custom checks\n  errors = errors.concat(_customDefinitions('LineString', lineString))\n  return _done(trace, errors)\n}\n\n/**\n * Determines if an array can be interperted as coordinates for a MultiLineString\n * @method isMultiLineStringCoor\n * @param coordinates {Array}\n * @param [trace] {Boolean}\n * @return {Boolean}\n */\nexports.isMultiLineStringCoor = (coordinates, trace = false) => {\n    let errors = []\n    if (Array.isArray(coordinates)) {\n\tcoordinates.forEach((val, index) => {\n\t    const t = exports.isLineStringCoor(val, true)\n\t    if (t.length) {\n\t\t// modify the err msg from 'isPosition' to note the element number\n\t\tt[0] = 'at ' + index + ': '.concat(t[0])\n\t\t// build a list of invalide positions\n\t\terrors = errors.concat(t)\n\t    }\n\t})\n    } else {\n\terrors.push('coordinates must be an array')\n    }\n    return _done(trace, errors)\n}\n\n/**\n * Determines if an object is a MultiLine String or not\n * @method isMultiLineString\n * @param multilineString {Object}\n * @param [trace] {Boolean}\n * @return {Boolean}\n */\nexports.isMultiLineString = (multilineString, trace = false) => {\n  if (!isObject(multilineString)) {\n    return _done(trace, ['must be a JSON Object'])\n  }\n\n  let errors = []\n  if ('bbox' in multilineString) {\n    const t = exports.isBbox(multilineString.bbox, true)\n    if (t.length) {\n      errors = errors.concat(t)\n    }\n  }\n\n  if ('type' in multilineString) {\n    if (multilineString.type !== 'MultiLineString') {\n      errors.push('type must be \"MultiLineString\"')\n    }\n  } else {\n    errors.push('must have a member with the name \"type\"')\n  }\n\n  if ('coordinates' in multilineString) {\n    const t = exports.isMultiLineStringCoor(multilineString.coordinates, true)\n\n    if (t.length) {\n      errors = errors.concat(t)\n    }\n  } else {\n    errors.push('must have a member with the name \"coordinates\"')\n  }\n\n  // run custom checks\n  errors = errors.concat(_customDefinitions('MultiPoint', multilineString))\n  return _done(trace, errors)\n}\n\n/**\n * Determines if an array is a linear Ring String or not\n * @method isMultiLineString\n * @private\n * @param coordinates {Array}\n * @param [trace] {Boolean}\n * @return {Boolean}\n */\nfunction _linearRingCoor (coordinates, trace) {\n  let errors = []\n  if (Array.isArray(coordinates)) {\n    // 4 or more positions\n    coordinates.forEach((val, index) => {\n      const t = exports.isPosition(val, true)\n      if (t.length) {\n\t// modify the err msg from 'isPosition' to note the element number\n\tt[0] = 'at ' + index + ': '.concat(t[0])\n\t// build a list of invalide positions\n\terrors = errors.concat(t)\n      }\n    })\n\n    // check the first and last positions to see if they are equivalent\n    // TODO: maybe better checking?\n    if (coordinates[0].toString() !== coordinates[coordinates.length - 1].toString()) {\n      errors.push('The first and last positions must be equivalent')\n    }\n\n    if (coordinates.length < 4) {\n      errors.push('coordinates must have at least four positions')\n    }\n  } else {\n    errors.push('coordinates must be an array')\n  }\n\n  return _done(trace, errors)\n}\n\n/**\n * Determines if an array is valid Polygon Coordinates or not\n * @method _polygonCoor\n * @private\n * @param coordinates {Array}\n * @param [trace] {Boolean}\n * @return {Boolean}\n */\nexports.isPolygonCoor = (coordinates, trace = false) => {\n  let errors = []\n  if (Array.isArray(coordinates)) {\n    coordinates.forEach((val, index) => {\n      const t = _linearRingCoor(val, true)\n\n      if (t.length) {\n        // modify the err msg from 'isPosition' to note the element number\n        t[0] = 'at ' + index + ': '.concat(t[0])\n        // build a list of invalid positions\n        errors = errors.concat(t)\n      }\n    })\n  } else {\n    errors.push('coordinates must be an array')\n  }\n\n  return _done(trace, errors)\n}\n\n/**\n * Determines if an object is a valid Polygon\n * @method isPolygon\n * @param polygon {Object}\n * @param [trace] {Boolean}\n * @return {Boolean}\n */\nexports.isPolygon = (polygon, trace = false) => {\n  if (!isObject(polygon)) {\n    return _done(trace, ['must be a JSON Object'])\n  }\n\n  let errors = []\n\n  if ('bbox' in polygon) {\n    const t = exports.isBbox(polygon.bbox, true)\n    if (t.length) {\n      errors = errors.concat(t)\n    }\n  }\n\n  if ('type' in polygon) {\n    if (polygon.type !== 'Polygon') {\n      errors.push('type must be \"Polygon\"')\n    }\n  } else {\n    errors.push('must have a member with the name \"type\"')\n  }\n\n  if ('coordinates' in polygon) {\n    const t = exports.isPolygonCoor(polygon.coordinates, true)\n    if (t.length) {\n      errors = errors.concat(t)\n    }\n  } else {\n    errors.push('must have a member with the name \"coordinates\"')\n  }\n\n  // run custom checks\n  errors = errors.concat(_customDefinitions('Polygon', polygon))\n\n  return _done(trace, errors)\n}\n\n/**\n * Determines if an array can be interperted as coordinates for a MultiPolygon\n * @method isMultiPolygonCoor\n * @param coordinates {Array}\n * @param [trace] {Boolean}\n * @return {Boolean}\n */\nexports.isMultiPolygonCoor = (coordinates, trace = false) => {\n  let errors = []\n  if (Array.isArray(coordinates)) {\n    coordinates.forEach((val, index) => {\n      const t = exports.isPolygonCoor(val, true)\n      if (t.length) {\n        // modify the err msg from 'isPosition' to note the element number\n        t[0] = 'at ' + index + ': '.concat(t[0])\n        // build a list of invalide positions\n        errors = errors.concat(t)\n      }\n    })\n  } else {\n    errors.push('coordinates must be an array')\n  }\n\n  return _done(trace, errors)\n}\n\n/**\n * Determines if an object is a valid MultiPolygon\n * @method isMultiPolygon\n * @param multiPolygon {Object}\n * @param [trace] {Boolean}\n * @return {Boolean}\n */\nexports.isMultiPolygon = (multiPolygon, trace = false) => {\n  if (!isObject(multiPolygon)) {\n    return _done(trace, ['must be a JSON Object'])\n  }\n\n  let errors = []\n  if ('bbox' in multiPolygon) {\n    const t = exports.isBbox(multiPolygon.bbox, true)\n    if (t.length) {\n      errors = errors.concat(t)\n    }\n  }\n\n  if ('type' in multiPolygon) {\n    if (multiPolygon.type !== 'MultiPolygon') {\n      errors.push('type must be \"MultiPolygon\"')\n    }\n  } else {\n    errors.push('must have a member with the name \"type\"')\n  }\n\n  if ('coordinates' in multiPolygon) {\n    const t = exports.isMultiPolygonCoor(multiPolygon.coordinates, true)\n    if (t.length) {\n      errors = errors.concat(t)\n    }\n  } else {\n    errors.push('must have a member with the name \"coordinates\"')\n  }\n\n  // run custom checks\n  errors = errors.concat(_customDefinitions('MultiPolygon', multiPolygon))\n\n  return _done(trace, errors)\n}\n\n/**\n * Determines if an object is a valid Geometry Collection\n * @method isGeometryCollection\n * @param geometryCollection {Object}\n * @param [trace] {Boolean}\n * @return {Boolean}\n */\nexports.isGeometryCollection = (geometryCollection, trace = false) => {\n  if (!isObject(geometryCollection)) {\n    return _done(trace, ['must be a JSON Object'])\n  }\n\n  let errors = []\n  if ('bbox' in geometryCollection) {\n    const t = exports.isBbox(geometryCollection.bbox, true)\n    if (t.length) {\n      errors = errors.concat(t)\n    }\n  }\n\n  if ('type' in geometryCollection) {\n    if (geometryCollection.type !== 'GeometryCollection') {\n      errors.push('type must be \"GeometryCollection\"')\n    }\n  } else {\n    errors.push('must have a member with the name \"type\"')\n  }\n\n  if ('geometries' in geometryCollection) {\n    if (Array.isArray(geometryCollection.geometries)) {\n      geometryCollection.geometries.forEach((val, index) => {\n        const t = exports.isGeometryObject(val, true)\n        if (t.length) {\n          // modify the err msg from 'isPosition' to note the element number\n          t[0] = 'at ' + index + ': '.concat(t[0])\n          // build a list of invalide positions\n          errors = errors.concat(t)\n        }\n      })\n    } else {\n      errors.push('\"geometries\" must be an array')\n    }\n  } else {\n    errors.push('must have a member with the name \"geometries\"')\n  }\n\n  // run custom checks\n  errors = errors.concat(_customDefinitions('GeometryCollection', geometryCollection))\n\n  return _done(trace, errors)\n}\n\n/**\n * Determines if an object is a valid Feature\n * @method isFeature\n * @param feature {Object}\n * @param [trace] {Boolean}\n * @return {Boolean}\n */\nexports.isFeature = (feature, trace = false) => {\n  if (!isObject(feature)) {\n    return _done(trace, ['must be a JSON Object'])\n  }\n\n  let errors = []\n  if ('bbox' in feature) {\n    const t = exports.isBbox(feature.bbox, true)\n    if (t.length) {\n      errors = errors.concat(t)\n    }\n  }\n\n  if ('type' in feature) {\n    if (feature.type !== 'Feature') {\n      errors.push('type must be \"Feature\"')\n    }\n  } else {\n    errors.push('must have a member with the name \"type\"')\n  }\n\n  if (!('properties' in feature)) {\n    errors.push('must have a member with the name \"properties\"')\n  }\n\n  if ('geometry' in feature) {\n    if (feature.geometry !== null) {\n      const t = exports.isGeometryObject(feature.geometry, true)\n      if (t.length) {\n        errors = errors.concat(t)\n      }\n    }\n  } else {\n    errors.push('must have a member with the name \"geometry\"')\n  }\n\n  // run custom checks\n  errors = errors.concat(_customDefinitions('Feature', feature))\n  return _done(trace, errors)\n}\n\n/**\n * Determines if an object is a valid Feature Collection\n * @method isFeatureCollection\n * @param featureCollection {Object}\n * @param [trace] {Boolean}\n * @return {Boolean}\n */\nexports.isFeatureCollection = (featureCollection, trace = false) => {\n  if (!isObject(featureCollection)) {\n    return _done(trace, ['must be a JSON Object'])\n  }\n\n  let errors = []\n  if ('bbox' in featureCollection) {\n    const t = exports.isBbox(featureCollection.bbox, true)\n    if (t.length) {\n      errors = t\n    }\n  }\n\n  if ('type' in featureCollection) {\n    if (featureCollection.type !== 'FeatureCollection') {\n      errors.push('type must be \"FeatureCollection\"')\n    }\n  } else {\n    errors.push('must have a member with the name \"type\"')\n  }\n\n  if ('features' in featureCollection) {\n    if (Array.isArray(featureCollection.features)) {\n      featureCollection.features.forEach((val, index) => {\n        const t = exports.isFeature(val, true)\n        if (t.length) {\n\n          // modify the err msg from 'isPosition' to note the element number\n          t[0] = 'at ' + index + ': '.concat(t[0])\n          // build a list of invalide positions\n          errors = errors.concat(t)\n        }\n      })\n    } else {\n      errors.push('\"Features\" must be an array')\n    }\n  } else {\n    errors.push('must have a member with the name \"Features\"')\n  }\n\n  // run custom checks\n  errors = errors.concat(_customDefinitions('FeatureCollection', featureCollection))\n  return _done(trace, errors)\n}\n\n/**\n * Determines if an object is a valid Bounding Box\n * @method isBbox\n * @param bbox {Object}\n * @param [trace] {Boolean}\n * @return {Boolean}\n */\nexports.isBbox = (bbox, trace = false) => {\n  let errors = []\n  if (Array.isArray(bbox)) {\n    if (bbox.length % 2 !== 0) {\n      errors.push('bbox, must be a 2*n array')\n    }\n  } else {\n    errors.push('bbox must be an array')\n  }\n\n  // run custom checks\n  errors = errors.concat(_customDefinitions('Bbox', bbox))\n  return _done(trace, errors)\n}\n\nconst nonGeoTypes = {\n  'Feature': exports.isFeature,\n  'FeatureCollection': exports.isFeatureCollection\n}\n\nconst geoTypes = {\n  'Point': exports.isPoint,\n  'MultiPoint': exports.isMultiPoint,\n  'LineString': exports.isLineString,\n  'MultiLineString': exports.isMultiLineString,\n  'Polygon': exports.isPolygon,\n  'MultiPolygon': exports.isMultiPolygon,\n  'GeometryCollection': exports.isGeometryCollection\n}\n\nconst allTypes = {\n  'Feature': exports.isFeature,\n  'FeatureCollection': exports.isFeatureCollection,\n  'Point': exports.isPoint,\n  'MultiPoint': exports.isMultiPoint,\n  'LineString': exports.isLineString,\n  'MultiLineString': exports.isMultiLineString,\n  'Polygon': exports.isPolygon,\n  'MultiPolygon': exports.isMultiPolygon,\n  'GeometryCollection': exports.isGeometryCollection,\n  'Bbox': exports.isBbox,\n  'Position': exports.isPosition,\n  'GeoJSON': exports.isGeoJSONObject,\n  'GeometryObject': exports.isGeometryObject\n}\n\nexports.allTypes = allTypes\n"]}