identifier-js 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/package.json +35 -0
- package/readme.md +17 -0
- package/rfc3986-rfc3987-abnf.yml +295 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 SorinGFS
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "identifier-js",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "A RFC3986 / RFC3987 compliant fast parser/validator/resolver/composer for NodeJS and browser.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"IRI",
|
|
7
|
+
"URI",
|
|
8
|
+
"IRI-reference",
|
|
9
|
+
"URI-reference",
|
|
10
|
+
"ipv4",
|
|
11
|
+
"ipv6",
|
|
12
|
+
"uuid",
|
|
13
|
+
"parser",
|
|
14
|
+
"validator",
|
|
15
|
+
"RFC",
|
|
16
|
+
"3987",
|
|
17
|
+
"RFC",
|
|
18
|
+
"3986"
|
|
19
|
+
],
|
|
20
|
+
"homepage": "https://github.com/SorinGFS/identifier-js#readme",
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/SorinGFS/identifier-js/issues"
|
|
23
|
+
},
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/SorinGFS/identifier-js.git"
|
|
27
|
+
},
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"author": "SorinGFS",
|
|
30
|
+
"type": "commonjs",
|
|
31
|
+
"main": "index.js",
|
|
32
|
+
"scripts": {
|
|
33
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
34
|
+
}
|
|
35
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
|
|
3
|
+
title: Identifier JS
|
|
4
|
+
|
|
5
|
+
description: A RFC3986 / RFC3987 compliant fast parser/validator/resolver/composer for NodeJS and browser.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
A fully RFC [3986](https://datatracker.ietf.org/doc/html/rfc3986.html)/[3897](https://datatracker.ietf.org/doc/html/rfc3987.html) compliant URI/IRI parser, validator, resolver and composer, along with other identifier utilities.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash title="console"
|
|
16
|
+
npm i identifier-js
|
|
17
|
+
```
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
URI-reference:
|
|
2
|
+
syntax: |
|
|
3
|
+
URI / relative-ref
|
|
4
|
+
description: URI reference (full or relative).
|
|
5
|
+
URI:
|
|
6
|
+
syntax: |
|
|
7
|
+
scheme ":" hier-part [ "?" query ] [ "#" fragment ]
|
|
8
|
+
description: Full URI (RFC3986).
|
|
9
|
+
absolute-URI:
|
|
10
|
+
syntax: |
|
|
11
|
+
scheme ":" hier-part [ "?" query ]
|
|
12
|
+
description: Absolute URI (Full URI without fragment).
|
|
13
|
+
relative-ref:
|
|
14
|
+
syntax: |
|
|
15
|
+
relative-part [ "?" query ] [ "#" fragment ]
|
|
16
|
+
description: Relative reference (RFC3986).
|
|
17
|
+
hier-part:
|
|
18
|
+
syntax: |
|
|
19
|
+
"//" authority path-abempty
|
|
20
|
+
/ path-absolute
|
|
21
|
+
/ path-rootless
|
|
22
|
+
/ path-empty
|
|
23
|
+
description: Hierarchical part of URI.
|
|
24
|
+
relative-part:
|
|
25
|
+
syntax: |
|
|
26
|
+
"//" authority path-abempty
|
|
27
|
+
/ path-absolute
|
|
28
|
+
/ path-noscheme
|
|
29
|
+
/ path-empty
|
|
30
|
+
description: Relative hierarchical part.
|
|
31
|
+
authority:
|
|
32
|
+
syntax: |
|
|
33
|
+
[ userinfo "@" ] host [ ":" port ]
|
|
34
|
+
description: Authority component.
|
|
35
|
+
userinfo:
|
|
36
|
+
syntax: |
|
|
37
|
+
*( unreserved / pct-encoded / sub-delims / ":" )
|
|
38
|
+
description: User information.
|
|
39
|
+
host:
|
|
40
|
+
syntax: |
|
|
41
|
+
IP-literal / IPv4address / reg-name
|
|
42
|
+
description: Host component.
|
|
43
|
+
reg-name:
|
|
44
|
+
syntax: |
|
|
45
|
+
*( unreserved / pct-encoded / sub-delims )
|
|
46
|
+
description: Registered name.
|
|
47
|
+
path:
|
|
48
|
+
syntax: |
|
|
49
|
+
path-abempty
|
|
50
|
+
/ path-absolute
|
|
51
|
+
/ path-noscheme
|
|
52
|
+
/ path-rootless
|
|
53
|
+
/ path-empty
|
|
54
|
+
description: Path component.
|
|
55
|
+
path-abempty:
|
|
56
|
+
syntax: |
|
|
57
|
+
*( "/" segment )
|
|
58
|
+
description: Zero or more "/" segment.
|
|
59
|
+
path-absolute:
|
|
60
|
+
syntax: |
|
|
61
|
+
"/" [ segment-nz *( "/" segment ) ]
|
|
62
|
+
description: Absolute path.
|
|
63
|
+
path-noscheme:
|
|
64
|
+
syntax: |
|
|
65
|
+
segment-nz-nc *( "/" segment )
|
|
66
|
+
description: Path without scheme.
|
|
67
|
+
path-rootless:
|
|
68
|
+
syntax: |
|
|
69
|
+
segment-nz *( "/" segment )
|
|
70
|
+
description: Rootless path.
|
|
71
|
+
path-empty:
|
|
72
|
+
syntax: |
|
|
73
|
+
0<pchar>
|
|
74
|
+
description: Empty path.
|
|
75
|
+
segment:
|
|
76
|
+
syntax: |
|
|
77
|
+
*pchar
|
|
78
|
+
description: Path segment.
|
|
79
|
+
segment-nz:
|
|
80
|
+
syntax: |
|
|
81
|
+
1*pchar
|
|
82
|
+
description: Non-zero-length segment.
|
|
83
|
+
segment-nz-nc:
|
|
84
|
+
syntax: |
|
|
85
|
+
1*( unreserved / pct-encoded / sub-delims / "@" )
|
|
86
|
+
description: Non-zero-length segment without colon.
|
|
87
|
+
pchar:
|
|
88
|
+
syntax: |
|
|
89
|
+
unreserved / pct-encoded / sub-delims / ":" / "@"
|
|
90
|
+
description: Path character.
|
|
91
|
+
query:
|
|
92
|
+
syntax: |
|
|
93
|
+
*( pchar / "/" / "?" )
|
|
94
|
+
description: Query component.
|
|
95
|
+
fragment:
|
|
96
|
+
syntax: |
|
|
97
|
+
*( pchar / "/" / "?" )
|
|
98
|
+
description: Fragment component.
|
|
99
|
+
IRI-reference:
|
|
100
|
+
syntax: |
|
|
101
|
+
IRI / irelative-ref
|
|
102
|
+
description: IRI reference (full or relative).
|
|
103
|
+
IRI:
|
|
104
|
+
syntax: |
|
|
105
|
+
scheme ":" ihier-part [ "?" iquery ] [ "#" ifragment ]
|
|
106
|
+
description: Top-level IRI per RFC3987.
|
|
107
|
+
ihier-part:
|
|
108
|
+
syntax: |
|
|
109
|
+
"//" iauthority ipath-abempty
|
|
110
|
+
/ ipath-absolute
|
|
111
|
+
/ ipath-rootless
|
|
112
|
+
/ ipath-empty
|
|
113
|
+
description: Hierarchical part (authority and path) of the IRI.
|
|
114
|
+
absolute-IRI:
|
|
115
|
+
syntax: |
|
|
116
|
+
scheme ":" ihier-part [ "?" iquery ]
|
|
117
|
+
description: Absolute IRI (Full IRI without fragment).
|
|
118
|
+
irelative-ref:
|
|
119
|
+
syntax: |
|
|
120
|
+
irelative-part [ "?" iquery ] [ "#" ifragment ]
|
|
121
|
+
description: Relative reference (with optional query and fragment).
|
|
122
|
+
irelative-part:
|
|
123
|
+
syntax: |
|
|
124
|
+
"//" iauthority ipath-abempty
|
|
125
|
+
/ ipath-absolute
|
|
126
|
+
/ ipath-noscheme
|
|
127
|
+
/ ipath-empty
|
|
128
|
+
description: The part of a relative reference without query or fragment.
|
|
129
|
+
iauthority:
|
|
130
|
+
syntax: |
|
|
131
|
+
[ iuserinfo "@" ] ihost [ ":" port ]
|
|
132
|
+
description: 'Authority: optional userinfo, host, and optional port.'
|
|
133
|
+
iuserinfo:
|
|
134
|
+
syntax: |
|
|
135
|
+
*( iunreserved / pct-encoded / sub-delims / ":" )
|
|
136
|
+
description: User info (iauthority before '@', may include percent-encoding and colon).
|
|
137
|
+
ihost:
|
|
138
|
+
syntax: |
|
|
139
|
+
IP-literal / IPv4address / ireg-name
|
|
140
|
+
description: 'Host: IP-literal (IPv6/IPvFuture), IPv4 address, or internationalized name.'
|
|
141
|
+
ireg-name:
|
|
142
|
+
syntax: |
|
|
143
|
+
*( iunreserved / pct-encoded / sub-delims )
|
|
144
|
+
description: Internationalized host name (allows Unicode via ucschar in iunreserved).
|
|
145
|
+
ipath:
|
|
146
|
+
syntax: |
|
|
147
|
+
ipath-abempty
|
|
148
|
+
/ ipath-absolute
|
|
149
|
+
/ ipath-noscheme
|
|
150
|
+
/ ipath-rootless
|
|
151
|
+
/ ipath-empty
|
|
152
|
+
description: Path component of IRI (hierarchical).
|
|
153
|
+
ipath-abempty:
|
|
154
|
+
syntax: |
|
|
155
|
+
*( "/" isegment )
|
|
156
|
+
description: Zero or more '/'-prefixed segments.
|
|
157
|
+
ipath-absolute:
|
|
158
|
+
syntax: |
|
|
159
|
+
"/" [ isegment-nz *( "/" isegment ) ]
|
|
160
|
+
description: Path starting with '/', not '//' (absolute path).
|
|
161
|
+
ipath-noscheme:
|
|
162
|
+
syntax: |
|
|
163
|
+
isegment-nz-nc *( "/" isegment )
|
|
164
|
+
description: Path with no scheme (first segment not empty, no colon ':').
|
|
165
|
+
ipath-rootless:
|
|
166
|
+
syntax: |
|
|
167
|
+
isegment-nz *( "/" isegment )
|
|
168
|
+
description: Path beginning with a non-zero-length segment.
|
|
169
|
+
ipath-empty:
|
|
170
|
+
syntax: |
|
|
171
|
+
0<ipchar>
|
|
172
|
+
description: Empty path (no characters).
|
|
173
|
+
isegment:
|
|
174
|
+
syntax: |
|
|
175
|
+
*ipchar
|
|
176
|
+
description: Segment (zero or more ipchar characters).
|
|
177
|
+
isegment-nz:
|
|
178
|
+
syntax: |
|
|
179
|
+
1*ipchar
|
|
180
|
+
description: Non-zero-length segment.
|
|
181
|
+
isegment-nz-nc:
|
|
182
|
+
syntax: |
|
|
183
|
+
1*( iunreserved / pct-encoded / sub-delims / "@" )
|
|
184
|
+
description: Non-zero-length segment with no colon.
|
|
185
|
+
ipchar:
|
|
186
|
+
syntax: |
|
|
187
|
+
iunreserved / pct-encoded / sub-delims / ":" / "@"
|
|
188
|
+
description: Character in a path segment (unreserved, pct-encoded, or delimiter).
|
|
189
|
+
iquery:
|
|
190
|
+
syntax: |
|
|
191
|
+
*( ipchar / iprivate / "/" / "?" )
|
|
192
|
+
description: Query component (allows private-use characters).
|
|
193
|
+
ifragment:
|
|
194
|
+
syntax: |
|
|
195
|
+
*( ipchar / "/" / "?" )
|
|
196
|
+
description: Fragment identifier component.
|
|
197
|
+
iunreserved:
|
|
198
|
+
syntax: |
|
|
199
|
+
ALPHA / DIGIT / "-" / "." / "_" / "~" / ucschar
|
|
200
|
+
description: Unreserved characters (including Unicode ucschar).
|
|
201
|
+
ucschar:
|
|
202
|
+
syntax: |
|
|
203
|
+
%xA0-D7FF / %xF900-FDCF / %xFDF0-FFEF
|
|
204
|
+
/ %x10000-1FFFD / %x20000-2FFFD / %x30000-3FFFD
|
|
205
|
+
/ %x40000-4FFFD / %x50000-5FFFD / %x60000-6FFFD
|
|
206
|
+
/ %x70000-7FFFD / %x80000-8FFFD / %x90000-9FFFD
|
|
207
|
+
/ %xA0000-AFFFD / %xB0000-BFFFD / %xC0000-CFFFD
|
|
208
|
+
/ %xD0000-DFFFD / %xE1000-EFFFD
|
|
209
|
+
description: Unicode code point ranges allowed in IRIs (excludes private-use).
|
|
210
|
+
iprivate:
|
|
211
|
+
syntax: |
|
|
212
|
+
%xE000-F8FF / %xF0000-FFFFD / %x100000-10FFFD
|
|
213
|
+
description: Private-use Unicode ranges (allowed in IRI but not URI).
|
|
214
|
+
scheme:
|
|
215
|
+
syntax: |
|
|
216
|
+
ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
|
|
217
|
+
description: Scheme (ASCII letters/digits) from RFC3986.
|
|
218
|
+
port:
|
|
219
|
+
syntax: |
|
|
220
|
+
*DIGIT
|
|
221
|
+
description: Port number (ASCII digits).
|
|
222
|
+
IP-literal:
|
|
223
|
+
syntax: |
|
|
224
|
+
"[" ( IPv6address / IPvFuture ) "]"
|
|
225
|
+
description: IP literal (IPv6 or IPvFuture) in brackets (RFC3986).
|
|
226
|
+
IPvFuture:
|
|
227
|
+
syntax: |
|
|
228
|
+
"v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )
|
|
229
|
+
description: IPvFuture address (versioned IPv6 form, per RFC3986).
|
|
230
|
+
IPv6address:
|
|
231
|
+
syntax: |
|
|
232
|
+
''
|
|
233
|
+
6( h16 ":" ) ls32
|
|
234
|
+
/ "::" 5( h16 ":" ) ls32
|
|
235
|
+
/ [ h16 ] "::" 4( h16 ":" ) ls32
|
|
236
|
+
/ [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
|
|
237
|
+
/ [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
|
|
238
|
+
/ [ *3( h16 ":" ) h16 ] "::" h16 ":" ls32
|
|
239
|
+
/ [ *4( h16 ":" ) h16 ] "::" ls32
|
|
240
|
+
/ [ *5( h16 ":" ) h16 ] "::" h16
|
|
241
|
+
/ [ *6( h16 ":" ) h16 ] "::"
|
|
242
|
+
description: IPv6 address (full forms from RFC3986).
|
|
243
|
+
h16:
|
|
244
|
+
syntax: |
|
|
245
|
+
1*4HEXDIG
|
|
246
|
+
description: 1 to 4 hexadecimal digits (16-bit part).
|
|
247
|
+
ls32:
|
|
248
|
+
syntax: |
|
|
249
|
+
( h16 ":" h16 ) / IPv4address
|
|
250
|
+
description: Least-significant 32 bits of IPv6 (two h16 or an IPv4).
|
|
251
|
+
IPv4address:
|
|
252
|
+
syntax: |
|
|
253
|
+
dec-octet "." dec-octet "." dec-octet "." dec-octet
|
|
254
|
+
description: IPv4 address (decimal dotted-quad).
|
|
255
|
+
dec-octet:
|
|
256
|
+
syntax: |
|
|
257
|
+
DIGIT
|
|
258
|
+
/ %x31-39 DIGIT
|
|
259
|
+
/ "1" 2DIGIT
|
|
260
|
+
/ "2" %x30-34 DIGIT
|
|
261
|
+
/ "25" %x30-35
|
|
262
|
+
description: Decimal octet (0-255) for IPv4 (from RFC3986).
|
|
263
|
+
pct-encoded:
|
|
264
|
+
syntax: |
|
|
265
|
+
"%" HEXDIG HEXDIG
|
|
266
|
+
description: Percent-encoded octet (hexadecimal encoding).
|
|
267
|
+
unreserved:
|
|
268
|
+
syntax: |
|
|
269
|
+
ALPHA / DIGIT / "-" / "." / "_" / "~"
|
|
270
|
+
description: Unreserved ASCII characters (RFC3986).
|
|
271
|
+
reserved:
|
|
272
|
+
syntax: |
|
|
273
|
+
gen-delims / sub-delims
|
|
274
|
+
description: Reserved characters (RFC3986).
|
|
275
|
+
gen-delims:
|
|
276
|
+
syntax: |
|
|
277
|
+
":" / "/" / "?" / "#" / "[" / "]" / "@"
|
|
278
|
+
description: General delimiters (RFC3986).
|
|
279
|
+
sub-delims:
|
|
280
|
+
syntax: |
|
|
281
|
+
"!" / "&" / "$" / "'" / "(" / ")"
|
|
282
|
+
/ "*" / "+" / "," / ";" / "="
|
|
283
|
+
description: Subcomponent delimiters (RFC3986).
|
|
284
|
+
ALPHA:
|
|
285
|
+
syntax: |
|
|
286
|
+
%x41-5A / %x61-7A
|
|
287
|
+
description: ASCII letters A-Z / a-z (RFC5234).
|
|
288
|
+
DIGIT:
|
|
289
|
+
syntax: |
|
|
290
|
+
%x30-39
|
|
291
|
+
description: ASCII digits 0-9 (RFC5234).
|
|
292
|
+
HEXDIG:
|
|
293
|
+
syntax: |
|
|
294
|
+
DIGIT / %x41-46 / %x61-66
|
|
295
|
+
description: Hexadecimal digits (0-9, A-F, a-f) (RFC5234).
|