## Index

### Variables

- FIRST_CHAR_REGEXP

### Functions

- createStrictSyntaxError
- firstChar
- json
- normalizeJsonSyntaxError

## Variables

### Const FIRST_CHAR_REGEXP

FIRST_CHAR_REGEXP: RegExp = /^[\x20\x09\x0a\x0d]*(.)/

- Defined in home/runner/work/opine/opine/src/middleware/bodyParser/json.ts:51

RegExp to match the first non-space in a string.

Allowed whitespace is defined in RFC 7159:

ws = *( %x20 / ; Space %x09 / ; Horizontal tab %x0A / ; Line feed or New line %x0D ) ; Carriage return

## Functions

### Private createStrictSyntaxError

- createStrictSyntaxError(str: string, char: string): any

- - Defined in home/runner/work/opine/opine/src/middleware/bodyParser/json.ts:158

  Create strict violation syntax error matching native error.

  #### Parameters

  - ##### str: string

  - ##### char: string

  #### Returns any

### Private firstChar

- firstChar(str: string): any

- - Defined in home/runner/work/opine/opine/src/middleware/bodyParser/json.ts:180

  Get the first non-whitespace character in a string.

  #### Parameters

  - ##### str: string

  #### Returns any

### json

- json(options?: any): jsonParser

- - Defined in home/runner/work/opine/opine/src/middleware/bodyParser/json.ts:60

  Create a middleware to parse JSON bodies.

  #### Parameters

  - ##### Default value options: any = {}

  #### Returns jsonParser

### normalizeJsonSyntaxError

- normalizeJsonSyntaxError(error: any, obj: any): any

- - Defined in home/runner/work/opine/opine/src/middleware/bodyParser/json.ts:191

  Normalize a SyntaxError for JSON.parse.

  #### Parameters

  - ##### error: any

  - ##### obj: any

  #### Returns any

Generated using TypeDoc