0.0.13 • Published 5 years ago

parse-json-with-dates v0.0.13

Weekly downloads
25
License
MIT
Repository
-
Last release
5 years ago

parse-json-with-dates

StatementsBranchesFunctionsLines
StatementsBranchesFunctionsLines

A small utility that parses JSON and converts date fields to Date type.

Documentation

Example

import { parseJsonWithDates } from 'parse-json-with-dates'

const parsed = parseJsonWithDates(
  JSON.stringify({ 'date-field': new Date() }),
  ['date-field']
)

parsed.a.toISOString() // it's a date!
import { parseJsonWithDates } from 'parse-json-with-dates'

type MyDate = {
  a: Date
}

const parsed = parseJsonWithDates<MyDate>(
  JSON.stringify({ 'date-field': new Date() }),
  ['date-field']
)

parsed.a.toISOString() // it's a date!
0.0.13

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago