Skip to content

Commit 7e83d1d

Browse files
authored
Merge pull request #91 from karthik2804/feat/add_entries_URLSearchParams
add entries method to URLSearchParams
2 parents 227f0b2 + 7b14ba7 commit 7e83d1d

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

crates/spin-js-engine/src/js_sdk/modules/url.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ class URLSearchParams {
8080
delete(key: string) {
8181
delete this.queryParams[key]
8282
}
83+
entries() {
84+
return Object.entries(this.queryParams)
85+
}
8386
get(key: string) {
8487
let val = this.queryParams[key]
8588
if (val) {

types/lib/modules/overrides.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ declare global {
2828
constructor(queryParamsString: string);
2929
append(key: string, val: string | Array<string>): void
3030
delete(key: string): void
31+
entries(): Array<[string, string | Array<string>]>
3132
get(key: string): string
3233
getAll(key: string): string[]
3334
has(key: string): boolean

0 commit comments

Comments
 (0)