@udibo/oauth2 0.14.1 → 0.15.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.
Files changed (413) hide show
  1. package/README.md +45 -24
  2. package/{esm → dist}/adapters/hono/_common.d.ts +5 -5
  3. package/{esm → dist}/adapters/hono/_common.js +1 -1
  4. package/{esm → dist}/adapters/hono/authorization-server.d.ts +6 -7
  5. package/{esm → dist}/adapters/hono/authorization-server.js +0 -1
  6. package/{esm → dist}/adapters/hono/bff/auth-request-store.d.ts +2 -2
  7. package/{esm → dist}/adapters/hono/bff/auth-request-store.js +2 -2
  8. package/{esm → dist}/adapters/hono/bff/bff.d.ts +8 -8
  9. package/{esm → dist}/adapters/hono/bff/bff.js +33 -27
  10. package/{esm → dist}/adapters/hono/bff/cookie-prefix.js +1 -2
  11. package/{esm → dist}/adapters/hono/bff/mod.d.ts +5 -6
  12. package/{esm → dist}/adapters/hono/bff/mod.js +1 -2
  13. package/{esm → dist}/adapters/hono/bff/proxy.js +2 -1
  14. package/{esm → dist}/adapters/hono/bff/session-store.d.ts +2 -2
  15. package/{esm → dist}/adapters/hono/bff/session-store.js +7 -6
  16. package/{esm → dist}/adapters/hono/bff/testing.d.ts +7 -8
  17. package/{esm → dist}/adapters/hono/bff/testing.js +19 -22
  18. package/{esm → dist}/adapters/hono/identity.d.ts +1 -2
  19. package/{esm → dist}/adapters/hono/identity.js +10 -10
  20. package/{esm → dist}/adapters/hono/log.d.ts +0 -1
  21. package/{esm → dist}/adapters/hono/log.js +0 -6
  22. package/{esm → dist}/adapters/hono/resource-server.d.ts +5 -6
  23. package/{esm → dist}/adapters/hono/resource-server.js +0 -1
  24. package/dist/cli/bin.d.ts +2 -0
  25. package/dist/cli/bin.js +3 -0
  26. package/dist/cli/idp/config.d.ts +110 -0
  27. package/dist/cli/idp/config.js +269 -0
  28. package/dist/cli/idp/mod.d.ts +20 -0
  29. package/dist/cli/idp/mod.js +175 -0
  30. package/dist/cli/idp/pages.d.ts +56 -0
  31. package/dist/cli/idp/pages.js +190 -0
  32. package/dist/cli/idp/server.d.ts +93 -0
  33. package/dist/cli/idp/server.js +559 -0
  34. package/dist/cli/keygen.d.ts +13 -0
  35. package/dist/cli/keygen.js +30 -0
  36. package/dist/cli/mod.d.ts +34 -0
  37. package/dist/cli/mod.js +94 -0
  38. package/{esm → dist}/client/_http.d.ts +1 -1
  39. package/{esm → dist}/client/base.d.ts +1 -1
  40. package/{esm → dist}/client/bff-client.d.ts +1 -1
  41. package/{esm → dist}/client/bff-client.js +7 -6
  42. package/{esm → dist}/client/browser-storage.d.ts +1 -1
  43. package/{esm → dist}/client/check.js +1 -1
  44. package/{esm → dist}/client/direct-client.d.ts +6 -6
  45. package/{esm → dist}/client/direct-client.js +11 -13
  46. package/{esm → dist}/client/discovery-cache.d.ts +1 -1
  47. package/{esm → dist}/client/discovery-cache.js +2 -2
  48. package/{esm → dist}/client/events.d.ts +1 -1
  49. package/{esm → dist}/client/mod.d.ts +11 -12
  50. package/{esm → dist}/client/mod.js +1 -1
  51. package/{esm → dist}/errors.d.ts +1 -1
  52. package/{esm → dist}/errors.js +1 -1
  53. package/{esm → dist}/identity/events.d.ts +1 -1
  54. package/{esm → dist}/identity/external/_shared.d.ts +1 -1
  55. package/{esm → dist}/identity/external/_shared.js +1 -2
  56. package/{esm → dist}/identity/external/apple-client-secret.d.ts +1 -1
  57. package/{esm → dist}/identity/external/apple-client-secret.js +6 -7
  58. package/{esm → dist}/identity/external/apple.d.ts +5 -5
  59. package/{esm → dist}/identity/external/apple.js +10 -11
  60. package/{esm → dist}/identity/external/discord.d.ts +3 -3
  61. package/{esm → dist}/identity/external/discord.js +2 -2
  62. package/{esm → dist}/identity/external/flow.d.ts +1 -1
  63. package/{esm → dist}/identity/external/flow.js +2 -2
  64. package/{esm → dist}/identity/external/github.d.ts +3 -3
  65. package/{esm → dist}/identity/external/github.js +12 -17
  66. package/{esm → dist}/identity/external/google.d.ts +5 -5
  67. package/{esm → dist}/identity/external/google.js +2 -2
  68. package/{esm → dist}/identity/external/mod.d.ts +12 -13
  69. package/{esm → dist}/identity/external/mod.js +0 -1
  70. package/{esm → dist}/identity/external/oauth2.d.ts +1 -1
  71. package/{esm → dist}/identity/external/oauth2.js +8 -8
  72. package/{esm → dist}/identity/external/oidc.d.ts +4 -4
  73. package/{esm → dist}/identity/external/oidc.js +9 -8
  74. package/{esm → dist}/identity/hibp.d.ts +1 -1
  75. package/{esm → dist}/identity/hibp.js +1 -1
  76. package/{esm → dist}/identity/lockout.js +1 -2
  77. package/{esm → dist}/identity/mfa/mod.d.ts +4 -5
  78. package/{esm → dist}/identity/mfa/mod.js +1 -2
  79. package/{esm → dist}/identity/mfa/service.d.ts +3 -3
  80. package/{esm → dist}/identity/mfa/service.js +4 -3
  81. package/{esm → dist}/identity/mfa/totp.d.ts +1 -1
  82. package/{esm → dist}/identity/mfa/totp.js +2 -2
  83. package/{esm → dist}/identity/migration.d.ts +2 -3
  84. package/{esm → dist}/identity/migration.js +3 -4
  85. package/{esm → dist}/identity/mod.d.ts +14 -15
  86. package/{esm → dist}/identity/mod.js +0 -1
  87. package/{esm → dist}/identity/otp.d.ts +1 -1
  88. package/{esm → dist}/identity/otp.js +4 -2
  89. package/{esm → dist}/identity/password.js +8 -5
  90. package/{esm → dist}/identity/rate-limit.d.ts +1 -1
  91. package/{esm → dist}/identity/service.d.ts +10 -10
  92. package/{esm → dist}/identity/service.js +17 -18
  93. package/{esm → dist}/identity/session.js +2 -2
  94. package/{esm → dist}/identity/token-flow.js +3 -2
  95. package/{esm → dist}/models/authorization-code.d.ts +3 -3
  96. package/{esm → dist}/models/authorization.d.ts +1 -1
  97. package/{esm → dist}/models/authorization.js +1 -2
  98. package/{esm → dist}/models/device-authorization.d.ts +2 -2
  99. package/{esm → dist}/models/token.d.ts +3 -3
  100. package/{esm → dist}/react/callback.d.ts +1 -1
  101. package/{esm → dist}/react/callback.js +0 -1
  102. package/{esm → dist}/react/components/class-names.d.ts +1 -1
  103. package/{esm → dist}/react/components/class-names.js +3 -2
  104. package/{esm → dist}/react/components/internal.d.ts +2 -2
  105. package/{esm → dist}/react/components/internal.js +5 -11
  106. package/{esm → dist}/react/components/mfa-challenge-form.d.ts +2 -2
  107. package/{esm → dist}/react/components/mfa-challenge-form.js +4 -6
  108. package/{esm → dist}/react/components/mfa-enrollment-form.d.ts +2 -2
  109. package/{esm → dist}/react/components/mfa-enrollment-form.js +2 -6
  110. package/{esm → dist}/react/components/mod.d.ts +20 -21
  111. package/{esm → dist}/react/components/mod.js +1 -2
  112. package/{esm → dist}/react/components/request-password-reset-form.d.ts +2 -2
  113. package/{esm → dist}/react/components/request-password-reset-form.js +1 -3
  114. package/{esm → dist}/react/components/reset-password-form.d.ts +2 -2
  115. package/{esm → dist}/react/components/reset-password-form.js +2 -2
  116. package/{esm → dist}/react/components/sign-in-form.d.ts +2 -2
  117. package/{esm → dist}/react/components/sign-in-form.js +1 -5
  118. package/{esm → dist}/react/components/sign-up-form.d.ts +2 -2
  119. package/{esm → dist}/react/components/sign-up-form.js +4 -10
  120. package/{esm → dist}/react/components/types.d.ts +2 -2
  121. package/{esm → dist}/react/components/use-auth-form.d.ts +3 -3
  122. package/{esm → dist}/react/components/use-auth-form.js +4 -7
  123. package/{esm → dist}/react/components/user-menu.d.ts +2 -2
  124. package/{esm → dist}/react/components/user-menu.js +9 -14
  125. package/{esm → dist}/react/context.d.ts +1 -1
  126. package/{esm → dist}/react/mod.d.ts +6 -7
  127. package/{esm → dist}/react/mod.js +0 -1
  128. package/{esm → dist}/react/provider.d.ts +2 -2
  129. package/{esm → dist}/react/require-auth.js +1 -3
  130. package/{esm → dist}/react/testing.d.ts +2 -3
  131. package/{esm → dist}/react/testing.js +1 -2
  132. package/{esm → dist}/react/use-authorization.d.ts +1 -1
  133. package/{esm → dist}/react/use-oauth2.d.ts +8 -1
  134. package/{esm → dist}/react/use-oauth2.js +0 -1
  135. package/{esm → dist}/server/_clock-skew.js +2 -1
  136. package/{esm → dist}/server/authorization-server.d.ts +40 -41
  137. package/{esm → dist}/server/authorization-server.js +32 -42
  138. package/{esm → dist}/server/client-authentication.d.ts +2 -2
  139. package/{esm → dist}/server/grants/authorization-code.d.ts +9 -9
  140. package/{esm → dist}/server/grants/authorization-code.js +5 -6
  141. package/{esm → dist}/server/grants/client-credentials.d.ts +4 -4
  142. package/{esm → dist}/server/grants/device-authorization.d.ts +6 -6
  143. package/{esm → dist}/server/grants/device-authorization.js +4 -4
  144. package/{esm → dist}/server/grants/grant.d.ts +7 -7
  145. package/{esm → dist}/server/grants/grant.js +7 -7
  146. package/{esm → dist}/server/grants/password.d.ts +5 -5
  147. package/{esm → dist}/server/grants/refresh-token.d.ts +4 -4
  148. package/{esm → dist}/server/grants/refresh-token.js +5 -6
  149. package/{esm → dist}/server/introspection-token-reader.d.ts +5 -5
  150. package/{esm → dist}/server/introspection-token-reader.js +4 -4
  151. package/{esm → dist}/server/jwks-token-reader.d.ts +5 -5
  152. package/{esm → dist}/server/jwks-token-reader.js +4 -4
  153. package/{esm → dist}/server/mod.d.ts +12 -13
  154. package/{esm → dist}/server/mod.js +0 -1
  155. package/{esm → dist}/server/public-suffix/mod.d.ts +2 -3
  156. package/{esm → dist}/server/public-suffix/mod.js +1 -2
  157. package/{esm → dist}/server/public-suffix/rules.d.ts +1 -1
  158. package/{esm → dist}/server/public-suffix/rules.js +1 -1
  159. package/{esm → dist}/server/redirect-uri.js +5 -4
  160. package/{esm → dist}/server/resource-server.d.ts +11 -12
  161. package/{esm → dist}/server/resource-server.js +12 -14
  162. package/{esm → dist}/server/services/authorization-code.d.ts +5 -5
  163. package/{esm → dist}/server/services/client.d.ts +1 -1
  164. package/{esm → dist}/server/services/device-authorization.d.ts +3 -3
  165. package/{esm → dist}/server/services/token.d.ts +6 -6
  166. package/{esm → dist}/server/services/token.js +3 -1
  167. package/{esm → dist}/server/services/user.d.ts +1 -1
  168. package/{esm → dist}/server/signing-keys.d.ts +1 -1
  169. package/{esm → dist}/server/signing-keys.js +8 -2
  170. package/{esm → dist}/server/utils/hash.js +1 -1
  171. package/{esm → dist}/testing/contract/auth-request-storage.d.ts +1 -1
  172. package/{esm → dist}/testing/contract/auth-request-storage.js +24 -29
  173. package/{esm → dist}/testing/contract/authorization-code.d.ts +6 -6
  174. package/{esm → dist}/testing/contract/authorization-code.js +16 -17
  175. package/{esm → dist}/testing/contract/client.d.ts +4 -4
  176. package/{esm → dist}/testing/contract/client.js +14 -15
  177. package/{esm → dist}/testing/contract/device-authorization.d.ts +6 -6
  178. package/{esm → dist}/testing/contract/device-authorization.js +37 -39
  179. package/{esm → dist}/testing/contract/identity-session.d.ts +6 -1
  180. package/{esm → dist}/testing/contract/identity-session.js +44 -36
  181. package/{esm → dist}/testing/contract/identity-user-store.d.ts +8 -2
  182. package/{esm → dist}/testing/contract/identity-user-store.js +48 -46
  183. package/{esm → dist}/testing/contract/lockout-store.d.ts +1 -1
  184. package/{esm → dist}/testing/contract/lockout-store.js +23 -24
  185. package/{esm → dist}/testing/contract/mfa-store.d.ts +1 -1
  186. package/{esm → dist}/testing/contract/mfa-store.js +53 -54
  187. package/{esm → dist}/testing/contract/mod.d.ts +15 -16
  188. package/{esm → dist}/testing/contract/mod.js +0 -1
  189. package/{esm → dist}/testing/contract/otp-store.d.ts +1 -1
  190. package/{esm → dist}/testing/contract/otp-store.js +33 -34
  191. package/{esm → dist}/testing/contract/rate-limit-store.d.ts +1 -1
  192. package/{esm → dist}/testing/contract/rate-limit-store.js +15 -16
  193. package/{esm → dist}/testing/contract/tenant.js +361 -330
  194. package/{esm → dist}/testing/contract/token-flow-store.d.ts +1 -1
  195. package/{esm → dist}/testing/contract/token-flow-store.js +27 -32
  196. package/{esm → dist}/testing/contract/token-reader.d.ts +3 -3
  197. package/{esm → dist}/testing/contract/token-reader.js +6 -7
  198. package/{esm → dist}/testing/contract/token.d.ts +7 -7
  199. package/{esm → dist}/testing/contract/token.js +48 -53
  200. package/{esm → dist}/testing/contract/user.d.ts +2 -2
  201. package/{esm → dist}/testing/contract/user.js +8 -9
  202. package/{esm → dist}/testing/mod.d.ts +5 -6
  203. package/{esm → dist}/testing/mod.js +2 -3
  204. package/{esm → dist}/testing/server.d.ts +7 -6
  205. package/{esm → dist}/testing/server.js +2 -1
  206. package/{esm → dist}/testing/services.d.ts +11 -11
  207. package/{esm → dist}/testing/services.js +8 -8
  208. package/{esm → dist}/testing/tenant.d.ts +11 -7
  209. package/{esm → dist}/testing/tenant.js +109 -94
  210. package/dist/utils/_constant-time.d.ts +12 -0
  211. package/dist/utils/_constant-time.js +19 -0
  212. package/{esm → dist}/utils/_default-fetch.js +4 -1
  213. package/dist/utils/_delay.d.ts +13 -0
  214. package/dist/utils/_delay.js +28 -0
  215. package/dist/utils/_encoding.d.ts +39 -0
  216. package/dist/utils/_encoding.js +126 -0
  217. package/dist/utils/_inbound-request.d.ts +15 -0
  218. package/dist/utils/_inbound-request.js +25 -0
  219. package/{esm → dist}/utils/authentication-context.d.ts +1 -1
  220. package/{esm → dist}/utils/crypto.d.ts +2 -3
  221. package/{esm → dist}/utils/crypto.js +3 -4
  222. package/{esm → dist}/utils/pkce.js +1 -1
  223. package/{esm → dist}/utils/text.js +1 -1
  224. package/{esm → dist}/utils/url.d.ts +0 -1
  225. package/{esm → dist}/utils/url.js +0 -1
  226. package/package.json +156 -33
  227. package/esm/_dnt.polyfills.d.ts +0 -31
  228. package/esm/_dnt.polyfills.js +0 -26
  229. package/esm/deps/jsr.io/@std/assert/1.0.19/almost_equals.d.ts +0 -29
  230. package/esm/deps/jsr.io/@std/assert/1.0.19/almost_equals.js +0 -47
  231. package/esm/deps/jsr.io/@std/assert/1.0.19/array_includes.d.ts +0 -28
  232. package/esm/deps/jsr.io/@std/assert/1.0.19/array_includes.js +0 -65
  233. package/esm/deps/jsr.io/@std/assert/1.0.19/assert.d.ts +0 -16
  234. package/esm/deps/jsr.io/@std/assert/1.0.19/assert.js +0 -23
  235. package/esm/deps/jsr.io/@std/assert/1.0.19/assertion_error.d.ts +0 -25
  236. package/esm/deps/jsr.io/@std/assert/1.0.19/assertion_error.js +0 -30
  237. package/esm/deps/jsr.io/@std/assert/1.0.19/equal.d.ts +0 -24
  238. package/esm/deps/jsr.io/@std/assert/1.0.19/equal.js +0 -193
  239. package/esm/deps/jsr.io/@std/assert/1.0.19/equals.d.ts +0 -36
  240. package/esm/deps/jsr.io/@std/assert/1.0.19/equals.js +0 -61
  241. package/esm/deps/jsr.io/@std/assert/1.0.19/exists.d.ts +0 -17
  242. package/esm/deps/jsr.io/@std/assert/1.0.19/exists.js +0 -27
  243. package/esm/deps/jsr.io/@std/assert/1.0.19/fail.d.ts +0 -14
  244. package/esm/deps/jsr.io/@std/assert/1.0.19/fail.js +0 -20
  245. package/esm/deps/jsr.io/@std/assert/1.0.19/false.d.ts +0 -18
  246. package/esm/deps/jsr.io/@std/assert/1.0.19/false.js +0 -23
  247. package/esm/deps/jsr.io/@std/assert/1.0.19/greater.d.ts +0 -19
  248. package/esm/deps/jsr.io/@std/assert/1.0.19/greater.js +0 -29
  249. package/esm/deps/jsr.io/@std/assert/1.0.19/greater_or_equal.d.ts +0 -19
  250. package/esm/deps/jsr.io/@std/assert/1.0.19/greater_or_equal.js +0 -29
  251. package/esm/deps/jsr.io/@std/assert/1.0.19/instance_of.d.ts +0 -22
  252. package/esm/deps/jsr.io/@std/assert/1.0.19/instance_of.js +0 -52
  253. package/esm/deps/jsr.io/@std/assert/1.0.19/is_error.d.ts +0 -24
  254. package/esm/deps/jsr.io/@std/assert/1.0.19/is_error.js +0 -53
  255. package/esm/deps/jsr.io/@std/assert/1.0.19/less.d.ts +0 -18
  256. package/esm/deps/jsr.io/@std/assert/1.0.19/less.js +0 -28
  257. package/esm/deps/jsr.io/@std/assert/1.0.19/less_or_equal.d.ts +0 -19
  258. package/esm/deps/jsr.io/@std/assert/1.0.19/less_or_equal.js +0 -29
  259. package/esm/deps/jsr.io/@std/assert/1.0.19/match.d.ts +0 -17
  260. package/esm/deps/jsr.io/@std/assert/1.0.19/match.js +0 -26
  261. package/esm/deps/jsr.io/@std/assert/1.0.19/mod.d.ts +0 -43
  262. package/esm/deps/jsr.io/@std/assert/1.0.19/mod.js +0 -45
  263. package/esm/deps/jsr.io/@std/assert/1.0.19/not_equals.d.ts +0 -26
  264. package/esm/deps/jsr.io/@std/assert/1.0.19/not_equals.js +0 -39
  265. package/esm/deps/jsr.io/@std/assert/1.0.19/not_instance_of.d.ts +0 -19
  266. package/esm/deps/jsr.io/@std/assert/1.0.19/not_instance_of.js +0 -29
  267. package/esm/deps/jsr.io/@std/assert/1.0.19/not_match.d.ts +0 -17
  268. package/esm/deps/jsr.io/@std/assert/1.0.19/not_match.js +0 -26
  269. package/esm/deps/jsr.io/@std/assert/1.0.19/not_strict_equals.d.ts +0 -22
  270. package/esm/deps/jsr.io/@std/assert/1.0.19/not_strict_equals.js +0 -32
  271. package/esm/deps/jsr.io/@std/assert/1.0.19/object_match.d.ts +0 -28
  272. package/esm/deps/jsr.io/@std/assert/1.0.19/object_match.js +0 -177
  273. package/esm/deps/jsr.io/@std/assert/1.0.19/rejects.d.ts +0 -41
  274. package/esm/deps/jsr.io/@std/assert/1.0.19/rejects.js +0 -53
  275. package/esm/deps/jsr.io/@std/assert/1.0.19/strict_equals.d.ts +0 -23
  276. package/esm/deps/jsr.io/@std/assert/1.0.19/strict_equals.js +0 -58
  277. package/esm/deps/jsr.io/@std/assert/1.0.19/string_includes.d.ts +0 -17
  278. package/esm/deps/jsr.io/@std/assert/1.0.19/string_includes.js +0 -26
  279. package/esm/deps/jsr.io/@std/assert/1.0.19/throws.d.ts +0 -44
  280. package/esm/deps/jsr.io/@std/assert/1.0.19/throws.js +0 -44
  281. package/esm/deps/jsr.io/@std/assert/1.0.19/unimplemented.d.ts +0 -14
  282. package/esm/deps/jsr.io/@std/assert/1.0.19/unimplemented.js +0 -20
  283. package/esm/deps/jsr.io/@std/assert/1.0.19/unreachable.d.ts +0 -14
  284. package/esm/deps/jsr.io/@std/assert/1.0.19/unreachable.js +0 -20
  285. package/esm/deps/jsr.io/@std/async/1.5.0/delay.d.ts +0 -44
  286. package/esm/deps/jsr.io/@std/async/1.5.0/delay.js +0 -84
  287. package/esm/deps/jsr.io/@std/crypto/1.1.0/timing_safe_equal.d.ts +0 -39
  288. package/esm/deps/jsr.io/@std/crypto/1.1.0/timing_safe_equal.js +0 -61
  289. package/esm/deps/jsr.io/@std/encoding/1.0.11/_common16.d.ts +0 -22
  290. package/esm/deps/jsr.io/@std/encoding/1.0.11/_common16.js +0 -51
  291. package/esm/deps/jsr.io/@std/encoding/1.0.11/_common32.d.ts +0 -34
  292. package/esm/deps/jsr.io/@std/encoding/1.0.11/_common32.js +0 -192
  293. package/esm/deps/jsr.io/@std/encoding/1.0.11/_common64.d.ts +0 -34
  294. package/esm/deps/jsr.io/@std/encoding/1.0.11/_common64.js +0 -113
  295. package/esm/deps/jsr.io/@std/encoding/1.0.11/_common_detach.d.ts +0 -3
  296. package/esm/deps/jsr.io/@std/encoding/1.0.11/_common_detach.js +0 -13
  297. package/esm/deps/jsr.io/@std/encoding/1.0.11/_types.d.ts +0 -8
  298. package/esm/deps/jsr.io/@std/encoding/1.0.11/_types.js +0 -2
  299. package/esm/deps/jsr.io/@std/encoding/1.0.11/_validate_binary_like.d.ts +0 -1
  300. package/esm/deps/jsr.io/@std/encoding/1.0.11/_validate_binary_like.js +0 -26
  301. package/esm/deps/jsr.io/@std/encoding/1.0.11/ascii85.d.ts +0 -60
  302. package/esm/deps/jsr.io/@std/encoding/1.0.11/ascii85.js +0 -152
  303. package/esm/deps/jsr.io/@std/encoding/1.0.11/base32.d.ts +0 -39
  304. package/esm/deps/jsr.io/@std/encoding/1.0.11/base32.js +0 -87
  305. package/esm/deps/jsr.io/@std/encoding/1.0.11/base58.d.ts +0 -39
  306. package/esm/deps/jsr.io/@std/encoding/1.0.11/base58.js +0 -131
  307. package/esm/deps/jsr.io/@std/encoding/1.0.11/base64.d.ts +0 -39
  308. package/esm/deps/jsr.io/@std/encoding/1.0.11/base64.js +0 -82
  309. package/esm/deps/jsr.io/@std/encoding/1.0.11/base64url.d.ts +0 -39
  310. package/esm/deps/jsr.io/@std/encoding/1.0.11/base64url.js +0 -72
  311. package/esm/deps/jsr.io/@std/encoding/1.0.11/hex.d.ts +0 -38
  312. package/esm/deps/jsr.io/@std/encoding/1.0.11/hex.js +0 -87
  313. package/esm/deps/jsr.io/@std/encoding/1.0.11/mod.d.ts +0 -97
  314. package/esm/deps/jsr.io/@std/encoding/1.0.11/mod.js +0 -99
  315. package/esm/deps/jsr.io/@std/encoding/1.0.11/varint.d.ts +0 -119
  316. package/esm/deps/jsr.io/@std/encoding/1.0.11/varint.js +0 -209
  317. package/esm/deps/jsr.io/@std/http/1.1.3/status.d.ts +0 -343
  318. package/esm/deps/jsr.io/@std/http/1.1.3/status.js +0 -343
  319. package/esm/deps/jsr.io/@std/internal/1.0.14/assertion_state.d.ts +0 -159
  320. package/esm/deps/jsr.io/@std/internal/1.0.14/assertion_state.js +0 -223
  321. package/esm/deps/jsr.io/@std/internal/1.0.14/build_message.d.ts +0 -79
  322. package/esm/deps/jsr.io/@std/internal/1.0.14/build_message.js +0 -116
  323. package/esm/deps/jsr.io/@std/internal/1.0.14/diff.d.ts +0 -139
  324. package/esm/deps/jsr.io/@std/internal/1.0.14/diff.js +0 -277
  325. package/esm/deps/jsr.io/@std/internal/1.0.14/diff_str.d.ts +0 -98
  326. package/esm/deps/jsr.io/@std/internal/1.0.14/diff_str.js +0 -181
  327. package/esm/deps/jsr.io/@std/internal/1.0.14/format.d.ts +0 -29
  328. package/esm/deps/jsr.io/@std/internal/1.0.14/format.js +0 -68
  329. package/esm/deps/jsr.io/@std/internal/1.0.14/styles.d.ts +0 -158
  330. package/esm/deps/jsr.io/@std/internal/1.0.14/styles.js +0 -206
  331. package/esm/deps/jsr.io/@std/internal/1.0.14/types.d.ts +0 -24
  332. package/esm/deps/jsr.io/@std/internal/1.0.14/types.js +0 -3
  333. package/esm/deps/jsr.io/@std/testing/1.0.20/_test_suite.d.ts +0 -91
  334. package/esm/deps/jsr.io/@std/testing/1.0.20/_test_suite.js +0 -347
  335. package/esm/deps/jsr.io/@std/testing/1.0.20/bdd.d.ts +0 -382
  336. package/esm/deps/jsr.io/@std/testing/1.0.20/bdd.js +0 -1110
  337. package/esm/deps/jsr.io/@udibo/http-error/0.11.1/mod.d.ts +0 -363
  338. package/esm/deps/jsr.io/@udibo/http-error/0.11.1/mod.js +0 -616
  339. package/esm/package.json +0 -3
  340. /package/{esm → dist}/adapters/hono/bff/cookie-prefix.d.ts +0 -0
  341. /package/{esm → dist}/adapters/hono/bff/proxy.d.ts +0 -0
  342. /package/{esm → dist}/client/_http.js +0 -0
  343. /package/{esm → dist}/client/base.js +0 -0
  344. /package/{esm → dist}/client/browser-storage.js +0 -0
  345. /package/{esm → dist}/client/check.d.ts +0 -0
  346. /package/{esm → dist}/client/events.js +0 -0
  347. /package/{esm → dist}/client/storage.d.ts +0 -0
  348. /package/{esm → dist}/client/storage.js +0 -0
  349. /package/{esm → dist}/identity/captcha.d.ts +0 -0
  350. /package/{esm → dist}/identity/captcha.js +0 -0
  351. /package/{esm → dist}/identity/delivery.d.ts +0 -0
  352. /package/{esm → dist}/identity/delivery.js +0 -0
  353. /package/{esm → dist}/identity/errors.d.ts +0 -0
  354. /package/{esm → dist}/identity/errors.js +0 -0
  355. /package/{esm → dist}/identity/events.js +0 -0
  356. /package/{esm → dist}/identity/external/_token-exchange.d.ts +0 -0
  357. /package/{esm → dist}/identity/external/_token-exchange.js +0 -0
  358. /package/{esm → dist}/identity/external/errors.d.ts +0 -0
  359. /package/{esm → dist}/identity/external/errors.js +0 -0
  360. /package/{esm → dist}/identity/external/provider.d.ts +0 -0
  361. /package/{esm → dist}/identity/external/provider.js +0 -0
  362. /package/{esm → dist}/identity/identifier.d.ts +0 -0
  363. /package/{esm → dist}/identity/identifier.js +0 -0
  364. /package/{esm → dist}/identity/lockout.d.ts +0 -0
  365. /package/{esm → dist}/identity/mfa/recovery-codes.d.ts +0 -0
  366. /package/{esm → dist}/identity/mfa/recovery-codes.js +0 -0
  367. /package/{esm → dist}/identity/password-policy.d.ts +0 -0
  368. /package/{esm → dist}/identity/password-policy.js +0 -0
  369. /package/{esm → dist}/identity/password.d.ts +0 -0
  370. /package/{esm → dist}/identity/rate-limit.js +0 -0
  371. /package/{esm → dist}/identity/session.d.ts +0 -0
  372. /package/{esm → dist}/identity/token-flow.d.ts +0 -0
  373. /package/{esm → dist}/models/authentication.d.ts +0 -0
  374. /package/{esm → dist}/models/authentication.js +0 -0
  375. /package/{esm → dist}/models/authorization-code.js +0 -0
  376. /package/{esm → dist}/models/client.d.ts +0 -0
  377. /package/{esm → dist}/models/client.js +0 -0
  378. /package/{esm → dist}/models/device-authorization.js +0 -0
  379. /package/{esm → dist}/models/responses.d.ts +0 -0
  380. /package/{esm → dist}/models/responses.js +0 -0
  381. /package/{esm → dist}/models/scope.d.ts +0 -0
  382. /package/{esm → dist}/models/scope.js +0 -0
  383. /package/{esm → dist}/models/token.js +0 -0
  384. /package/{esm → dist}/react/components/types.js +0 -0
  385. /package/{esm → dist}/react/context.js +0 -0
  386. /package/{esm → dist}/react/provider.js +0 -0
  387. /package/{esm → dist}/react/require-auth.d.ts +0 -0
  388. /package/{esm → dist}/react/use-authorization.js +0 -0
  389. /package/{esm → dist}/server/_clock-skew.d.ts +0 -0
  390. /package/{esm → dist}/server/client-authentication.js +0 -0
  391. /package/{esm → dist}/server/grants/client-credentials.js +0 -0
  392. /package/{esm → dist}/server/grants/password.js +0 -0
  393. /package/{esm → dist}/server/redirect-uri.d.ts +0 -0
  394. /package/{esm → dist}/server/services/authorization-code.js +0 -0
  395. /package/{esm → dist}/server/services/client.js +0 -0
  396. /package/{esm → dist}/server/services/device-authorization.js +0 -0
  397. /package/{esm → dist}/server/services/user.js +0 -0
  398. /package/{esm → dist}/server/utils/hash.d.ts +0 -0
  399. /package/{esm → dist}/testing/contract/_race.d.ts +0 -0
  400. /package/{esm → dist}/testing/contract/_race.js +0 -0
  401. /package/{esm → dist}/testing/contract/tenant.d.ts +0 -0
  402. /package/{esm → dist}/utils/_body.d.ts +0 -0
  403. /package/{esm → dist}/utils/_body.js +0 -0
  404. /package/{esm → dist}/utils/_buffer.d.ts +0 -0
  405. /package/{esm → dist}/utils/_buffer.js +0 -0
  406. /package/{esm → dist}/utils/_default-fetch.d.ts +0 -0
  407. /package/{esm → dist}/utils/_timing-safe.d.ts +0 -0
  408. /package/{esm → dist}/utils/_timing-safe.js +0 -0
  409. /package/{esm → dist}/utils/authentication-context.js +0 -0
  410. /package/{esm → dist}/utils/basic-auth.d.ts +0 -0
  411. /package/{esm → dist}/utils/basic-auth.js +0 -0
  412. /package/{esm → dist}/utils/pkce.d.ts +0 -0
  413. /package/{esm → dist}/utils/text.d.ts +0 -0
