UNPKG

here-maps-type-guards

Version:

A guarded version of the TypeScript type definitions for HERE Maps.

42 lines (38 loc) 2.2 kB
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@babel/runtime/helpers/typeof')) : typeof define === 'function' && define.amd ? define(['exports', '@babel/runtime/helpers/typeof'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.hereMapsTypeGuards = {}, global._typeof)); })(this, (function (exports, _typeof) { 'use strict'; var H = (typeof window === "undefined" ? "undefined" : _typeof(window)) === 'object' ? window.H : undefined; // tslint:disable-next-line:no-shadowed-variable var isHereMaps = function isHereMaps(H) { return _typeof(H) === 'object' && H !== null && 'geo' in H && 'Map' in H && 'map' in H && 'math' in H && 'util' in H; }; // tslint:disable-next-line:no-shadowed-variable var isHereMapsWithClusteringNamespace = function isHereMapsWithClusteringNamespace(H) { return isHereMaps(H) && 'clustering' in H; }; // tslint:disable-next-line:no-shadowed-variable var isHereMapsWithDataNamespace = function isHereMapsWithDataNamespace(H) { return isHereMaps(H) && 'data' in H; }; // tslint:disable-next-line:no-shadowed-variable var isHereMapsWithMapEventsNamespace = function isHereMapsWithMapEventsNamespace(H) { return isHereMaps(H) && 'mapevents' in H; }; // tslint:disable-next-line:no-shadowed-variable var isHereMapsWithServiceNamespace = function isHereMapsWithServiceNamespace(H) { return isHereMaps(H) && 'service' in H; }; // tslint:disable-next-line:no-shadowed-variable var isHereMapsWithUiNamespace = function isHereMapsWithUiNamespace(H) { return isHereMaps(H) && 'ui' in H; }; exports.H = H; exports.isHereMaps = isHereMaps; exports.isHereMapsWithClusteringNamespace = isHereMapsWithClusteringNamespace; exports.isHereMapsWithDataNamespace = isHereMapsWithDataNamespace; exports.isHereMapsWithMapEventsNamespace = isHereMapsWithMapEventsNamespace; exports.isHereMapsWithServiceNamespace = isHereMapsWithServiceNamespace; exports.isHereMapsWithUiNamespace = isHereMapsWithUiNamespace; }));