Skip to content

Commit

Permalink
Upgrade TypeScript to 4.9.4 (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandongregoryscott authored Jan 5, 2023
1 parent a4f9fc6 commit e2c7e4c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"sinon": "^7.2.7",
"size-limit": "^4.5.4",
"ts-node": "^8.1.0",
"typescript": "^3.4.5",
"typescript": "4.9.4",
"webpack": "^4.30.0",
"xo": "^0.24.0"
},
Expand Down Expand Up @@ -161,7 +161,7 @@
"size-limit": [
{
"path": "dist/src/index.js",
"limit": "55 KB",
"limit": "65 KB",
"running": false,
"gzip": false
}
Expand Down
9 changes: 6 additions & 3 deletions src/utils/split-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,21 @@ interface Dictionary<T> {
[key: string]: T
}

export interface SplitProps<P, K extends keyof P> {
export interface SplitProps<P extends Dictionary<any>, K extends keyof P> {
matchedProps: Pick<P, K>
remainingProps: Omit<P, K>
}

/**
* Utility to split props based on an array of keys
*/
export default function splitProps<P extends Dictionary<any>, K extends keyof P>(props: P, keys: K[]): SplitProps<P, K> {
export default function splitProps<P extends Dictionary<any>, K extends keyof P>(
props: P,
keys: K[]
): SplitProps<P, K> {
const matchedProps = {} as Pick<P, K>
const remainingProps = {} as P
const propKeys= Object.keys(props) as K[]
const propKeys = Object.keys(props) as K[]

for (let i = 0; i < propKeys.length; i++) {
const propKey = propKeys[i]
Expand Down
2 changes: 1 addition & 1 deletion src/utils/style-sheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export default class CustomStyleSheet {
const sheet = this.getSheet()

// This is the ultrafast version, works across browsers
if (this.isSpeedy && sheet && sheet.insertRule) {
if (this.isSpeedy && sheet != null) {
this._insert(sheet, rule)
} else {
last(this.tags).append(document.createTextNode(rule))
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12966,10 +12966,10 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=

typescript@^3.4.5:
version "3.4.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.4.5.tgz#2d2618d10bb566572b8d7aad5180d84257d70a99"
integrity sha512-YycBxUb49UUhdNMU5aJ7z5Ej2XGmaIBL0x34vZ82fn3hGvD+bgrMrVDpatgz2f7YxUMJxMkbWxJZeAvDxVe7Vw==
typescript@4.9.4:
version "4.9.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.4.tgz#a2a3d2756c079abda241d75f149df9d561091e78"
integrity sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==

typescript@^4.0.3:
version "4.0.3"
Expand Down

0 comments on commit e2c7e4c

Please sign in to comment.