1.1.1 • Published 7 years ago

@jeemyeong/dataclass v1.1.1

Weekly downloads
1
License
Unlicense
Repository
github
Last release
7 years ago

dataclass npm version

dataclass is like a data class from kotlin

Features

  • Written in TypeScript.

Installation

$ npm i @jeemyeong/dataclass

Usage

class Person {
  name!: string;
  language: string | null = null;
  public constructor(initializer: Initializer<Person>) {
    Object.assign(this, initializer);
  }
}

const p1 = new Person({
  name: "Leo"
}); // OK

const p2 = new Person({
  name: "Leo",
  language: "Korean",
}); // OK

const p3 = new Person({
  name: "Leo",
  age: 30 // error
});
1.1.1

7 years ago

1.1.0

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago