diff options
author | 2021-11-15 15:45:37 -0800 | |
---|---|---|
committer | 2021-11-22 10:21:28 -0800 | |
commit | 6ee673095cbddc97a56bae7a512a5271d4a977a2 (patch) | |
tree | 5f7271af9f06ed74551393e722dd35b1b5ecef11 /packages/bun-framework-next/server-polyfills.tsx | |
parent | cf4964c8f435e25cbcbe43ba8ac0533a1467ef74 (diff) | |
download | bun-6ee673095cbddc97a56bae7a512a5271d4a977a2.tar.gz bun-6ee673095cbddc97a56bae7a512a5271d4a977a2.tar.zst bun-6ee673095cbddc97a56bae7a512a5271d4a977a2.zip |
continue fixing typescript errors
Diffstat (limited to 'packages/bun-framework-next/server-polyfills.tsx')
-rw-r--r-- | packages/bun-framework-next/server-polyfills.tsx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/packages/bun-framework-next/server-polyfills.tsx b/packages/bun-framework-next/server-polyfills.tsx index d34c08fc5..8942154b7 100644 --- a/packages/bun-framework-next/server-polyfills.tsx +++ b/packages/bun-framework-next/server-polyfills.tsx @@ -7,15 +7,23 @@ globalThis.Buffer = Buffer; import * as React from "react"; class URL { - constructor(base, source) { + pathname: string; + href: string; + + constructor(base: string, source: string) { this.pathname = source; this.href = base + source; } } + var onlyChildPolyfill = React.Children.only; React.Children.only = function (children) { - if (children && typeof children === "object" && children.length == 1) { + if ( + children && + typeof children === "object" && + (children as any).length == 1 + ) { return onlyChildPolyfill(children[0]); } |