bare-url 2.0.8 → 2.0.9

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.
Files changed (53) hide show
  1. package/CMakeLists.txt +3 -7
  2. package/package.json +3 -6
  3. package/prebuilds/android-arm/bare-url.bare +0 -0
  4. package/prebuilds/android-arm64/bare-url.bare +0 -0
  5. package/prebuilds/android-ia32/bare-url.bare +0 -0
  6. package/prebuilds/android-x64/bare-url.bare +0 -0
  7. package/prebuilds/win32-arm64/bare-url.bare +0 -0
  8. package/prebuilds/win32-x64/bare-url.bare +0 -0
  9. package/vendor/liburl/CMakeLists.txt +0 -81
  10. package/vendor/liburl/include/url/character-set.h +0 -41
  11. package/vendor/liburl/include/url/idna.h +0 -14
  12. package/vendor/liburl/include/url/infra.h +0 -141
  13. package/vendor/liburl/include/url/parse.h +0 -1406
  14. package/vendor/liburl/include/url/percent-encode.h +0 -567
  15. package/vendor/liburl/include/url/punycode.h +0 -21
  16. package/vendor/liburl/include/url/serialize.h +0 -91
  17. package/vendor/liburl/include/url/type.h +0 -61
  18. package/vendor/liburl/include/url.h +0 -147
  19. package/vendor/liburl/src/url.c +0 -42
  20. package/vendor/libutf/CMakeLists.txt +0 -93
  21. package/vendor/libutf/include/utf/string.h +0 -786
  22. package/vendor/libutf/include/utf.h +0 -132
  23. package/vendor/libutf/src/ascii/validate.c +0 -47
  24. package/vendor/libutf/src/endianness.c +0 -19
  25. package/vendor/libutf/src/endianness.h +0 -54
  26. package/vendor/libutf/src/latin1/convert-to-utf16.c +0 -37
  27. package/vendor/libutf/src/latin1/convert-to-utf32.c +0 -34
  28. package/vendor/libutf/src/latin1/convert-to-utf8.c +0 -58
  29. package/vendor/libutf/src/latin1/length-from-utf16.c +0 -26
  30. package/vendor/libutf/src/latin1/length-from-utf32.c +0 -26
  31. package/vendor/libutf/src/latin1/length-from-utf8.c +0 -34
  32. package/vendor/libutf/src/utf16/convert-to-latin1.c +0 -41
  33. package/vendor/libutf/src/utf16/convert-to-utf32.c +0 -56
  34. package/vendor/libutf/src/utf16/convert-to-utf8.c +0 -75
  35. package/vendor/libutf/src/utf16/length-from-latin1.c +0 -26
  36. package/vendor/libutf/src/utf16/length-from-utf32.c +0 -33
  37. package/vendor/libutf/src/utf16/length-from-utf8.c +0 -38
  38. package/vendor/libutf/src/utf16/validate.c +0 -53
  39. package/vendor/libutf/src/utf32/convert-to-latin1.c +0 -40
  40. package/vendor/libutf/src/utf32/convert-to-utf16.c +0 -56
  41. package/vendor/libutf/src/utf32/convert-to-utf8.c +0 -71
  42. package/vendor/libutf/src/utf32/length-from-latin1.c +0 -26
  43. package/vendor/libutf/src/utf32/length-from-utf16.c +0 -35
  44. package/vendor/libutf/src/utf32/length-from-utf8.c +0 -35
  45. package/vendor/libutf/src/utf32/validate.c +0 -39
  46. package/vendor/libutf/src/utf8/convert-to-latin1.c +0 -70
  47. package/vendor/libutf/src/utf8/convert-to-utf16.c +0 -95
  48. package/vendor/libutf/src/utf8/convert-to-utf32.c +0 -110
  49. package/vendor/libutf/src/utf8/length-from-latin1.c +0 -32
  50. package/vendor/libutf/src/utf8/length-from-utf16.c +0 -44
  51. package/vendor/libutf/src/utf8/length-from-utf32.c +0 -35
  52. package/vendor/libutf/src/utf8/string.c +0 -149
  53. package/vendor/libutf/src/utf8/validate.c +0 -107
package/CMakeLists.txt CHANGED
@@ -1,16 +1,12 @@
1
1
  cmake_minimum_required(VERSION 3.25)
2
2
 
3
3
  find_package(cmake-bare REQUIRED PATHS node_modules/cmake-bare)
4
+ find_package(cmake-fetch REQUIRED PATHS node_modules/cmake-fetch)
4
5
 
5
6
  project(bare_url C)
6
7
 
7
- if(NOT TARGET utf)
8
- add_subdirectory(vendor/libutf EXCLUDE_FROM_ALL)
9
- endif()
10
-
11
- if(NOT TARGET url)
12
- add_subdirectory(vendor/liburl EXCLUDE_FROM_ALL)
13
- endif()
8
+ fetch_package("github:holepunchto/libutf#65b6ba0")
9
+ fetch_package("github:holepunchto/liburl#54406f0")
14
10
 
15
11
  add_bare_module(bare_url)
