-
Notifications
You must be signed in to change notification settings - Fork 479
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve nip11 validation + add json highlighting block
- Loading branch information
Showing
191 changed files
with
1,167 additions
and
947 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
declare module 'json-source-map' { | ||
// Options for parsing JSON, allowing for custom behavior such as bigint support and jsonc (JSON with comments). | ||
export interface ParseOptions { | ||
bigint?: boolean; // Specifies if BigInt values should be parsed as native BigInt types. | ||
jsonc?: boolean; // Specifies if JSON with comments (jsonc) should be correctly parsed. | ||
} | ||
|
||
// Options for stringifying values into JSON, allowing for customization of the output. | ||
export interface StringifyOptions { | ||
space?: string | number; // Specifies the indentation for beautifying the output JSON. | ||
es6?: boolean; // Specifies if ES6 features (e.g., Set, Map) are allowed in the output. | ||
} | ||
|
||
// The result of parsing JSON, including the data and pointers to various elements within the JSON string. | ||
export interface ParseResult { | ||
data: any; // The parsed data as a JavaScript object. | ||
pointers: { | ||
[key: string]: { | ||
value: { // The starting position of the value in the original JSON string. | ||
line: number; | ||
column: number; | ||
pos: number; | ||
}; | ||
valueEnd: { // The ending position of the value in the original JSON string. | ||
line: number; | ||
column: number; | ||
pos: number; | ||
}; | ||
key?: { // The starting position of the key in the original JSON string (for object properties). | ||
line: number; | ||
column: number; | ||
pos: number; | ||
}; | ||
keyEnd?: { // The ending position of the key in the original JSON string (for object properties). | ||
line: number; | ||
column: number; | ||
pos: number; | ||
}; | ||
}; | ||
}; | ||
} | ||
|
||
// The result of stringifying a JavaScript value into JSON, including the JSON string and pointers to elements. | ||
export interface StringifyResult { | ||
json: string; // The generated JSON string. | ||
pointers: { | ||
[key: string]: { | ||
value: { // The starting position of the value in the resulting JSON string. | ||
line: number; | ||
column: number; | ||
pos: number; | ||
}; | ||
valueEnd: { // The ending position of the value in the resulting JSON string. | ||
line: number; | ||
column: number; | ||
pos: number; | ||
}; | ||
key?: { // The starting position of the key in the resulting JSON string (for object properties). | ||
line: number; | ||
column: number; | ||
pos: number; | ||
}; | ||
keyEnd?: { // The ending position of the key in the resulting JSON string (for object properties). | ||
line: number; | ||
column: number; | ||
pos: number; | ||
}; | ||
}; | ||
}; | ||
} | ||
|
||
// Parses a JSON string into a JavaScript object, with options for handling BigInt and comments (jsonc). | ||
export function parse(json: string, _?: any, options?: ParseOptions): ParseResult; | ||
|
||
// Converts a JavaScript value to a JSON string, with options for output formatting and ES6 feature inclusion. | ||
export function stringify(value: any, _?: any, options?: string | number | StringifyOptions): StringifyResult; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apps/gui/src/lib/components/partials/AutoSuggestRelaysCompact.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apps/gui/src/lib/components/partials/AutoSuggestRelaysTable.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
apps/gui/src/lib/components/partials/JsonHighlighter.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<script lang="ts"> | ||
// import { onMount } from 'svelte'; | ||
import { JsonHighlighter, type AjvResult } from '$lib/utils/JsonHighlighter.js'; | ||
export let jsonString: string = ''; | ||
export let ajvResult: AjvResult = { errors: [] }; | ||
let highlightedHtml = ''; | ||
$: highlightedHtml = JsonHighlighter.highlight(jsonString, ajvResult); | ||
</script> | ||
|
||
{@html highlightedHtml} | ||
|
||
<style></style> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apps/gui/src/lib/components/partials/MonitorProfileCompact.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
apps/gui/src/lib/components/partials/relay-single/OperatorRelay.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apps/gui/src/lib/components/partials/relay-single/RelayCheck.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.