Create, detect, and validate Firebase.ServerValue
$ npm install --save firebase-server-value
var firebaseServerValue = require('firebase-server-value')
firebaseServerValue.parse({
'.sv': 'timestamp'
}) // => current timestamp
An object deeply equal to Firebase.ServerValue
Checks whether a given value is a valid ServerValue
placeholder.
Required
Type: any
Parse a ServerValue
placeholder into its actual value.
Required
Type: object
An error will be thrown if value is not a valid ServerValue
according to sv.is
.
An object with keys corresponding to the valid '.sv'
placeholders (currently just 'timestamp'
) and the function used by sv.parse
to generate a result as the values. The functions are called with no arguments. They can be overridden to modify the conversion of placeholders to true values.
MIT © Ben Drucker