// RUNTIME VALIDATORS export function is<T>(input: unknown): input is T; // returns boolean export function assert<T>(input: unknown): T; // throws TypeGuardError export function assertGuard<T>(input: unknown): asserts input is T; export function validate<T>(input: unknown): IValidation<T>; // detailed // JSON FUNCTIONS export namespace json { export function application<T>(): IJsonApplication; //
package com.example; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import java.time.OffsetDateTime; @JsonSerialize public class User { @JsonProperty("createdAt") private OffsetDateTime createdAt; @JsonProperty("id") private String id; @JsonProperty("isAdmin") private Boolean isAdmin; @JsonProperty("karma") private Integer karm
Given JSON sample data, quicktype outputs code for working with that data in Go, TypeScript, C#, Elm, and more.
Sat, Mar 19, 2016 EDITS: Calling toString on Date is for illustrative purposes. There’s a full commented example at the end. Use toJSON method as suggested by Schipperz. Add reviver method as suggested by Anders Ringqvist. So you have a User type in your code. At some point you’re going to want to encode this as JSON. This works as you’d expect. > JSON.stringify({ name: "bob", age: 34, created: ne
はじめに プログラマーなら誰しも、YAML や JSON、XML、Excel ファイル、あるいは独自の DSL などで書いた定義ファイルからコードを自動生成するツールを使用した経験があると思います。 でも、JSON、XML を手で書いていくのはつらい。独自 DSL は覚えるのがつらい。YAML も凝ったことやろうとするとカスタムタグとかいろいろ用意したりしないといけなくて、独自 DSL 化してつらい。Excel ファイルは…… ということで、みんな大好き TypeScript の表現力豊かな記法でそういった定義ファイルが書けて、コードを自動生成できたら幸せなんじゃないだろうかと思い、年末あたりに時間をかけて typhen というツールを作ってみました。 今回はそのご紹介です。 使い方 たとえば、typings/definitions.d.ts に下記のようなインターフェイスがあって、そこか
$ npm install -g $ dts-parser examples/dummy.d.ts nodeType: TopModule moduleName: Top modules: - nodeType: Module moduleName: Foo modules: (empty array) classes: - nodeType: ClassNode className: Bar properties: - nodeType: VariableNode propertyName: x typeAnnotation: nodeType: AnnotatedType typeName: Any typeArguments: (empty array) isArray: false typeParameters: null heritages: implementList: nul
Image Compressor Image Compressor is a free online tool to optimize your photo's size. Image Compression Here are the main steps to compress an image online: - Upload or open the image file you want to compress (JPG, PNG, GIF). - Select compression settings like level, dimensions, format. - Run the compression process to optimize the image. - Download the compressed image file which should now be
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く