0.2.1 • Published 7 months ago

brave-json v0.2.1

Weekly downloads
2
License
MIT
Repository
github
Last release
7 months ago

brave-json

Install

npm install --save brave-json
# or
yarn add brave-json

API

BraveJSON

interface IConverter<Raw, JSON extends JSONValue = JSONValue> {
  toJSON(value: Raw): JSON
  fromJSON(value: JSON): Raw
}

class BraveJSON {
  static readonly DEFAULT_SYMBOL = '$brave-json'

  constructor(
    converter: IConverter<unknown, JSONValue>
  , options?: { symbol?: string = BraveJSON.DEFAULT_SYMBOL }
  )

  stringify(value: unknown, space?: string | number): string
  parse<T>(text: string): T
}
0.2.1

7 months ago

0.2.0

2 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago