Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

fast-json-stringify

Package Overview
Dependencies
0
Maintainers
1
Versions
160
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.6.0 to 0.7.0

6

example.js

@@ -19,4 +19,3 @@ 'use strict'

now: {
type: 'string',
required: true
type: 'string'
},

@@ -26,3 +25,4 @@ reg: {

}
}
},
required: ['now']
})

@@ -29,0 +29,0 @@

@@ -161,3 +161,3 @@ 'use strict'

if (schema.properties[key].required) {
if (schema.required && schema.required.indexOf(key) !== -1) {
code += `

@@ -164,0 +164,0 @@ } else {

{
"name": "fast-json-stringify",
"version": "0.6.0",
"version": "0.7.0",
"description": "Stringify your JSON at max speed",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -72,9 +72,9 @@ # fast-json-stringify  [![Build Status](https://travis-ci.org/mcollina/fast-json-stringify.svg)](https://travis-ci.org/mcollina/fast-json-stringify)

| Instance | Serialized as |
| -----------|---------------------------------------------|
| Instance | Serialized as |
| -----------|------------------------------|
| `Date` | `string` via `toISOString()` |
| `RegExp` | `string` |
| `RegExp` | `string` |
#### Required
You can set specific fields of an object as `required` in your schema, by adding `required: true` inside the key properties.
You can set specific fields of an object as required in your schema, by adding the field name inside the `required` array in your schema.
Example:

@@ -90,6 +90,6 @@ ```javascript

mail: {
type: 'string',
required: true
type: 'string'
}
}
},
required: ['mail']
}

@@ -96,0 +96,0 @@ ```

@@ -266,4 +266,3 @@ 'use strict'

str: {
type: 'string',
required: true
type: 'string'
},

@@ -273,3 +272,4 @@ num: {

}
}
},
required: ['str']
}

@@ -276,0 +276,0 @@ const stringify = build(schema)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc