Skip to content

nark3d/typeVO

Repository files navigation

type-vo

A generic set of Typescript Value Objects for use in any project.

A work in progress, please check back soon

Wikipedia

When people exchange business cards, they generally do not distinguish between each unique card; they only are concerned about the information printed on the card. In this context, business cards are value objects.

Table of contents

Installation

Not published to NPM yet!

Philosophy

To make this code consistent, we've stuck to a certain set of restrictions:

Rules

Disclaimer: This is my interpretation of "The rules".

Must be immutable

The value object's value must be set at the time of construction. At no point should the value be mutated within the object.

Must contain one value

The value object can only be constructed from one value, this can be any of the following types:

  • boolean
  • integer
  • float/double
  • string
  • array
  • object
  • resource
  • null

Can instantiate new object from value

Rather than mutating, a new object can be instantiated from an existing one.

Work in progress

More documentation will follow...

About

Typescript Value Objects

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published