diff --git a/bun.lockb b/bun.lockb index 2667477..6a64bd7 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index b0247a1..1d6b323 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "author": "", "license": "MIT", "dependencies": { - "@rescript/core": "0.6.0", - "rescript": "11.0.0" + "@rescript/core": "1.6.1", + "rescript": "^12.0.0-alpha.5 " } } \ No newline at end of file diff --git a/src/Assert.res b/src/Assert.res index 3bb3f7e..ebb2499 100644 --- a/src/Assert.res +++ b/src/Assert.res @@ -36,13 +36,13 @@ external assertLess: ('a, 'a, ~msg: string=?) => unit = "assertLess" external assertLessOrEqual: ('a, 'a, ~msg: string=?) => unit = "assertLessOrEqual" @module("https://deno.land/std@0.212.0/assert/mod.ts") -external assertMatch: (string, Js.Re.t, ~msg: string=?) => unit = "assertMatch" +external assertMatch: (string, RegExp.t, ~msg: string=?) => unit = "assertMatch" @module("https://deno.land/std@0.212.0/assert/mod.ts") external assertNotEquals: ('a, 'a, ~msg: string=?) => unit = "assertNotEquals" @module("https://deno.land/std@0.212.0/assert/mod.ts") -external assertNotMatch: (string, Js.Re.t, ~msg: string=?) => unit = "assertNotMatch" +external assertNotMatch: (string, RegExp.t, ~msg: string=?) => unit = "assertNotMatch" @module("https://deno.land/std@0.212.0/assert/mod.ts") external assertNotStrictEquals: ('a, 'a, ~msg: string=?) => unit = "assertNotStrictEquals" diff --git a/src/Deno.res b/src/Deno.res index 283b071..9b7a63b 100644 --- a/src/Deno.res +++ b/src/Deno.res @@ -286,7 +286,7 @@ module ListenTlsOptions = { cert?: string, certFile?: string, keyFile?: string, - alpnProtocols?: Belt.Array.t, + alpnProtocols?: array, } } @@ -352,8 +352,8 @@ module ConnectTlsOptions = { port: int, hostname?: string, certFile?: string, - caCerts?: Belt.Array.t, - alpnProtocols?: Belt.Array.t, + caCerts?: array, + alpnProtocols?: array, certChain?: string, privateKey?: string, } @@ -408,14 +408,14 @@ module ResolveDnsOptions = { module StartTlsOptions = { type t = { hostname?: string, - caCerts?: Belt.Array.t, - alpnProtocols?: Belt.Array.t, + caCerts?: array, + alpnProtocols?: array, } } module CommandOptions = { type t<'a> = { - args?: Belt.Array.t, + args?: array, cwd?: string, clearEnv?: bool, env?: 'a, diff --git a/src/Globals.res b/src/Globals.res index 090178f..339793c 100644 --- a/src/Globals.res +++ b/src/Globals.res @@ -34,7 +34,7 @@ module Event = { @get external _CAPTURING_PHASE: t => int = "CAPTURING_PHASE" @get external _NONE: t => int = "NONE" - @send external composedPath: t => Belt.Array.t = "composedPath" + @send external composedPath: t => array = "composedPath" @send external preventDefault: t => unit = "preventDefault" @send external stopImmediatePropagation: t => unit = "stopImmediatePropagation" @send external stopPropagation: t => unit = "stopPropagation" @@ -204,7 +204,7 @@ module GPUSupportedLimits = { module GPUDeviceDescriptor = { type t - @get external requiredFeatures: t => Belt.Array.t = "extensions" + @get external requiredFeatures: t => array = "extensions" @get external requiredLimits: t => 'a = "requiredLimits" } @@ -246,10 +246,8 @@ module GPUAdapter = { @get external limits: t => GPUSupportedLimits.t = "limits" @get external isFallbackAdapter: t => bool = "isFallbackAdapter" @send - external requestAdapterInfo: ( - t, - ~unmaskHints: Belt.Array.t=?, - ) => Promise.t = "requestAdapterInfo" + external requestAdapterInfo: (t, ~unmaskHints: array=?) => Promise.t = + "requestAdapterInfo" @send external requestDevice: (t, ~descriptor: GPUDeviceDescriptor.t=?) => Promise.t = "requestDevice" @@ -268,7 +266,7 @@ module Navigator = { @get external hardwareConcurrency: t => int = "hardwareConcurrency" @get external userAgent: t => string = "userAgent" @get external language: t => string = "language" - @get external languages: t => Belt.Array.t = "languages" + @get external languages: t => array = "languages" } module URLSearchParams = { @@ -277,11 +275,11 @@ module URLSearchParams = { @get external size: t => int = "size" @send external append: (t, string, string) => unit = "append" @send external delete: (t, string) => unit = "delete" - @send external getAll: (t, string) => Belt.Array.t = "getAll" + @send external getAll: (t, string) => array = "getAll" @send external entries: t => 'a = "entries" @send external forEach: (t, (string, string, 'b) => unit, ~thisArg: 'c=?) => unit = "forEach" @send external get: (t, string) => string = "get" - @send external getAll: (t, string) => Belt.Array.t = "getAll" + @send external getAll: (t, string) => array = "getAll" @send external has: (t, string) => bool = "has" @send external keys: t => 'a = "keys" @send external set: (t, string, string) => unit = "set" @@ -351,7 +349,7 @@ module URLPattern = { @send external test: (t, URLPatternInput.t, ~baseURL: string=?) => bool = "test" @send - external exec: (t, URLPatternInput.t, ~baseURL: string=?) => option> = "exec" + external exec: (t, URLPatternInput.t, ~baseURL: string=?) => option> = "exec" } module ErrorEventInit = { @@ -469,7 +467,7 @@ module ReadableStream = { @send external pipeTo: ('a, ~options: PipeOptions.t=?) => Promise.t = "pipeTo" - @send external tee: t<'a> => Belt.Array.t> = "tee" + @send external tee: t<'a> => array> = "tee" @send external values: (t<'a>, ~options: 'b=?) => 'c = "values" } @@ -489,7 +487,7 @@ module Headers = { @send external get: (t, string) => option = "get" @send external has: (t, string) => bool = "has" @send external set: (t, string, string) => unit = "set" - @send external getSetCookie: t => Belt.Array.t = "getSetCookie" + @send external getSetCookie: t => array = "getSetCookie" } module BufferSource = { @@ -498,8 +496,8 @@ module BufferSource = { module BlobParts = { type t = - | BufferSources(Belt.Array.t) - | Strings(Belt.Array.t) + | BufferSources(array) + | Strings(array) } module BlobPropertyBag = { @@ -590,7 +588,7 @@ module FormData = { @send external get: (t, string) => option = "get" - @send external getAll: (t, string) => Belt.Array.t = "getAll" + @send external getAll: (t, string) => array = "getAll" @send external has: (t, string) => bool = "has" @@ -671,22 +669,19 @@ module RequestInit = { let _newBlob = (init: t<'a, 'b>, body: Blob.t) => { { body: Some(body), - cache: Belt.Option.getWithDefault(init.cache, ""), - credentials: Belt.Option.getWithDefault(init.credentials, ""), - destination: Belt.Option.getWithDefault(init.destination, ""), + cache: Option.getOr(init.cache, ""), + credentials: Option.getOr(init.credentials, ""), + destination: Option.getOr(init.destination, ""), headers: init.headers, - integrity: Belt.Option.getWithDefault(init.integrity, ""), - keepalive: Belt.Option.getWithDefault(init.keepalive, true), - method: Belt.Option.getWithDefault(init.method, "GET"), - mode: Belt.Option.getWithDefault(init.mode, "cors"), - redirect: Belt.Option.getWithDefault(init.redirect, "follow"), - referer: Belt.Option.getWithDefault(init.referer, ""), - refererPolicy: Belt.Option.getWithDefault(init.refererPolicy, ""), - signal: Belt.Option.getWithDefault( - init.signal, - AbortController.signal(AbortController.new()), - ), - window: Belt.Option.getWithDefault(init.window, Window.window), + integrity: Option.getOr(init.integrity, ""), + keepalive: Option.getOr(init.keepalive, true), + method: Option.getOr(init.method, "GET"), + mode: Option.getOr(init.mode, "cors"), + redirect: Option.getOr(init.redirect, "follow"), + referer: Option.getOr(init.referer, ""), + refererPolicy: Option.getOr(init.refererPolicy, ""), + signal: Option.getOr(init.signal, AbortController.signal(AbortController.new())), + window: Option.getOr(init.window, Window.window), } } @@ -694,22 +689,19 @@ module RequestInit = { let _newBufferSource = (init: t<'a, 'b>, body: BufferSource.t) => { { body: Some(body), - cache: Belt.Option.getWithDefault(init.cache, ""), - credentials: Belt.Option.getWithDefault(init.credentials, ""), - destination: Belt.Option.getWithDefault(init.destination, ""), + cache: Option.getOr(init.cache, ""), + credentials: Option.getOr(init.credentials, ""), + destination: Option.getOr(init.destination, ""), headers: init.headers, - integrity: Belt.Option.getWithDefault(init.integrity, ""), - keepalive: Belt.Option.getWithDefault(init.keepalive, true), - method: Belt.Option.getWithDefault(init.method, "GET"), - mode: Belt.Option.getWithDefault(init.mode, "cors"), - redirect: Belt.Option.getWithDefault(init.redirect, "follow"), - referer: Belt.Option.getWithDefault(init.referer, ""), - refererPolicy: Belt.Option.getWithDefault(init.refererPolicy, ""), - signal: Belt.Option.getWithDefault( - init.signal, - AbortController.signal(AbortController.new()), - ), - window: Belt.Option.getWithDefault(init.window, Window.window), + integrity: Option.getOr(init.integrity, ""), + keepalive: Option.getOr(init.keepalive, true), + method: Option.getOr(init.method, "GET"), + mode: Option.getOr(init.mode, "cors"), + redirect: Option.getOr(init.redirect, "follow"), + referer: Option.getOr(init.referer, ""), + refererPolicy: Option.getOr(init.refererPolicy, ""), + signal: Option.getOr(init.signal, AbortController.signal(AbortController.new())), + window: Option.getOr(init.window, Window.window), } } @@ -717,22 +709,19 @@ module RequestInit = { let _newFormData = (init: t<'a, 'b>, body: FormData.t) => { { body: Some(body), - cache: Belt.Option.getWithDefault(init.cache, ""), - credentials: Belt.Option.getWithDefault(init.credentials, ""), - destination: Belt.Option.getWithDefault(init.destination, ""), + cache: Option.getOr(init.cache, ""), + credentials: Option.getOr(init.credentials, ""), + destination: Option.getOr(init.destination, ""), headers: init.headers, - integrity: Belt.Option.getWithDefault(init.integrity, ""), - keepalive: Belt.Option.getWithDefault(init.keepalive, true), - method: Belt.Option.getWithDefault(init.method, "GET"), - mode: Belt.Option.getWithDefault(init.mode, "cors"), - redirect: Belt.Option.getWithDefault(init.redirect, "follow"), - referer: Belt.Option.getWithDefault(init.referer, ""), - refererPolicy: Belt.Option.getWithDefault(init.refererPolicy, ""), - signal: Belt.Option.getWithDefault( - init.signal, - AbortController.signal(AbortController.new()), - ), - window: Belt.Option.getWithDefault(init.window, Window.window), + integrity: Option.getOr(init.integrity, ""), + keepalive: Option.getOr(init.keepalive, true), + method: Option.getOr(init.method, "GET"), + mode: Option.getOr(init.mode, "cors"), + redirect: Option.getOr(init.redirect, "follow"), + referer: Option.getOr(init.referer, ""), + refererPolicy: Option.getOr(init.refererPolicy, ""), + signal: Option.getOr(init.signal, AbortController.signal(AbortController.new())), + window: Option.getOr(init.window, Window.window), } } @@ -740,22 +729,19 @@ module RequestInit = { let _newURLSearchParams = (init: t<'a, 'b>, body: URLSearchParams.t) => { { body: Some(body), - cache: Belt.Option.getWithDefault(init.cache, ""), - credentials: Belt.Option.getWithDefault(init.credentials, ""), - destination: Belt.Option.getWithDefault(init.destination, ""), + cache: Option.getOr(init.cache, ""), + credentials: Option.getOr(init.credentials, ""), + destination: Option.getOr(init.destination, ""), headers: init.headers, - integrity: Belt.Option.getWithDefault(init.integrity, ""), - keepalive: Belt.Option.getWithDefault(init.keepalive, true), - method: Belt.Option.getWithDefault(init.method, "GET"), - mode: Belt.Option.getWithDefault(init.mode, "cors"), - redirect: Belt.Option.getWithDefault(init.redirect, "follow"), - referer: Belt.Option.getWithDefault(init.referer, ""), - refererPolicy: Belt.Option.getWithDefault(init.refererPolicy, ""), - signal: Belt.Option.getWithDefault( - init.signal, - AbortController.signal(AbortController.new()), - ), - window: Belt.Option.getWithDefault(init.window, Window.window), + integrity: Option.getOr(init.integrity, ""), + keepalive: Option.getOr(init.keepalive, true), + method: Option.getOr(init.method, "GET"), + mode: Option.getOr(init.mode, "cors"), + redirect: Option.getOr(init.redirect, "follow"), + referer: Option.getOr(init.referer, ""), + refererPolicy: Option.getOr(init.refererPolicy, ""), + signal: Option.getOr(init.signal, AbortController.signal(AbortController.new())), + window: Option.getOr(init.window, Window.window), } } @@ -763,22 +749,19 @@ module RequestInit = { let _newReadableStream = (init: t<'a, 'b>, body: ReadableStream.t) => { { body: Some(body), - cache: Belt.Option.getWithDefault(init.cache, ""), - credentials: Belt.Option.getWithDefault(init.credentials, ""), - destination: Belt.Option.getWithDefault(init.destination, ""), + cache: Option.getOr(init.cache, ""), + credentials: Option.getOr(init.credentials, ""), + destination: Option.getOr(init.destination, ""), headers: init.headers, - integrity: Belt.Option.getWithDefault(init.integrity, ""), - keepalive: Belt.Option.getWithDefault(init.keepalive, true), - method: Belt.Option.getWithDefault(init.method, "GET"), - mode: Belt.Option.getWithDefault(init.mode, "cors"), - redirect: Belt.Option.getWithDefault(init.redirect, "follow"), - referer: Belt.Option.getWithDefault(init.referer, ""), - refererPolicy: Belt.Option.getWithDefault(init.refererPolicy, ""), - signal: Belt.Option.getWithDefault( - init.signal, - AbortController.signal(AbortController.new()), - ), - window: Belt.Option.getWithDefault(init.window, Window.window), + integrity: Option.getOr(init.integrity, ""), + keepalive: Option.getOr(init.keepalive, true), + method: Option.getOr(init.method, "GET"), + mode: Option.getOr(init.mode, "cors"), + redirect: Option.getOr(init.redirect, "follow"), + referer: Option.getOr(init.referer, ""), + refererPolicy: Option.getOr(init.refererPolicy, ""), + signal: Option.getOr(init.signal, AbortController.signal(AbortController.new())), + window: Option.getOr(init.window, Window.window), } } @@ -786,22 +769,19 @@ module RequestInit = { let _newString = (init: t<'a, 'b>, body: string) => { { body: Some(body), - cache: Belt.Option.getWithDefault(init.cache, ""), - credentials: Belt.Option.getWithDefault(init.credentials, ""), - destination: Belt.Option.getWithDefault(init.destination, ""), + cache: Option.getOr(init.cache, ""), + credentials: Option.getOr(init.credentials, ""), + destination: Option.getOr(init.destination, ""), headers: init.headers, - integrity: Belt.Option.getWithDefault(init.integrity, ""), - keepalive: Belt.Option.getWithDefault(init.keepalive, true), - method: Belt.Option.getWithDefault(init.method, "GET"), - mode: Belt.Option.getWithDefault(init.mode, "cors"), - redirect: Belt.Option.getWithDefault(init.redirect, "follow"), - referer: Belt.Option.getWithDefault(init.referer, ""), - refererPolicy: Belt.Option.getWithDefault(init.refererPolicy, ""), - signal: Belt.Option.getWithDefault( - init.signal, - AbortController.signal(AbortController.new()), - ), - window: Belt.Option.getWithDefault(init.window, Window.window), + integrity: Option.getOr(init.integrity, ""), + keepalive: Option.getOr(init.keepalive, true), + method: Option.getOr(init.method, "GET"), + mode: Option.getOr(init.mode, "cors"), + redirect: Option.getOr(init.redirect, "follow"), + referer: Option.getOr(init.referer, ""), + refererPolicy: Option.getOr(init.refererPolicy, ""), + signal: Option.getOr(init.signal, AbortController.signal(AbortController.new())), + window: Option.getOr(init.window, Window.window), } } }