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

martok

Package Overview
Dependencies
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

martok

Martok [WIP] == ## Glory to your schema!

  • 0.9.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-88.1%
Maintainers
1
Weekly downloads
 
Created
Source

Martok [WIP]

Glory to your schema!

image

Martok is built for one thing and one thing only: converting Typescript schemas into kotlinx.serialization schemas. It's the brutal and chaotic rival to Dukat.

It is still in the extremely early stages of development, and should not be used.

Why Kotlin? Why Typescript?

We're a huge believer in Kotlin Multiplatform for Mobile -- but also accept the increasing prevalence of Node on the backend. Martok creates a schema pipeline from your Typescript backend to your Kotlin data layer on Android & iOS.

Why Not QuickType?

QuickType has gotten quite old and difficult to develop. The PRs have mostly stagnated, we currently cannot find a way to successfully build the project, so we've moved on.

Installation

npm install -g martok

Usage

# Martok works with single files, directories, and always infers the right thing to do.
martok ./someFile.d.ts -o Schema.kt --package example
martok ./someDirectory -o BigSchema.kt
martok ./someDirectory -o ./outputDirectory # produce lots of little files.
martok ./someDirectory -o WithDates.kt --datePattern standard # [see Patterns.ts]

SUPPORTS

  • Multiple source files
  • Output to multiple files or a single mega-file
  • Interfaces + Inheritance
  • Type Aliases + Intersections + Unions
  • string, number, boolean, Arrays, any
  • Anonymous types
  • Cross-references to other types
  • kotlinx.serializable
  • kotlinx.datetime
  • Custom package name
  • Enums
  • optional fields

TODO

  • Fully discriminated/disagreeing unions
  • documentation
  • Intended for .d.ts files. Work on safer execution for .ts

FAQs

Package last updated on 21 Feb 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc