Skip to content

Commit dd79003

Browse files
committed
fix: make inputs be optional in d.ts and adjust length
1 parent 16c67c1 commit dd79003

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

jstz_api/src/urlpattern.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -518,12 +518,12 @@ impl NativeClass for UrlPatternClass {
518518
.accessor(js_string!("username"), username, Attribute::all())
519519
.method(
520520
js_string!("test"),
521-
2,
521+
0,
522522
NativeFunction::from_fn_ptr(UrlPatternClass::test),
523523
)
524524
.method(
525525
js_string!("exec"),
526-
2,
526+
0,
527527
NativeFunction::from_fn_ptr(UrlPatternClass::exec),
528528
);
529529
Ok(())

packages/jstz-types/index.d.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ declare interface URLPatternResult {
7272
}
7373

7474
declare interface URLPattern {
75-
test(input: URLPatternInput, baseURL?: string): boolean;
76-
exec(input: URLPatternInput, baseURL?: string): URLPatternResult | null;
75+
test(input?: URLPatternInput, baseURL?: string): boolean;
76+
exec(input?: URLPatternInput, baseURL?: string): URLPatternResult | null;
7777
readonly hash: string;
7878
readonly hostname: string;
7979
readonly password: string;
@@ -86,7 +86,7 @@ declare interface URLPattern {
8686

8787
declare var URLPattern: {
8888
readonly prototype: URLPattern;
89-
new (input: URLPatternInput, baseURL?: string): URLPattern;
89+
new (input?: URLPatternInput, baseURL?: string): URLPattern;
9090
};
9191

9292
declare type BufferSource = ArrayBufferView | ArrayBuffer;

0 commit comments

Comments
 (0)