16
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-url",
3
- "version": "2.0.8",
3
+ "version": "2.0.9",
4
4
  "description": "WHATWG URL implementation for JavaScript",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -9,11 +9,7 @@
9
9
  "binding.js",
10
10
  "CMakeLists.txt",
11
11
  "lib",
12
- "prebuilds",
13
- "vendor/liburl/include",
14
- "vendor/liburl/src",
15
- "vendor/libutf/include",
16
- "vendor/libutf/src"
12
+ "prebuilds"
17
13
  ],
18
14
  "addon": true,
19
15
  "scripts": {
@@ -35,6 +31,7 @@
35
31
  "devDependencies": {
36
32
  "brittle": "^3.3.2",
37
33
  "cmake-bare": "^1.1.6",
34
+ "cmake-fetch": "^1.0.0",
38
35
  "standard": "^17.1.0"
39
36
  }
40
37
  }
Binary file
Binary file
Binary file
Binary file
@@ -1,81 +0,0 @@
1
- cmake_minimum_required(VERSION 3.25)
2
-
3
- project(url C)
4
-
5
- if(NOT TARGET utf)
6
- add_subdirectory(vendor/libutf EXCLUDE_FROM_ALL)
7
- endif()
8
-
9
- add_library(url OBJECT)
10
-
11
- set_target_properties(
12
- url
13
- PROPERTIES
14
- C_STANDARD 11
15
- POSITION_INDEPENDENT_CODE ON
16
- )
17
-
18
- target_sources(
19
- url
20
- INTERFACE
21
- include/url.h
22
- include/url/character-set.h
23
- include/url/infra.h
24
- include/url/parse.h
25
- include/url/percent-encode.h
26
- include/url/serialize.h
27
- include/url/type.h
28
- PRIVATE
29
- src/url.c
30
- )
31
-
32
- target_include_directories(
33
- url
34
- PUBLIC
35
- include
36
- $<TARGET_PROPERTY:utf,INTERFACE_INCLUDE_DIRECTORIES>
37
- )
38
-
39
- add_library(url_shared SHARED)
40
-
41
- set_target_properties(
42
- url_shared
43
- PROPERTIES
44
- OUTPUT_NAME url
45
- WINDOWS_EXPORT_ALL_SYMBOLS ON
46
- )
47
-
48
- target_link_libraries(
49
- url_shared
50
- PUBLIC
51
- url
52
- utf_shared
53
- )
54
-
55
- add_library(url_static STATIC)
56
-
57
- set_target_properties(
58
- url_static
59
- PROPERTIES
60
- OUTPUT_NAME url
61
- PREFIX lib
62
- )
63
-
64
- target_link_libraries(
65
- url_static
66
- PUBLIC
67
- url
68
- utf_static
69
- )
70
-
71
- install(TARGETS url_shared url_static)
72
-
73
- install(FILES include/url.h DESTINATION include)
74
-
75
- install(DIRECTORY include/url DESTINATION include)
76
-
77
- if(PROJECT_IS_TOP_LEVEL)
78
- enable_testing()
79
- add_subdirectory(bench)
80
- add_subdirectory(test)
81
- endif()
@@ -1,41 +0,0 @@
1
- #ifndef URL_CHARACTER_SET
2
- #define URL_CHARACTER_SET
3
-
4
- #include <stdbool.h>
5
- #include <stdint.h>
6
- #include <utf.h>
7
- #include <utf/string.h>
8
-
9
- /**
10
- * A character set is stored as a 32 x 8 bit list with each bit
11
- * representing an ASCII byte. A given ASCII byte is in the character set
12
- * if its corresponding bit is set.
13
- */
14
- typedef const uint8_t url_character_set_t[32];
15
-
16
- static inline bool
17
- url__is_in_character_set (url_character_set_t character_set, utf8_t character) {
18
- return (character_set[character >> 3] & (1 << (character & 7))) != 0;
19
- }
20
-
21
- static inline bool
22
- url__contains_from_character_set (url_character_set_t character_set, utf8_string_view_t input) {
23
- size_t i = 0, n = input.len;
24
-
25
- uint8_t accumulator = 0;
26
-
27
- for (; i + 4 <= n; i += 4) {
28
- accumulator |= url__is_in_character_set(character_set, input.data[i]);
29
- accumulator |= url__is_in_character_set(character_set, input.data[i + 1]);
30
- accumulator |= url__is_in_character_set(character_set, input.data[i + 2]);
31
- accumulator |= url__is_in_character_set(character_set, input.data[i + 3]);
32
- }
33
-
34
- for (; i < n; i++) {
35
- accumulator |= url__is_in_character_set(character_set, input.data[i]);
36
- }
37
-
38
- return accumulator;
39
- }
40
-
41
- #endif // URL_CHARACTER_SET
@@ -1,14 +0,0 @@
1
- #ifndef URL_IDNA_H
2
- #define URL_IDNA_H
3
-
4
- #include <utf.h>
5
- #include <utf/string.h>
6
-
7
- static inline int
8
- url__idna_to_ascii (utf8_string_view_t input, utf8_string_t *result) {
9
- // TODO
10
-
11
- return -1;
12
- }
13
-
14
- #endif // URL_IDNA_H
@@ -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