File: test.js.md

package info (click to toggle)
node-rollup-plugin-json 5.0.1%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 784 kB
  • sloc: javascript: 469; makefile: 24
file content (95 lines) | stat: -rw-r--r-- 1,913 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Snapshot report for `test/test.js`

The actual snapshot is saved in `test.js.snap`.

Generated by [AVA](https://avajs.dev).

## generates properly formatted code

> Snapshot 1

    `export var validKey = true;␊
    export var nested = {␊
    	subKey: "ok"␊
    };␊
    export var array = [␊
    	1,␊
    	"2"␊
    ];␊
    export default {␊
    	validKey: validKey,␊
    	"invalid-key": 1,␊
    	nested: nested,␊
    	array: array,␊
    	"function": "not used",␊
    	"null": null␊
    };␊
    `

## generates correct code with preferConst

> Snapshot 1

    `export const validKey = true;␊
    export const nested = {␊
    	subKey: "ok"␊
    };␊
    export const array = [␊
    	1,␊
    	"2"␊
    ];␊
    export default {␊
    	validKey: validKey,␊
    	"invalid-key": 1,␊
    	nested: nested,␊
    	array: array,␊
    	"function": "not used",␊
    	"null": null␊
    };␊
    `

## uses custom indent string

> Snapshot 1

    `export var validKey = true;␊
    export var nested = {␊
      subKey: "ok"␊
    };␊
    export var array = [␊
      1,␊
      "2"␊
    ];␊
    export default {␊
      validKey: validKey,␊
      "invalid-key": 1,␊
      nested: nested,␊
      array: array,␊
      "function": "not used",␊
      "null": null␊
    };␊
    `

## generates correct code with compact=true

> Snapshot 1

    'export var validKey=true;export var nested={subKey:"ok"};export var array=[1,"2"];export default{validKey:validKey,"invalid-key":1,nested:nested,array:array,"function":"not used","null":null};'

## generates correct code with namedExports=false

> Snapshot 1

    `export default {␊
    	validKey: true,␊
    	"invalid-key": 1,␊
    	nested: {␊
    		subKey: "ok"␊
    	},␊
    	array: [␊
    		1,␊
    		"2"␊
    	],␊
    	"function": "not used",␊
    	"null": null␊
    };`