Exciting release!Introducing "safe npm". Learn more
Socket
Log inDemoInstall

@workadventure/tiled-map-type-guard

Package Overview
Dependencies
1
Maintainers
1
Versions
14
Issues
File Explorer

Advanced tools

@workadventure/tiled-map-type-guard

Typescript package boilerplate template

    2.1.1latest
    GitHub

Version published
Maintainers
1
Weekly downloads
690
decreased by-39.15%

Weekly downloads

Changelog

Source

2.1.1 (2023-03-14)

Bug Fixes

  • Export tilesets types (0a43b8a)

Features

  • Adding support for Tilesets referencing files (0b6114d)

Readme

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

FAQs

Last updated on 14 Mar 2023

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket
support@socket.devSocket SOC 2 Logo

Product

  • Package Issues
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc