-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e6cf45e
commit 682ff59
Showing
10 changed files
with
172 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Tests/Experimental |
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 |
---|---|---|
@@ -1,2 +1,17 @@ | ||
|
||
**Work In Progress** | ||
# HJSON [![Badge License]][License] | ||
|
||
*A parser / stringifier for @hjson.* | ||
|
||
<br> | ||
|
||
|
||
|
||
<!-----------------------------------------------------------------------------> | ||
|
||
[License]: LICENSE | ||
|
||
|
||
<!----------------------------------[ Badges ]---------------------------------> | ||
|
||
[Badge License]: https://img.shields.io/badge/License-AGPL3-015d93.svg?style=for-the-badge&labelColor=blue |
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 |
---|---|---|
@@ -1,2 +1,66 @@ | ||
|
||
**Work In Progress** | ||
# HJSON [![Badge License]][License] | ||
|
||
*A parser / stringifier for **[HJSON]**.* | ||
|
||
<br> | ||
|
||
## Import | ||
|
||
```JavaScript | ||
import HJson from 'https://deno.land/x/hjson/mod.ts' | ||
``` | ||
|
||
<br> | ||
<br> | ||
|
||
## Parsing | ||
|
||
```JavaScript | ||
import { parse } from 'https://deno.land/x/hjson/mod.ts' | ||
|
||
const { log } = console; | ||
|
||
const hjson = `{ | ||
some : 3 | ||
variables : [ | ||
with , | ||
a | ||
lot | ||
] | ||
inside : { | ||
them : 9 | ||
} | ||
}` | ||
|
||
log(parse(hjson)); | ||
|
||
|
||
/* | ||
* { | ||
* some : 3 , | ||
* variables : [ 'with' , 'a' , 'lot' ] , | ||
* inside : { them : 9 } | ||
* } | ||
*/ | ||
``` | ||
|
||
<br> | ||
<br> | ||
|
||
## Stringification | ||
|
||
**Work In Progress** | ||
|
||
<br> | ||
|
||
|
||
<!-----------------------------------------------------------------------------> | ||
|
||
[License]: LICENSE | ||
[HJSON]: https://hjson.github.io/ | ||
|
||
|
||
<!----------------------------------[ Badges ]---------------------------------> | ||
|
||
[Badge License]: https://img.shields.io/badge/License-AGPL3-015d93.svg?style=for-the-badge&labelColor=blue |
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,33 @@ | ||
|
||
const raw = `{ | ||
AnArray : [ | ||
10, | ||
2 | ||
3 | ||
4, | ||
5 | ||
] | ||
} | ||
` | ||
|
||
const model = { | ||
AnArray : [ 10 , 2 , 3 , 4 , 5 ] | ||
} | ||
|
||
|
||
import { assertEquals } from 'Assert'; | ||
import { parse } from '../Source/mod.ts' | ||
|
||
|
||
Deno.test('Array Parsing Test',() => { | ||
|
||
const parsed = parse(raw); | ||
|
||
assertEquals(parsed,model); | ||
}); |
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,30 @@ | ||
|
||
const raw = `{ | ||
some : 3 | ||
variables : [ | ||
with , | ||
a | ||
lot | ||
] | ||
inside : { | ||
them : 9 | ||
} | ||
}` | ||
|
||
const model = { | ||
some : 3 , | ||
variables : [ 'with' , 'a' , 'lot' ] , | ||
inside : { them : 9 } | ||
} | ||
|
||
|
||
import { assertEquals } from 'Assert'; | ||
import { parse } from '../Source/mod.ts' | ||
|
||
|
||
Deno.test('Example Parsing Test',() => { | ||
|
||
const parsed = parse(raw); | ||
|
||
assertEquals(parsed,model); | ||
}); |