effect 4.0.0-beta.4 → 4.0.0-beta.6

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 (310) hide show
  1. package/dist/Cause.d.ts +1 -1
  2. package/dist/Cause.d.ts.map +1 -1
  3. package/dist/Channel.d.ts.map +1 -1
  4. package/dist/Channel.js +6 -4
  5. package/dist/Channel.js.map +1 -1
  6. package/dist/Config.d.ts +1 -1
  7. package/dist/Data.d.ts +3 -2
  8. package/dist/Data.d.ts.map +1 -1
  9. package/dist/Data.js +9 -8
  10. package/dist/Data.js.map +1 -1
  11. package/dist/Effect.d.ts +0 -226
  12. package/dist/Effect.d.ts.map +1 -1
  13. package/dist/Effect.js +0 -118
  14. package/dist/Effect.js.map +1 -1
  15. package/dist/Encoding.d.ts +194 -0
  16. package/dist/Encoding.d.ts.map +1 -0
  17. package/dist/Encoding.js +352 -0
  18. package/dist/Encoding.js.map +1 -0
  19. package/dist/Equal.js.map +1 -1
  20. package/dist/FileSystem.d.ts +1 -1
  21. package/dist/FileSystem.d.ts.map +1 -1
  22. package/dist/FileSystem.js +5 -5
  23. package/dist/FileSystem.js.map +1 -1
  24. package/dist/Filter.d.ts +30 -1
  25. package/dist/Filter.d.ts.map +1 -1
  26. package/dist/Filter.js +15 -0
  27. package/dist/Filter.js.map +1 -1
  28. package/dist/Formatter.js +1 -1
  29. package/dist/Formatter.js.map +1 -1
  30. package/dist/Graph.d.ts.map +1 -1
  31. package/dist/Graph.js +2 -2
  32. package/dist/Graph.js.map +1 -1
  33. package/dist/Latch.d.ts +109 -0
  34. package/dist/Latch.d.ts.map +1 -0
  35. package/dist/Latch.js +72 -0
  36. package/dist/Latch.js.map +1 -0
  37. package/dist/Pipeable.d.ts +17 -0
  38. package/dist/Pipeable.d.ts.map +1 -1
  39. package/dist/Pipeable.js +19 -1
  40. package/dist/Pipeable.js.map +1 -1
  41. package/dist/PlatformError.d.ts +8 -7
  42. package/dist/PlatformError.d.ts.map +1 -1
  43. package/dist/PlatformError.js +2 -2
  44. package/dist/PlatformError.js.map +1 -1
  45. package/dist/Pool.d.ts +5 -3
  46. package/dist/Pool.d.ts.map +1 -1
  47. package/dist/Pool.js +6 -4
  48. package/dist/Pool.js.map +1 -1
  49. package/dist/PubSub.d.ts +3 -2
  50. package/dist/PubSub.d.ts.map +1 -1
  51. package/dist/PubSub.js +3 -2
  52. package/dist/PubSub.js.map +1 -1
  53. package/dist/Request.d.ts +1 -1
  54. package/dist/Request.d.ts.map +1 -1
  55. package/dist/Request.js +2 -1
  56. package/dist/Request.js.map +1 -1
  57. package/dist/RequestResolver.d.ts +0 -20
  58. package/dist/RequestResolver.d.ts.map +1 -1
  59. package/dist/RequestResolver.js +0 -20
  60. package/dist/RequestResolver.js.map +1 -1
  61. package/dist/Schedule.d.ts +2 -2
  62. package/dist/Schedule.d.ts.map +1 -1
  63. package/dist/Schedule.js +30 -16
  64. package/dist/Schedule.js.map +1 -1
  65. package/dist/Schema.d.ts +192 -42
  66. package/dist/Schema.d.ts.map +1 -1
  67. package/dist/Schema.js +385 -71
  68. package/dist/Schema.js.map +1 -1
  69. package/dist/SchemaGetter.d.ts +2 -2
  70. package/dist/SchemaGetter.d.ts.map +1 -1
  71. package/dist/SchemaGetter.js +12 -14
  72. package/dist/SchemaGetter.js.map +1 -1
  73. package/dist/SchemaRepresentation.d.ts +44 -43
  74. package/dist/SchemaRepresentation.d.ts.map +1 -1
  75. package/dist/SchemaRepresentation.js +5 -2
  76. package/dist/SchemaRepresentation.js.map +1 -1
  77. package/dist/SchemaTransformation.d.ts +37 -0
  78. package/dist/SchemaTransformation.d.ts.map +1 -1
  79. package/dist/SchemaTransformation.js +80 -0
  80. package/dist/SchemaTransformation.js.map +1 -1
  81. package/dist/Semaphore.d.ts +211 -0
  82. package/dist/Semaphore.d.ts.map +1 -0
  83. package/dist/{PartitionedSemaphore.js → Semaphore.js} +97 -13
  84. package/dist/Semaphore.js.map +1 -0
  85. package/dist/Stream.d.ts.map +1 -1
  86. package/dist/Stream.js +9 -8
  87. package/dist/Stream.js.map +1 -1
  88. package/dist/Struct.d.ts +16 -0
  89. package/dist/Struct.d.ts.map +1 -1
  90. package/dist/Struct.js +22 -0
  91. package/dist/Struct.js.map +1 -1
  92. package/dist/SubscriptionRef.d.ts +2 -1
  93. package/dist/SubscriptionRef.d.ts.map +1 -1
  94. package/dist/SubscriptionRef.js +2 -1
  95. package/dist/SubscriptionRef.js.map +1 -1
  96. package/dist/SynchronizedRef.d.ts +2 -1
  97. package/dist/SynchronizedRef.d.ts.map +1 -1
  98. package/dist/SynchronizedRef.js +2 -1
  99. package/dist/SynchronizedRef.js.map +1 -1
  100. package/dist/Types.d.ts +14 -6
  101. package/dist/Types.d.ts.map +1 -1
  102. package/dist/index.d.ts +14 -5
  103. package/dist/index.d.ts.map +1 -1
  104. package/dist/index.js +14 -5
  105. package/dist/index.js.map +1 -1
  106. package/dist/internal/core.js +11 -3
  107. package/dist/internal/core.js.map +1 -1
  108. package/dist/internal/effect.js.map +1 -1
  109. package/dist/internal/rcRef.js +2 -1
  110. package/dist/internal/rcRef.js.map +1 -1
  111. package/dist/testing/TestClock.d.ts +3 -2
  112. package/dist/testing/TestClock.d.ts.map +1 -1
  113. package/dist/testing/TestClock.js +5 -3
  114. package/dist/testing/TestClock.js.map +1 -1
  115. package/dist/unstable/ai/AiError.d.ts +39 -39
  116. package/dist/unstable/ai/Chat.d.ts.map +1 -1
  117. package/dist/unstable/ai/Chat.js +2 -1
  118. package/dist/unstable/ai/Chat.js.map +1 -1
  119. package/dist/unstable/ai/McpSchema.d.ts +51 -51
  120. package/dist/unstable/ai/Prompt.d.ts +20 -20
  121. package/dist/unstable/ai/Response.d.ts +25 -25
  122. package/dist/unstable/cli/CliError.d.ts +5 -5
  123. package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
  124. package/dist/unstable/cluster/ClusterWorkflowEngine.js +2 -1
  125. package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
  126. package/dist/unstable/cluster/Entity.d.ts +2 -1
  127. package/dist/unstable/cluster/Entity.d.ts.map +1 -1
  128. package/dist/unstable/cluster/Entity.js.map +1 -1
  129. package/dist/unstable/cluster/Envelope.d.ts +1 -1
  130. package/dist/unstable/cluster/K8sHttpClient.d.ts +1 -1
  131. package/dist/unstable/cluster/Message.d.ts +5 -5
  132. package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
  133. package/dist/unstable/cluster/MessageStorage.js +2 -1
  134. package/dist/unstable/cluster/MessageStorage.js.map +1 -1
  135. package/dist/unstable/cluster/Reply.d.ts +3 -3
  136. package/dist/unstable/cluster/Runner.d.ts +1 -1
  137. package/dist/unstable/cluster/Runners.d.ts.map +1 -1
  138. package/dist/unstable/cluster/Runners.js +4 -3
  139. package/dist/unstable/cluster/Runners.js.map +1 -1
  140. package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
  141. package/dist/unstable/cluster/Sharding.js +7 -5
  142. package/dist/unstable/cluster/Sharding.js.map +1 -1
  143. package/dist/unstable/cluster/internal/entityManager.js +4 -3
  144. package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
  145. package/dist/unstable/cluster/internal/entityReaper.js +2 -1
  146. package/dist/unstable/cluster/internal/entityReaper.js.map +1 -1
  147. package/dist/unstable/cluster/internal/resourceRef.js +2 -1
  148. package/dist/unstable/cluster/internal/resourceRef.js.map +1 -1
  149. package/dist/unstable/devtools/DevToolsSchema.d.ts +36 -36
  150. package/dist/unstable/encoding/Sse.d.ts +1 -1
  151. package/dist/unstable/eventlog/EventJournal.d.ts +1 -1
  152. package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
  153. package/dist/unstable/eventlog/EventLog.js +2 -1
  154. package/dist/unstable/eventlog/EventLog.js.map +1 -1
  155. package/dist/unstable/eventlog/EventLogRemote.d.ts +5 -5
  156. package/dist/unstable/http/Cookies.d.ts +1 -1
  157. package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
  158. package/dist/unstable/http/HttpEffect.js +18 -26
  159. package/dist/unstable/http/HttpEffect.js.map +1 -1
  160. package/dist/unstable/http/Multipart.d.ts +2 -2
  161. package/dist/unstable/http/UrlParams.d.ts +1 -1
  162. package/dist/unstable/httpapi/HttpApiBuilder.js +2 -2
  163. package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
  164. package/dist/unstable/httpapi/HttpApiScalar.d.ts +6 -0
  165. package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
  166. package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
  167. package/dist/unstable/persistence/KeyValueStore.js +6 -6
  168. package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
  169. package/dist/unstable/persistence/PersistedCache.d.ts +6 -5
  170. package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
  171. package/dist/unstable/persistence/PersistedCache.js +2 -1
  172. package/dist/unstable/persistence/PersistedCache.js.map +1 -1
  173. package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
  174. package/dist/unstable/persistence/PersistedQueue.js +6 -5
  175. package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
  176. package/dist/unstable/process/ChildProcessSpawner.d.ts +6 -0
  177. package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
  178. package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
  179. package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
  180. package/dist/unstable/reactivity/Atom.js +12 -9
  181. package/dist/unstable/reactivity/Atom.js.map +1 -1
  182. package/dist/unstable/reactivity/Hydration.d.ts +39 -0
  183. package/dist/unstable/reactivity/Hydration.d.ts.map +1 -0
  184. package/dist/unstable/reactivity/Hydration.js +76 -0
  185. package/dist/unstable/reactivity/Hydration.js.map +1 -0
  186. package/dist/unstable/reactivity/index.d.ts +4 -0
  187. package/dist/unstable/reactivity/index.d.ts.map +1 -1
  188. package/dist/unstable/reactivity/index.js +4 -0
  189. package/dist/unstable/reactivity/index.js.map +1 -1
  190. package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
  191. package/dist/unstable/rpc/RpcClient.js +3 -2
  192. package/dist/unstable/rpc/RpcClient.js.map +1 -1
  193. package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
  194. package/dist/unstable/rpc/RpcServer.js +5 -3
  195. package/dist/unstable/rpc/RpcServer.js.map +1 -1
  196. package/dist/unstable/rpc/Utils.d.ts.map +1 -1
  197. package/dist/unstable/rpc/Utils.js +2 -1
  198. package/dist/unstable/rpc/Utils.js.map +1 -1
  199. package/dist/unstable/socket/Socket.d.ts.map +1 -1
  200. package/dist/unstable/socket/Socket.js +3 -2
  201. package/dist/unstable/socket/Socket.js.map +1 -1
  202. package/dist/unstable/sql/Statement.js +0 -1
  203. package/dist/unstable/sql/Statement.js.map +1 -1
  204. package/dist/unstable/workers/Worker.d.ts.map +1 -1
  205. package/dist/unstable/workers/Worker.js +2 -1
  206. package/dist/unstable/workers/Worker.js.map +1 -1
  207. package/dist/unstable/workflow/DurableDeferred.js +2 -2
  208. package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
  209. package/dist/unstable/workflow/Workflow.d.ts +1 -1
  210. package/dist/unstable/workflow/WorkflowEngine.d.ts +2 -1
  211. package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
  212. package/dist/unstable/workflow/WorkflowEngine.js +2 -1
  213. package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
  214. package/package.json +1 -2
  215. package/src/Cause.ts +1 -1
  216. package/src/Channel.ts +6 -4
  217. package/src/Data.ts +10 -9
  218. package/src/Effect.ts +0 -246
  219. package/src/Encoding.ts +879 -0
  220. package/src/Equal.ts +2 -2
  221. package/src/FileSystem.ts +7 -8
  222. package/src/Filter.ts +48 -1
  223. package/src/Formatter.ts +1 -1
  224. package/src/Graph.ts +8 -5
  225. package/src/Latch.ts +112 -0
  226. package/src/Pipeable.ts +32 -1
  227. package/src/PlatformError.ts +5 -5
  228. package/src/Pool.ts +9 -7
  229. package/src/PubSub.ts +10 -9
  230. package/src/Request.ts +3 -2
  231. package/src/RequestResolver.ts +0 -20
  232. package/src/Schedule.ts +217 -115
  233. package/src/Schema.ts +567 -105
  234. package/src/SchemaGetter.ts +12 -14
  235. package/src/SchemaRepresentation.ts +5 -2
  236. package/src/SchemaTransformation.ts +104 -0
  237. package/src/Semaphore.ts +356 -0
  238. package/src/Stream.ts +9 -8
  239. package/src/Struct.ts +26 -0
  240. package/src/SubscriptionRef.ts +3 -2
  241. package/src/SynchronizedRef.ts +3 -2
  242. package/src/Types.ts +12 -2
  243. package/src/index.ts +17 -6
  244. package/src/internal/core.ts +10 -2
  245. package/src/internal/effect.ts +3 -2
  246. package/src/internal/rcRef.ts +2 -1
  247. package/src/testing/TestClock.ts +8 -6
  248. package/src/unstable/ai/AiError.ts +1 -1
  249. package/src/unstable/ai/Chat.ts +2 -1
  250. package/src/unstable/ai/Prompt.ts +20 -20
  251. package/src/unstable/ai/Response.ts +22 -22
  252. package/src/unstable/cluster/ClusterWorkflowEngine.ts +3 -2
  253. package/src/unstable/cluster/Entity.ts +2 -1
  254. package/src/unstable/cluster/Envelope.ts +1 -1
  255. package/src/unstable/cluster/MessageStorage.ts +2 -1
  256. package/src/unstable/cluster/Runners.ts +6 -5
  257. package/src/unstable/cluster/Sharding.ts +8 -6
  258. package/src/unstable/cluster/internal/entityManager.ts +6 -5
  259. package/src/unstable/cluster/internal/entityReaper.ts +2 -1
  260. package/src/unstable/cluster/internal/resourceRef.ts +2 -1
  261. package/src/unstable/eventlog/EventLog.ts +2 -1
  262. package/src/unstable/http/HttpEffect.ts +17 -25
  263. package/src/unstable/http/Multipart.ts +2 -2
  264. package/src/unstable/http/UrlParams.ts +1 -1
  265. package/src/unstable/httpapi/HttpApiBuilder.ts +2 -2
  266. package/src/unstable/httpapi/HttpApiScalar.ts +6 -0
  267. package/src/unstable/persistence/KeyValueStore.ts +6 -6
  268. package/src/unstable/persistence/PersistedCache.ts +20 -9
  269. package/src/unstable/persistence/PersistedQueue.ts +7 -6
  270. package/src/unstable/process/ChildProcessSpawner.ts +6 -0
  271. package/src/unstable/reactivity/Atom.ts +7 -5
  272. package/src/unstable/reactivity/Hydration.ts +112 -0
  273. package/src/unstable/reactivity/index.ts +5 -0
  274. package/src/unstable/rpc/RpcClient.ts +4 -3
  275. package/src/unstable/rpc/RpcServer.ts +6 -4
  276. package/src/unstable/rpc/Utils.ts +2 -1
  277. package/src/unstable/socket/Socket.ts +3 -2
  278. package/src/unstable/sql/Statement.ts +0 -1
  279. package/src/unstable/workers/Worker.ts +2 -1
  280. package/src/unstable/workflow/DurableDeferred.ts +2 -2
  281. package/src/unstable/workflow/WorkflowEngine.ts +3 -2
  282. package/dist/PartitionedSemaphore.d.ts +0 -52
  283. package/dist/PartitionedSemaphore.d.ts.map +0 -1
  284. package/dist/PartitionedSemaphore.js.map +0 -1
  285. package/dist/encoding/Base64.d.ts +0 -67
  286. package/dist/encoding/Base64.d.ts.map +0 -1
  287. package/dist/encoding/Base64.js +0 -146
  288. package/dist/encoding/Base64.js.map +0 -1
  289. package/dist/encoding/Base64Url.d.ts +0 -60
  290. package/dist/encoding/Base64Url.d.ts.map +0 -1
  291. package/dist/encoding/Base64Url.js +0 -89
  292. package/dist/encoding/Base64Url.js.map +0 -1
  293. package/dist/encoding/EncodingError.d.ts +0 -31
  294. package/dist/encoding/EncodingError.d.ts.map +0 -1
  295. package/dist/encoding/EncodingError.js +0 -22
  296. package/dist/encoding/EncodingError.js.map +0 -1
  297. package/dist/encoding/Hex.d.ts +0 -61
  298. package/dist/encoding/Hex.d.ts.map +0 -1
  299. package/dist/encoding/Hex.js +0 -115
  300. package/dist/encoding/Hex.js.map +0 -1
  301. package/dist/encoding/index.d.ts +0 -26
  302. package/dist/encoding/index.d.ts.map +0 -1
  303. package/dist/encoding/index.js +0 -27
  304. package/dist/encoding/index.js.map +0 -1
  305. package/src/PartitionedSemaphore.ts +0 -182
  306. package/src/encoding/Base64.ts +0 -366
  307. package/src/encoding/Base64Url.ts +0 -104
  308. package/src/encoding/EncodingError.ts +0 -35
  309. package/src/encoding/Hex.ts +0 -390
  310. package/src/encoding/index.ts +0 -31
