Skip to content

Commit f5e035c

Browse files
committed
Initial revision.
1 parent 56da3ab commit f5e035c

14 files changed

+10389
-99
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
trim_trailing_whitespace = true
7+
end_of_line = lf
8+
insert_final_newline = true
9+
charset = utf-8
10+
11+
[*.{json,js}]
12+
indent_size = 2
13+

.eslintrc.js

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
MIT License
3+
4+
Copyright (c) 2020 David MacCormack
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.
23+
*/
24+
25+
"use strict";
26+
27+
/*
28+
This defines global options. The ./src and ./test directories extend
29+
this file.
30+
*/
31+
32+
const esmConfigFiles = [
33+
"rollup.config.js"
34+
]
35+
36+
module.exports = {
37+
root: true,
38+
extends: ["eslint:recommended", "plugin:prettier/recommended"],
39+
env: {
40+
es6: true
41+
},
42+
ignorePatterns: ["node_modules/", "dist/", "backup/"],
43+
rules: {
44+
"prettier/prettier": "error"
45+
},
46+
overrides: [
47+
{
48+
files: esmConfigFiles,
49+
parserOptions: {
50+
sourceType: "module"
51+
}
52+
},
53+
{
54+
files: ["*.config.js"],
55+
env: {
56+
node: true
57+
}
58+
}
59+
]
60+
}
61+

.gitattributes

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# default to binary
2+
#* binary
3+
4+
# HTML, CSS, etc
5+
*.css text diff=css eol=lf
6+
*.htm text diff=html eol=lf
7+
*.html text diff=html eol=lf
8+
*.js text eol=lf
9+
*.json text eol=lf
10+
11+
# General text
12+
*.xml text eol=lf
13+
*.md text eol=lf
14+
.gitattributes text eol=lf
15+
.gitignore text eol=lf
16+
17+
# Binary
18+
*.gz binary
19+

.gitignore

Lines changed: 10 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,16 @@
1-
# Logs
2-
logs
3-
*.log
4-
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
7-
lerna-debug.log*
81

9-
# Diagnostic reports (https://nodejs.org/api/report.html)
10-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11-
12-
# Runtime data
13-
pids
14-
*.pid
15-
*.seed
16-
*.pid.lock
17-
18-
# Directory for instrumented libs generated by jscoverage/JSCover
19-
lib-cov
20-
21-
# Coverage directory used by tools like istanbul
22-
coverage
23-
*.lcov
24-
25-
# nyc test coverage
26-
.nyc_output
27-
28-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29-
.grunt
30-
31-
# Bower dependency directory (https://bower.io/)
32-
bower_components
33-
34-
# node-waf configuration
35-
.lock-wscript
36-
37-
# Compiled binary addons (https://nodejs.org/api/addons.html)
38-
build/Release
39-
40-
# Dependency directories
2+
# node/npm related
413
node_modules/
42-
jspm_packages/
43-
44-
# TypeScript v1 declaration files
45-
typings/
46-
47-
# TypeScript cache
48-
*.tsbuildinfo
49-
50-
# Optional npm cache directory
51-
.npm
52-
53-
# Optional eslint cache
54-
.eslintcache
55-
56-
# Microbundle cache
57-
.rpt2_cache/
58-
.rts2_cache_cjs/
59-
.rts2_cache_es/
60-
.rts2_cache_umd/
61-
62-
# Optional REPL history
63-
.node_repl_history
64-
65-
# Output of 'npm pack'
664
*.tgz
5+
dist/
6+
coverage/
677

68-
# Yarn Integrity file
69-
.yarn-integrity
70-
71-
# dotenv environment variables file
72-
.env
73-
.env.test
74-
75-
# parcel-bundler cache (https://parceljs.org/)
76-
.cache
77-
78-
# Next.js build output
79-
.next
80-
81-
# Nuxt.js build / generate output
82-
.nuxt
83-
dist
84-
85-
# Gatsby files
86-
.cache/
87-
# Comment in the public line in if your project uses Gatsby and *not* Next.js
88-
# https://nextjs.org/blog/next-9-1#public-directory-support
89-
# public
90-
91-
# vuepress build output
92-
.vuepress/dist
93-
94-
# Serverless directories
95-
.serverless/
96-
97-
# FuseBox cache
98-
.fusebox/
8+
# Eclipse
9+
.project
10+
.settings/
9911

100-
# DynamoDB Local files
101-
.dynamodb/
12+
# VSCode
13+
.vscode/
10214

103-
# TernJS port file
104-
.tern-port
15+
# Misc
16+
backup/

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 jsonurl
3+
Copyright (c) 2020 David MacCormack
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# JSON->URL
2+
[![License: MIT](https://img.shields.io/github/license/jsonurl/jsonurl-js.svg?label=License)](https://opensource.org/licenses/MIT)
3+
4+
## About
5+
RFC8259 describes the JSON data model and interchange format, which is widely
6+
used in application-level protocols including RESTful APIs. It is common for
7+
applications to request resources via the HTTP POST method, with JSON entities,
8+
however, POST is suboptimal for requests which do not modify a resource's
9+
state. JSON->URL defines a text format for the JSON data model suitable for use
10+
within a URL/URI (as described by RFC3986).
11+
12+
## The JavaScript API
13+
JSON->URL is available as a commonjs module (suitable for use in Node), ES6
14+
module, or a script that may be used directly in a browser. The API is the
15+
same for all three.
16+
```js
17+
let p = new JsonURL();
18+
let value = p.parse( "(Hello:World!)" );
19+
```
20+
There are options available, but that's all you need to get started.

babel.config.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
MIT License
3+
4+
Copyright (c) 2020 David MacCormack
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.
23+
*/
24+
25+
"use strict";
26+
27+
module.exports = (api) => {
28+
const isTest = api.env("test");
29+
// You can use isTest to determine what presets and plugins to use.
30+
31+
let opts;
32+
33+
if (isTest) {
34+
opts = {
35+
targets: { node: "current" },
36+
};
37+
}
38+
39+
return {
40+
presets: [["@babel/preset-env", opts]],
41+
exclude: ["node_modules/**"],
42+
};
43+
};

jest.config.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
MIT License
3+
4+
Copyright (c) 2020 David MacCormack
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.
23+
*/
24+
25+
"use strict";
26+
27+
module.exports = {
28+
collectCoverage: true,
29+
};

0 commit comments

Comments
 (0)