bare-url 2.0.8 → 2.1.0
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/CMakeLists.txt +3 -7
- package/global.js +1 -0
- package/index.js +94 -49
- package/lib/errors.js +16 -8
- package/package.json +12 -9
- package/prebuilds/android-arm/bare-url.bare +0 -0
- package/prebuilds/android-arm64/bare-url.bare +0 -0
- package/prebuilds/android-ia32/bare-url.bare +0 -0
- package/prebuilds/android-x64/bare-url.bare +0 -0
- package/prebuilds/darwin-arm64/bare-url.bare +0 -0
- package/prebuilds/darwin-x64/bare-url.bare +0 -0
- package/prebuilds/ios-arm64/bare-url.bare +0 -0
- package/prebuilds/ios-arm64-simulator/bare-url.bare +0 -0
- package/prebuilds/ios-x64-simulator/bare-url.bare +0 -0
- package/prebuilds/linux-arm64/bare-url.bare +0 -0
- package/prebuilds/linux-x64/bare-url.bare +0 -0
- package/prebuilds/win32-arm64/bare-url.bare +0 -0
- package/prebuilds/win32-x64/bare-url.bare +0 -0
- package/vendor/liburl/CMakeLists.txt +0 -81
- package/vendor/liburl/include/url/character-set.h +0 -41
- package/vendor/liburl/include/url/idna.h +0 -14
- package/vendor/liburl/include/url/infra.h +0 -141
- package/vendor/liburl/include/url/parse.h +0 -1406
- package/vendor/liburl/include/url/percent-encode.h +0 -567
- package/vendor/liburl/include/url/punycode.h +0 -21
- package/vendor/liburl/include/url/serialize.h +0 -91
- package/vendor/liburl/include/url/type.h +0 -61
- package/vendor/liburl/include/url.h +0 -147
- package/vendor/liburl/src/url.c +0 -42
- package/vendor/libutf/CMakeLists.txt +0 -93
- package/vendor/libutf/include/utf/string.h +0 -786
- package/vendor/libutf/include/utf.h +0 -132
- package/vendor/libutf/src/ascii/validate.c +0 -47
- package/vendor/libutf/src/endianness.c +0 -19
- package/vendor/libutf/src/endianness.h +0 -54
- package/vendor/libutf/src/latin1/convert-to-utf16.c +0 -37
- package/vendor/libutf/src/latin1/convert-to-utf32.c +0 -34
- package/vendor/libutf/src/latin1/convert-to-utf8.c +0 -58
- package/vendor/libutf/src/latin1/length-from-utf16.c +0 -26
- package/vendor/libutf/src/latin1/length-from-utf32.c +0 -26
- package/vendor/libutf/src/latin1/length-from-utf8.c +0 -34
- package/vendor/libutf/src/utf16/convert-to-latin1.c +0 -41
- package/vendor/libutf/src/utf16/convert-to-utf32.c +0 -56
- package/vendor/libutf/src/utf16/convert-to-utf8.c +0 -75
- package/vendor/libutf/src/utf16/length-from-latin1.c +0 -26
- package/vendor/libutf/src/utf16/length-from-utf32.c +0 -33
- package/vendor/libutf/src/utf16/length-from-utf8.c +0 -38
- package/vendor/libutf/src/utf16/validate.c +0 -53
- package/vendor/libutf/src/utf32/convert-to-latin1.c +0 -40
- package/vendor/libutf/src/utf32/convert-to-utf16.c +0 -56
- package/vendor/libutf/src/utf32/convert-to-utf8.c +0 -71
- package/vendor/libutf/src/utf32/length-from-latin1.c +0 -26
- package/vendor/libutf/src/utf32/length-from-utf16.c +0 -35
- package/vendor/libutf/src/utf32/length-from-utf8.c +0 -35
- package/vendor/libutf/src/utf32/validate.c +0 -39
- package/vendor/libutf/src/utf8/convert-to-latin1.c +0 -70
- package/vendor/libutf/src/utf8/convert-to-utf16.c +0 -95
- package/vendor/libutf/src/utf8/convert-to-utf32.c +0 -110
- package/vendor/libutf/src/utf8/length-from-latin1.c +0 -32
- package/vendor/libutf/src/utf8/length-from-utf16.c +0 -44
- package/vendor/libutf/src/utf8/length-from-utf32.c +0 -35
- package/vendor/libutf/src/utf8/string.c +0 -149
- package/vendor/libutf/src/utf8/validate.c +0 -107
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
#ifndef URL_INFRA_H
|
|
2
|
-
#define URL_INFRA_H
|
|
3
|
-
|
|
4
|
-
#include <stdbool.h>
|
|
5
|
-
#include <utf.h>
|
|
6
|
-
|
|
7
|
-
#include "character-set.h"
|
|
8
|
-
|
|
9
|
-
// https://infra.spec.whatwg.org/#ascii-alpha
|
|
10
|
-
static url_character_set_t url__ascii_alpha_character_set = {
|
|
11
|
-
// 00 01 02 03 04 05 06 07
|
|
12
|
-
0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00,
|
|
13
|
-
// 08 09 0a 0b 0c 0d 0e 0f
|
|
14
|
-
0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00,
|
|
15
|
-
// 10 11 12 13 14 15 16 17
|
|
16
|
-
0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00,
|
|
17
|
-
// 18 19 1a 1b 1c 1d 1e 1f
|
|
18
|
-
0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00,
|
|
19
|
-
// 20 21 22 23 24 25 26 27
|
|
20
|
-
0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00,
|
|
21
|
-
// 28 29 2a 2b 2c 2d 2e 2f
|
|
22
|
-
0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00,
|
|
23
|
-
// 30 31 32 33 34 35 36 37
|
|
24
|
-
0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00,
|
|
25
|
-
// 38 39 3a 3b 3c 3d 3e 3f
|
|
26
|
-
0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00,
|
|
27
|
-
// 40 41 42 43 44 45 46 47
|
|
28
|
-
0x00 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80,
|
|
29
|
-
// 48 49 4a 4b 4c 4d 4e 4f
|
|
30
|
-
0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80,
|
|
31
|
-
// 50 51 52 53 54 55 56 57
|
|
32
|
-
0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80,
|
|
33
|
-
// 58 59 5a 5b 5c 5d 5e 5f
|
|
34
|
-
0x01 | 0x02 | 0x04 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00,
|
|
35
|
-
// 60 61 62 63 64 65 66 67
|
|
36
|
-
0x00 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80,
|
|
37
|
-
// 68 69 6a 6b 6c 6d 6e 6f
|
|
38
|
-
0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80,
|
|
39
|
-
// 70 71 72 73 74 75 76 77
|
|
40
|
-
0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80,
|
|
41
|
-
// 78 79 7a
|
|
42
|
-
0x01 | 0x02 | 0x04,
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
// https://infra.spec.whatwg.org/#ascii-alphanumeric
|
|
46
|
-
static url_character_set_t url__ascii_alphanumeric_character_set = {
|
|
47
|
-
// 00 01 02 03 04 05 06 07
|
|
48
|
-
0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00,
|
|
49
|
-
// 08 09 0a 0b 0c 0d 0e 0f
|
|
50
|
-
0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00,
|
|
51
|
-
// 10 11 12 13 14 15 16 17
|
|
52
|
-
0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00,
|
|
53
|
-
// 18 19 1a 1b 1c 1d 1e 1f
|
|
54
|
-
0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00,
|
|
55
|
-
// 20 21 22 23 24 25 26 27
|
|
56
|
-
0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00,
|
|
57
|
-
// 28 29 2a 2b 2c 2d 2e 2f
|
|
58
|
-
0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00,
|
|
59
|
-
// 30 31 32 33 34 35 36 37
|
|
60
|
-
0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80,
|
|
61
|
-
// 38 39 3a 3b 3c 3d 3e 3f
|
|
62
|
-
0x01 | 0x02 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00,
|
|
63
|
-
// 40 41 42 43 44 45 46 47
|
|
64
|
-
0x00 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80,
|
|
65
|
-
// 48 49 4a 4b 4c 4d 4e 4f
|
|
66
|
-
0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80,
|
|
67
|
-
// 50 51 52 53 54 55 56 57
|
|
68
|
-
0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80,
|
|
69
|
-
// 58 59 5a 5b 5c 5d 5e 5f
|
|
70
|
-
0x01 | 0x02 | 0x04 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00,
|
|
71
|
-
// 60 61 62 63 64 65 66 67
|
|
72
|
-
0x00 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80,
|
|
73
|
-
// 68 69 6a 6b 6c 6d 6e 6f
|
|
74
|
-
0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80,
|
|
75
|
-
// 70 71 72 73 74 75 76 77
|
|
76
|
-
0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80,
|
|
77
|
-
// 78 79 7a
|
|
78
|
-
0x01 | 0x02 | 0x04,
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
// https://infra.spec.whatwg.org/#ascii-digit
|
|
82
|
-
static inline bool
|
|
83
|
-
url__is_ascii_digit (utf8_t c) {
|
|
84
|
-
return c >= 0x30 && c <= 0x39;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// https://infra.spec.whatwg.org/#ascii-upper-hex-digit
|
|
88
|
-
static inline bool
|
|
89
|
-
url__is_ascii_upper_hex_digit (utf8_t c) {
|
|
90
|
-
return url__is_ascii_digit(c) || (c >= 0x41 && c <= 0x46);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// https://infra.spec.whatwg.org/#ascii-lower-hex-digit
|
|
94
|
-
static inline bool
|
|
95
|
-
url__is_ascii_lower_hex_digit (utf8_t c) {
|
|
96
|
-
return url__is_ascii_digit(c) || (c >= 0x61 && c <= 0x66);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// https://infra.spec.whatwg.org/#ascii-hex-digit
|
|
100
|
-
static inline bool
|
|
101
|
-
url__is_ascii_hex_digit (utf8_t c) {
|
|
102
|
-
return url__is_ascii_digit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// https://infra.spec.whatwg.org/#ascii-upper-alpha
|
|
106
|
-
static inline bool
|
|
107
|
-
url__is_ascii_upper_alpha (utf8_t c) {
|
|
108
|
-
return c >= 0x41 && c <= 0x5a;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// https://infra.spec.whatwg.org/#ascii-lower-alpha
|
|
112
|
-
static inline bool
|
|
113
|
-
url__is_ascii_lower_alpha (utf8_t c) {
|
|
114
|
-
return c >= 0x61 && c <= 0x7a;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// https://infra.spec.whatwg.org/#ascii-alpha
|
|
118
|
-
static inline bool
|
|
119
|
-
url__is_ascii_alpha (utf8_t c) {
|
|
120
|
-
return url__is_in_character_set(url__ascii_alpha_character_set, c);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// https://infra.spec.whatwg.org/#ascii-alphanumeric
|
|
124
|
-
static inline bool
|
|
125
|
-
url__is_ascii_alphanumeric (utf8_t c) {
|
|
126
|
-
return url__is_in_character_set(url__ascii_alphanumeric_character_set, c);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// https://infra.spec.whatwg.org/#ascii-lowercase
|
|
130
|
-
static inline utf8_t
|
|
131
|
-
url__to_ascii_lowercase (utf8_t c) {
|
|
132
|
-
return c | 0x20;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// https://infra.spec.whatwg.org/#ascii-uppercase
|
|
136
|
-
static inline utf8_t
|
|
137
|
-
url__to_ascii_uppercase (utf8_t c) {
|
|
138
|
-
return c & ~0x20;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
#endif // URL_INFRA_H
|