@@ -1,390 +0,0 @@
1
- /**
2
- * @since 2.0.0
3
- */
4
- import * as Result from "../Result.ts"
5
- import { EncodingError } from "./EncodingError.ts"
6
-
7
- /**
8
- * Encodes the given value into a hex `string`.
9
- *
10
- * @example
11
- * ```ts
12
- * import { Hex } from "effect/encoding"
13
- *
14
- * // Encode a string to hex
15
- * console.log(Hex.encode("hello")) // "68656c6c6f"
16
- *
17
- * // Encode binary data to hex
18
- * const bytes = new Uint8Array([72, 101, 108, 108, 111])
19
- * console.log(Hex.encode(bytes)) // "48656c6c6f"
20
- * ```
21
- *
22
- * @category encoding
23
- * @since 2.0.0
24
- */
25
- export const encode: (input: Uint8Array | string) => string = (input) =>
26
- typeof input === "string" ? encodeUint8Array(encoder.encode(input)) : encodeUint8Array(input)
27
-
28
- const encodeUint8Array = (bytes: Uint8Array) => {
29
- let result = ""
30
- for (let i = 0; i < bytes.length; ++i) {
31
- result += bytesToHex[bytes[i]]
32
- }
33
-
34
- return result
35
- }
36
-
37
- /**
38
- * Decodes a hex encoded `string` into a `Uint8Array`.
39
- *
40
- * @example
41
- * ```ts
42
- * import { Result } from "effect"
43
- * import { Hex } from "effect/encoding"
44
- *
45
- * const result = Hex.decode("48656c6c6f")
46
- * if (Result.isSuccess(result)) {
47
- * console.log(Array.from(result.success)) // [72, 101, 108, 108, 111]
48
- * }
49
- * ```
50
- *
51
- * @category decoding
52
- * @since 2.0.0
53
- */
54
- export const decode = (str: string): Result.Result<Uint8Array, EncodingError> => {
55
- const bytes = new TextEncoder().encode(str)
56
- if (bytes.length % 2 !== 0) {
57
- return Result.fail(
58
- new EncodingError({
59
- module: "Hex",
60
- kind: "Decode",
61
- input: str,
62
- message: `Length must be a multiple of 2, but is ${bytes.length}`
63
- })
64
- )
65
- }
66
-
67
- try {
68
- const length = bytes.length / 2
69
- const result = new Uint8Array(length)
70
- for (let i = 0; i < length; i++) {
71
- const a = fromHexChar(bytes[i * 2])
72
- const b = fromHexChar(bytes[i * 2 + 1])
73
- result[i] = (a << 4) | b
74
- }
75
-
76
- return Result.succeed(result)
77
- } catch (e) {
78
- return Result.fail(
79
- new EncodingError({
80
- module: "Hex",
81
- kind: "Decode",
82
- input: str,
83
- message: e instanceof Error ? e.message : "Invalid input"
84
- })
85
- )
86
- }
87
- }
88
-
89
- /**
90
- * Decodes a hex encoded `string` into a UTF-8 `string`.
91
- *
92
- * @example
93
- * ```ts
94
- * import { Result } from "effect"
95
- * import { Hex } from "effect/encoding"
96
- *
97
- * const result = Hex.decodeString("68656c6c6f")
98
- * if (Result.isSuccess(result)) {
99
- * console.log(result.success) // "hello"
100
- * }
101
- * ```
102
- *
103
- * @category decoding
104
- * @since 2.0.0
105
- */
106
- export const decodeString = (str: string) => Result.map(decode(str), (_) => decoder.decode(_))
107
-
108
- // Internal
109
-
110
- const decoder = new TextDecoder()
111
- const encoder = new TextEncoder()
112
-
113
- const bytesToHex = [
114
- "00",
115
- "01",
116
- "02",
117
- "03",
118
- "04",
119
- "05",
120
- "06",
121
- "07",
122
- "08",
123
- "09",
124
- "0a",
125
- "0b",
126
- "0c",
127
- "0d",
128
- "0e",
129
- "0f",
130
- "10",
131
- "11",
132
- "12",
133
- "13",
134
- "14",
135
- "15",
136
- "16",
137
- "17",
138
- "18",
139
- "19",
140
- "1a",
141
- "1b",
142
- "1c",
143
- "1d",
144
- "1e",
145
- "1f",
146
- "20",
147
- "21",
148
- "22",
149
- "23",
150
- "24",
151
- "25",
152
- "26",
153
- "27",
154
- "28",
155
- "29",
156
- "2a",
157
- "2b",
158
- "2c",
159
- "2d",
160
- "2e",
161
- "2f",
162
- "30",
163
- "31",
164
- "32",
165
- "33",
166
- "34",
167
- "35",
168
- "36",
169
- "37",
170
- "38",
171
- "39",
172
- "3a",
173
- "3b",
174
- "3c",
175
- "3d",
176
- "3e",
177
- "3f",
178
- "40",
179
- "41",
180
- "42",
181
- "43",
182
- "44",
183
- "45",
184
- "46",
185
- "47",
186
- "48",
187
- "49",
188
- "4a",
189
- "4b",
190
- "4c",
191
- "4d",
192
- "4e",
193
- "4f",
194
- "50",
195
- "51",
196
- "52",
197
- "53",
198
- "54",
199
- "55",
200
- "56",
201
- "57",
202
- "58",
203
- "59",
204
- "5a",
205
- "5b",
206
- "5c",
207
- "5d",
208
- "5e",
209
- "5f",
210
- "60",
211
- "61",
212
- "62",
213
- "63",
214
- "64",
215
- "65",
216
- "66",
217
- "67",
218
- "68",
219
- "69",
220
- "6a",
221
- "6b",
222
- "6c",
223
- "6d",
224
- "6e",
225
- "6f",
226
- "70",
227
- "71",
228
- "72",
229
- "73",
230
- "74",
231
- "75",
232
- "76",
233
- "77",
234
- "78",
235
- "79",
236
- "7a",
237
- "7b",
238
- "7c",
239
- "7d",
240
- "7e",
241
- "7f",
242
- "80",
243
- "81",
244
- "82",
245
- "83",
246
- "84",
247
- "85",
248
- "86",
249
- "87",
250
- "88",
251
- "89",
252
- "8a",
253
- "8b",
254
- "8c",
255
- "8d",
256
- "8e",
257
- "8f",
258
- "90",
259
- "91",
260
- "92",
261
- "93",
262
- "94",
263
- "95",
264
- "96",
265
- "97",
266
- "98",
267
- "99",
268
- "9a",
269
- "9b",
270
- "9c",
271
- "9d",
272
- "9e",
273
- "9f",
274
- "a0",
275
- "a1",
276
- "a2",
277
- "a3",
278
- "a4",
279
- "a5",
280
- "a6",
281
- "a7",
282
- "a8",
283
- "a9",
284
- "aa",
285
- "ab",
286
- "ac",
287
- "ad",
288
- "ae",
289
- "af",
290
- "b0",
291
- "b1",
292
- "b2",
293
- "b3",
294
- "b4",
295
- "b5",
296
- "b6",
297
- "b7",
298
- "b8",
299
- "b9",
300
- "ba",
301
- "bb",
302
- "bc",
303
- "bd",
304
- "be",
305
- "bf",
306
- "c0",
307
- "c1",
308
- "c2",
309
- "c3",
310
- "c4",
311
- "c5",
312
- "c6",
313
- "c7",
314
- "c8",
315
- "c9",
316
- "ca",
317
- "cb",
318
- "cc",
319
- "cd",
320
- "ce",
321
- "cf",
322
- "d0",
323
- "d1",
324
- "d2",
325
- "d3",
326
- "d4",
327
- "d5",
328
- "d6",
329
- "d7",
330
- "d8",
331
- "d9",
332
- "da",
333
- "db",
334
- "dc",
335
- "dd",
336
- "de",
337
- "df",
338
- "e0",
339
- "e1",
340
- "e2",
341
- "e3",
342
- "e4",
343
- "e5",
344
- "e6",
345
- "e7",
346
- "e8",
347
- "e9",
348
- "ea",
349
- "eb",
350
- "ec",
351
- "ed",
352
- "ee",
353
- "ef",
354
- "f0",
355
- "f1",
356
- "f2",
357
- "f3",
358
- "f4",
359
- "f5",
360
- "f6",
361
- "f7",
362
- "f8",
363
- "f9",
364
- "fa",
365
- "fb",
366
- "fc",
367
- "fd",
368
- "fe",
369
- "ff"
370
- ]
371
-
372
- /** @internal */
373
- const fromHexChar = (byte: number) => {
374
- // '0' <= byte && byte <= '9'
375
- if (48 <= byte && byte <= 57) {
376
- return byte - 48
377
- }
378
-
379
- // 'a' <= byte && byte <= 'f'
380
- if (97 <= byte && byte <= 102) {
381
- return byte - 97 + 10
382
- }
383
-
384
- // 'A' <= byte && byte <= 'F'
385
- if (65 <= byte && byte <= 70) {
386
- return byte - 65 + 10
387
- }
388
-
389
- throw new TypeError("Invalid input")
390
- }
@@ -1,31 +0,0 @@
1
- /**
2
- * @since 4.0.0
3
- */
4
-
5
- // @barrel: Auto-generated exports. Do not edit manually.
6
-
7
- /**
8
- * This module provides encoding & decoding functionality for:
9
- *
10
- * - base64 (RFC4648)
11
- * - base64 (URL)
12
- * - hex
13
- *
14
- * @since 2.0.0
15
- */
16
- export * as Base64 from "./Base64.ts"
17
-
18
- /**
19
- * @since 2.0.0
20
- */
21
- export * as Base64Url from "./Base64Url.ts"
22
-
23
- /**
24
- * @since 4.0.0
25
- */
26
- export * as EncodingError from "./EncodingError.ts"
27
-
28
- /**
29
- * @since 2.0.0
30
- */
31
- export * as Hex from "./Hex.ts"