Skip to content

Commit edafa8f

Browse files
authored
fix #105 - validate all strings (#117)
any string that is not empty, including whitespace strings, should validate?
1 parent 41c0f66 commit edafa8f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/few-emus-live.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"codemirror-json-schema": patch
3+
---
4+
5+
validate all strings with length > 1

src/features/validation.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export class JSONValidation {
128128
const text = view.state.doc.toString();
129129

130130
// ignore blank json strings
131-
if (!text || text.trim().length < 3) return [];
131+
if (!text || !text.length) return [];
132132

133133
const json = this.parser(view.state);
134134

0 commit comments

Comments
 (0)