@@ -1,223 +0,0 @@
1
- // Copyright 2018-2026 the Deno authors. MIT license.
2
- // This module is browser compatible.
3
- /**
4
- * Check the test suite internal state
5
- *
6
- * @example Usage
7
- * ```ts ignore
8
- * import { AssertionState } from "@std/internal";
9
- *
10
- * const assertionState = new AssertionState();
11
- * ```
12
- */
13
- export class AssertionState {
14
- #state;
15
- constructor() {
16
- this.#state = {
17
- assertionCount: undefined,
18
- assertionCheck: false,
19
- assertionTriggered: false,
20
- assertionTriggeredCount: 0,
21
- };
22
- if (typeof globalThis?.addEventListener === "function") {
23
- globalThis.addEventListener("unload", () => {
24
- this.#ensureCleanedUp();
25
- });
26
- }
27
- else if (
28
- // deno-lint-ignore no-explicit-any
29
- typeof globalThis?.process?.on === "function") {
30
- // deno-lint-ignore no-explicit-any
31
- globalThis.process.on("exit", () => {
32
- this.#ensureCleanedUp();
33
- });
34
- }
35
- else {
36
- // deno-lint-ignore no-console
37
- console.warn("AssertionCounter cleanup step was not registered");
38
- }
39
- }
40
- #ensureCleanedUp() {
41
- // If any checks were registered, after the test suite runs the checks,
42
- // `resetAssertionState` should also have been called. If it was not,
43
- // then the test suite did not run the checks.
44
- if (this.#state.assertionCheck ||
45
- this.#state.assertionCount !== undefined) {
46
- throw new Error("AssertionCounter was not cleaned up: If tests are not otherwise failing, ensure `expect.hasAssertion` and `expect.assertions` are only run in bdd tests");
47
- }
48
- }
49
- /**
50
- * Get the number that through `expect.assertions` api set.
51
- *
52
- * @returns the number that through `expect.assertions` api set.
53
- *
54
- * @example Usage
55
- * ```ts ignore
56
- * import { AssertionState } from "@std/internal";
57
- *
58
- * const assertionState = new AssertionState();
59
- * assertionState.assertionCount;
60
- * ```
61
- */
62
- get assertionCount() {
63
- return this.#state.assertionCount;
64
- }
65
- /**
66
- * Get a certain number that assertions were called before.
67
- *
68
- * @returns return a certain number that assertions were called before.
69
- *
70
- * @example Usage
71
- * ```ts ignore
72
- * import { AssertionState } from "@std/internal";
73
- *
74
- * const assertionState = new AssertionState();
75
- * assertionState.assertionTriggeredCount;
76
- * ```
77
- */
78
- get assertionTriggeredCount() {
79
- return this.#state.assertionTriggeredCount;
80
- }
81
- /**
82
- * If `expect.hasAssertions` called, then through this method to update #state.assertionCheck value.
83
- *
84
- * @param val Set #state.assertionCheck's value
85
- *
86
- * @example Usage
87
- * ```ts ignore
88
- * import { AssertionState } from "@std/internal";
89
- *
90
- * const assertionState = new AssertionState();
91
- * assertionState.setAssertionCheck(true);
92
- * ```
93
- */
94
- setAssertionCheck(val) {
95
- this.#state.assertionCheck = val;
96
- }
97
- /**
98
- * If any matchers was called, `#state.assertionTriggered` will be set through this method.
99
- *
100
- * @param val Set #state.assertionTriggered's value
101
- *
102
- * @example Usage
103
- * ```ts ignore
104
- * import { AssertionState } from "@std/internal";
105
- *
106
- * const assertionState = new AssertionState();
107
- * assertionState.setAssertionTriggered(true);
108
- * ```
109
- */
110
- setAssertionTriggered(val) {
111
- this.#state.assertionTriggered = val;
112
- }
113
- /**
114
- * If `expect.assertions` called, then through this method to update #state.assertionCheck value.
115
- *
116
- * @param num Set #state.assertionCount's value, for example if the value is set 2, that means
117
- * you must have two assertion matchers call in your test suite.
118
- *
119
- * @example Usage
120
- * ```ts ignore
121
- * import { AssertionState } from "@std/internal";
122
- *
123
- * const assertionState = new AssertionState();
124
- * assertionState.setAssertionCount(2);
125
- * ```
126
- */
127
- setAssertionCount(num) {
128
- this.#state.assertionCount = num;
129
- }
130
- /**
131
- * If any matchers was called, `#state.assertionTriggeredCount` value will plus one internally.
132
- *
133
- * @example Usage
134
- * ```ts ignore
135
- * import { AssertionState } from "@std/internal";
136
- *
137
- * const assertionState = new AssertionState();
138
- * assertionState.updateAssertionTriggerCount();
139
- * ```
140
- */
141
- updateAssertionTriggerCount() {
142
- if (this.#state.assertionCount !== undefined) {
143
- this.#state.assertionTriggeredCount += 1;
144
- }
145
- }
146
- /**
147
- * Check Assertion internal state, if `#state.assertionCheck` is set true, but
148
- * `#state.assertionTriggered` is still false, then should throw an Assertion Error.
149
- *
150
- * @returns a boolean value, that the test suite is satisfied with the check. If not,
151
- * it should throw an AssertionError.
152
- *
153
- * @example Usage
154
- * ```ts ignore
155
- * import { AssertionState } from "@std/internal";
156
- *
157
- * const assertionState = new AssertionState();
158
- * if (assertionState.checkAssertionErrorState()) {
159
- * // throw AssertionError("");
160
- * }
161
- * ```
162
- */
163
- checkAssertionErrorState() {
164
- return this.#state.assertionCheck && !this.#state.assertionTriggered;
165
- }
166
- /**
167
- * Reset all assertion state when every test suite function ran completely.
168
- *
169
- * @example Usage
170
- * ```ts ignore
171
- * import { AssertionState } from "@std/internal";
172
- *
173
- * const assertionState = new AssertionState();
174
- * assertionState.resetAssertionState();
175
- * ```
176
- */
177
- resetAssertionState() {
178
- this.#state = {
179
- assertionCount: undefined,
180
- assertionCheck: false,
181
- assertionTriggered: false,
182
- assertionTriggeredCount: 0,
183
- };
184
- }
185
- /**
186
- * Check Assertion called state, if `#state.assertionCount` is set to a number value, but
187
- * `#state.assertionTriggeredCount` is less then it, then should throw an assertion error.
188
- *
189
- * @returns a boolean value, that the test suite is satisfied with the check. If not,
190
- * it should throw an AssertionError.
191
- *
192
- * @example Usage
193
- * ```ts ignore
194
- * import { AssertionState } from "@std/internal";
195
- *
196
- * const assertionState = new AssertionState();
197
- * if (assertionState.checkAssertionCountSatisfied()) {
198
- * // throw AssertionError("");
199
- * }
200
- * ```
201
- */
202
- checkAssertionCountSatisfied() {
203
- return this.#state.assertionCount !== undefined &&
204
- this.#state.assertionCount !== this.#state.assertionTriggeredCount;
205
- }
206
- }
207
- const assertionState = new AssertionState();
208
- /**
209
- * return an instance of AssertionState
210
- *
211
- * @returns AssertionState
212
- *
213
- * @example Usage
214
- * ```ts ignore
215
- * import { getAssertionState } from "@std/internal";
216
- *
217
- * const assertionState = getAssertionState();
218
- * assertionState.setAssertionTriggered(true);
219
- * ```
220
- */
221
- export function getAssertionState() {
222
- return assertionState;
223
- }
@@ -1,79 +0,0 @@
1
- import type { DiffResult, DiffType } from "./types.js";
2
- /**
3
- * Colors the output of assertion diffs.
4
- *
5
- * @param diffType Difference type, either added or removed.
6
- * @param background If true, colors the background instead of the text.
7
- *
8
- * @returns A function that colors the input string.
9
- *
10
- * @example Usage
11
- * ```ts
12
- * import { createColor } from "@std/internal";
13
- * import { assertEquals } from "@std/assert";
14
- * import { bold, green, red, white } from "@std/fmt/colors";
15
- *
16
- * assertEquals(createColor("added")("foo"), green(bold("foo")));
17
- * assertEquals(createColor("removed")("foo"), red(bold("foo")));
18
- * assertEquals(createColor("common")("foo"), white("foo"));
19
- * ```
20
- */
21
- export declare function createColor(diffType: DiffType,
22
- /**
23
- * TODO(@littledivy): Remove this when we can detect true color terminals. See
24
- * https://github.com/denoland/std/issues/2575.
25
- */
26
- background?: boolean): (s: string) => string;
27
- /**
28
- * Prefixes `+` or `-` in diff output.
29
- *
30
- * @param diffType Difference type, either added or removed
31
- *
32
- * @returns A string representing the sign.
33
- *
34
- * @example Usage
35
- * ```ts
36
- * import { createSign } from "@std/internal";
37
- * import { assertEquals } from "@std/assert";
38
- *
39
- * assertEquals(createSign("added"), "+ ");
40
- * assertEquals(createSign("removed"), "- ");
41
- * assertEquals(createSign("common"), " ");
42
- * ```
43
- */
44
- export declare function createSign(diffType: DiffType): string;
45
- /** Options for {@linkcode buildMessage}. */
46
- export interface BuildMessageOptions {
47
- /**
48
- * Whether to output the diff as a single string.
49
- * @default {false}
50
- */
51
- stringDiff?: boolean;
52
- }
53
- /**
54
- * Builds a message based on the provided diff result.
55
- *
56
- * @param diffResult The diff result array.
57
- * @param options Optional parameters for customizing the message.
58
- * @param truncateDiff Function to truncate the diff (default is no truncation).
59
- *
60
- * @returns An array of strings representing the built message.
61
- *
62
- * @example Usage
63
- * ```ts no-assert
64
- * import { diffStr, buildMessage } from "@std/internal";
65
- *
66
- * diffStr("Hello, world!", "Hello, world");
67
- * // [
68
- * // "",
69
- * // "",
70
- * // " [Diff] Actual / Expected",
71
- * // "",
72
- * // "",
73
- * // "- Hello, world!",
74
- * // "+ Hello, world",
75
- * // "",
76
- * // ]
77
- * ```
78
- */
79
- export declare function buildMessage(diffResult: ReadonlyArray<DiffResult<string>>, options?: BuildMessageOptions, truncateDiff?: (diffResult: ReadonlyArray<DiffResult<string>>, stringDiff: boolean, contextLength?: number | null) => ReadonlyArray<DiffResult<string>>): string[];
@@ -1,116 +0,0 @@
1
- // Copyright 2018-2026 the Deno authors. MIT license.
2
- // This module is browser compatible.
3
- import { bgGreen, bgRed, bold, gray, green, red, white } from "./styles.js";
4
- /**
5
- * Colors the output of assertion diffs.
6
- *
7
- * @param diffType Difference type, either added or removed.
8
- * @param background If true, colors the background instead of the text.
9
- *
10
- * @returns A function that colors the input string.
11
- *
12
- * @example Usage
13
- * ```ts
14
- * import { createColor } from "@std/internal";
15
- * import { assertEquals } from "@std/assert";
16
- * import { bold, green, red, white } from "@std/fmt/colors";
17
- *
18
- * assertEquals(createColor("added")("foo"), green(bold("foo")));
19
- * assertEquals(createColor("removed")("foo"), red(bold("foo")));
20
- * assertEquals(createColor("common")("foo"), white("foo"));
21
- * ```
22
- */
23
- export function createColor(diffType,
24
- /**
25
- * TODO(@littledivy): Remove this when we can detect true color terminals. See
26
- * https://github.com/denoland/std/issues/2575.
27
- */
28
- background = false) {
29
- switch (diffType) {
30
- case "added":
31
- return (s) => background ? bgGreen(white(s)) : green(bold(s));
32
- case "removed":
33
- return (s) => background ? bgRed(white(s)) : red(bold(s));
34
- case "truncation":
35
- return gray;
36
- default:
37
- return white;
38
- }
39
- }
40
- /**
41
- * Prefixes `+` or `-` in diff output.
42
- *
43
- * @param diffType Difference type, either added or removed
44
- *
45
- * @returns A string representing the sign.
46
- *
47
- * @example Usage
48
- * ```ts
49
- * import { createSign } from "@std/internal";
50
- * import { assertEquals } from "@std/assert";
51
- *
52
- * assertEquals(createSign("added"), "+ ");
53
- * assertEquals(createSign("removed"), "- ");
54
- * assertEquals(createSign("common"), " ");
55
- * ```
56
- */
57
- export function createSign(diffType) {
58
- switch (diffType) {
59
- case "added":
60
- return "+ ";
61
- case "removed":
62
- return "- ";
63
- default:
64
- return " ";
65
- }
66
- }
67
- /**
68
- * Builds a message based on the provided diff result.
69
- *
70
- * @param diffResult The diff result array.
71
- * @param options Optional parameters for customizing the message.
72
- * @param truncateDiff Function to truncate the diff (default is no truncation).
73
- *
74
- * @returns An array of strings representing the built message.
75
- *
76
- * @example Usage
77
- * ```ts no-assert
78
- * import { diffStr, buildMessage } from "@std/internal";
79
- *
80
- * diffStr("Hello, world!", "Hello, world");
81
- * // [
82
- * // "",
83
- * // "",
84
- * // " [Diff] Actual / Expected",
85
- * // "",
86
- * // "",
87
- * // "- Hello, world!",
88
- * // "+ Hello, world",
89
- * // "",
90
- * // ]
91
- * ```
92
- */
93
- export function buildMessage(diffResult, options = {}, truncateDiff) {
94
- if (truncateDiff != null) {
95
- diffResult = truncateDiff(diffResult, options.stringDiff ?? false);
96
- }
97
- const { stringDiff = false } = options;
98
- const messages = [
99
- "",
100
- "",
101
- ` ${gray(bold("[Diff]"))} ${red(bold("Actual"))} / ${green(bold("Expected"))}`,
102
- "",
103
- "",
104
- ];
105
- const diffMessages = diffResult.map((result) => {
106
- const color = createColor(result.type);
107
- const line = result.type === "added" || result.type === "removed"
108
- ? result.details?.map((detail) => detail.type !== "common"
109
- ? createColor(detail.type, true)(detail.value)
110
- : detail.value).join("") ?? result.value
111
- : result.value;
112
- return color(`${createSign(result.type)}${line}`);
113
- });
114
- messages.push(...(stringDiff ? [diffMessages.join("")] : diffMessages), "");
115
- return messages;
116
- }
@@ -1,139 +0,0 @@
1
- import type { DiffResult, DiffType } from "./types.js";
2
- /** Represents the farthest point in the diff algorithm. */
3
- export interface FarthestPoint {
4
- /** The y-coordinate of the point. */
5
- y: number;
6
- /** The id of the point. */
7
- id: number;
8
- }
9
- /**
10
- * Creates an array of common elements between two arrays.
11
- *
12
- * @typeParam T The type of elements in the arrays.
13
- *
14
- * @param A The first array.
15
- * @param B The second array.
16
- *
17
- * @returns An array containing the common elements between the two arrays.
18
- *
19
- * @example Usage
20
- * ```ts
21
- * import { createCommon } from "@std/internal/diff";
22
- * import { assertEquals } from "@std/assert";
23
- *
24
- * const a = [1, 2, 3];
25
- * const b = [1, 2, 4];
26
- *
27
- * assertEquals(createCommon(a, b), [1, 2]);
28
- * ```
29
- */
30
- export declare function createCommon<T>(A: T[], B: T[]): T[];
31
- /**
32
- * Asserts that the value is a {@linkcode FarthestPoint}.
33
- * If not, an error is thrown.
34
- *
35
- * @param value The value to check.
36
- *
37
- * @returns A void value that returns once the assertion completes.
38
- *
39
- * @example Usage
40
- * ```ts
41
- * import { assertFp } from "@std/internal/diff";
42
- * import { assertThrows } from "@std/assert";
43
- *
44
- * assertFp({ y: 0, id: 0 });
45
- * assertThrows(() => assertFp({ id: 0 }));
46
- * assertThrows(() => assertFp({ y: 0 }));
47
- * assertThrows(() => assertFp(undefined));
48
- * ```
49
- */
50
- export declare function assertFp(value: unknown): asserts value is FarthestPoint;
51
- /**
52
- * Creates an array of backtraced differences.
53
- *
54
- * @typeParam T The type of elements in the arrays.
55
- *
56
- * @param A The first array.
57
- * @param B The second array.
58
- * @param current The current {@linkcode FarthestPoint}.
59
- * @param swapped Boolean indicating if the arrays are swapped.
60
- * @param routes The routes array.
61
- * @param diffTypesPtrOffset The offset of the diff types in the routes array.
62
- *
63
- * @returns An array of backtraced differences.
64
- *
65
- * @example Usage
66
- * ```ts
67
- * import { backTrace } from "@std/internal/diff";
68
- * import { assertEquals } from "@std/assert";
69
- *
70
- * assertEquals(
71
- * backTrace([], [], { y: 0, id: 0 }, false, new Uint32Array(0), 0),
72
- * [],
73
- * );
74
- * ```
75
- */
76
- export declare function backTrace<T>(A: T[], B: T[], current: FarthestPoint, swapped: boolean, routes: Uint32Array, diffTypesPtrOffset: number): Array<{
77
- type: DiffType;
78
- value: T;
79
- }>;
80
- /**
81
- * Creates a {@linkcode FarthestPoint}.
82
- *
83
- * @param k The current index.
84
- * @param M The length of the first array.
85
- * @param routes The routes array.
86
- * @param diffTypesPtrOffset The offset of the diff types in the routes array.
87
- * @param ptr The current pointer.
88
- * @param slide The slide {@linkcode FarthestPoint}.
89
- * @param down The down {@linkcode FarthestPoint}.
90
- *
91
- * @returns A {@linkcode FarthestPoint}.
92
- *
93
- * @example Usage
94
- * ```ts
95
- * import { createFp } from "@std/internal/diff";
96
- * import { assertEquals } from "@std/assert";
97
- *
98
- * assertEquals(
99
- * createFp(
100
- * 0,
101
- * 0,
102
- * new Uint32Array(0),
103
- * 0,
104
- * 0,
105
- * { y: -1, id: 0 },
106
- * { y: 0, id: 0 },
107
- * ),
108
- * { y: -1, id: 1 },
109
- * );
110
- * ```
111
- */
112
- export declare function createFp(k: number, M: number, routes: Uint32Array, diffTypesPtrOffset: number, ptr: number, slide?: FarthestPoint, down?: FarthestPoint): FarthestPoint;
113
- /**
114
- * Renders the differences between the actual and expected values.
115
- *
116
- * @typeParam T The type of elements in the arrays.
117
- *
118
- * @param A Actual value
119
- * @param B Expected value
120
- *
121
- * @returns An array of differences between the actual and expected values.
122
- *
123
- * @example Usage
124
- * ```ts
125
- * import { diff } from "@std/internal/diff";
126
- * import { assertEquals } from "@std/assert";
127
- *
128
- * const a = [1, 2, 3];
129
- * const b = [1, 2, 4];
130
- *
131
- * assertEquals(diff(a, b), [
132
- * { type: "common", value: 1 },
133
- * { type: "common", value: 2 },
134
- * { type: "removed", value: 3 },
135
- * { type: "added", value: 4 },
136
- * ]);
137
- * ```
138
- */
139
- export declare function diff<T>(A: T[], B: T[]): DiffResult<T>[];