brave-json
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

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
}

Readme

Keywords

none

Package Sidebar

Install

npm i brave-json

Weekly Downloads

25

Version

0.2.0

License

MIT

Unpacked Size

8.78 kB

Total Files

7

Last publish

Collaborators

  • black_glory