@evergis/api
Advanced tools
Comparing version
@@ -35,3 +35,3 @@ import { Layers as LayersService, } from '../__generated__/Layers'; | ||
...params, | ||
types: ['PostgresLayerService', 'StyledFeatureLayer'], | ||
types: ['PostgresLayerService', 'PostgresTileLayerService', 'StyledFeatureLayer'], | ||
}); | ||
@@ -38,0 +38,0 @@ } |
import { FeatureLayerServiceInfoDc } from '../__generated__/data-contracts'; | ||
declare type Typed = { | ||
type: string; | ||
type?: string; | ||
}; | ||
export declare const isLayer: (typed: Typed) => typed is FeatureLayerServiceInfoDc; | ||
export {}; |
function createGuard(type) { | ||
return function (typed) { | ||
return typed.type === type; | ||
if (!typed.type) | ||
return false; | ||
return type.includes(typed.type); | ||
}; | ||
} | ||
export const isLayer = createGuard('PostgresLayerService'); | ||
// TODO other types | ||
export const isLayer = createGuard(['PostgresLayerService', 'PostgresTileLayerService']); | ||
//# sourceMappingURL=typeGuards.js.map |
{ | ||
"name": "@evergis/api", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"license": "ISC", | ||
@@ -5,0 +5,0 @@ "author": "everpoint", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
290755
-16.64%182
-10.34%6318
-14.08%