New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@workadventure/tiled-map-type-guard

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@workadventure/tiled-map-type-guard

Typescript package boilerplate template

2.1.2
latest
Source
npm
Version published
Weekly downloads
1.4K
-1.67%
Maintainers
2
Weekly downloads
 
Created
Source

Tiled map type guards

Github Actions codecov

When working with Tiled maps, it can be useful to have property defined types in Typescript.

This package contains a set of interfaces that map the Tiled map JSON format.

Moreover, this package comes with Zod type guards that will allow you to actually check that the JSON file ou are reading is actually a well-formed Tiled map.

Available interfaces:

  • ITiledMap
  • ITiledMapLayer
    • ITiledMapGroupLayer
    • ITiledMapImageLayer
    • ITiledMapObjectLayer
      • ITiledMapObject
        • ITiledMapText
        • ITiledMapPoint
    • ITiledMapTileLayer
  • ITiledMapTileset
    • ITiledMapTile
      • ITiledMapWangColor
      • ITiledMapWangSet
      • ITiledMapWangTile
  • ITiledMapChunk
  • ITiledMapFrame
  • ITiledMapGrid
  • ITiledMapOffset
  • ITiledMapProperty
  • ITiledMapTerrain
  • ITiledMapTransformations

Usage:

// This will throw an error if "data" is not matching the type ITiledMap
const map: ITiledMap = ITiledMap.parse(data);

Keywords

typescript

FAQs

Package last updated on 20 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts