Skip to content

Commit 347621c

Browse files
authored
[engsys][monitor-query] upgrade typescript version to ~4.8.0 (Azure#24582)
to be consistent with most packages in the repository. - Fix compiler errors. Use `Extract<Thing, Record<PropertyName, unknown>>` instead of `Thing & Record<PropertyName, unknown>`
1 parent 6219391 commit 347621c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

common/config/rush/pnpm-lock.yaml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/monitor/monitor-query/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
"prettier": "^2.5.1",
145145
"rimraf": "^3.0.0",
146146
"source-map-support": "^0.5.9",
147-
"typescript": "~4.6.0",
147+
"typescript": "~4.8.0",
148148
"@azure-tools/test-credential": "^1.0.0"
149149
},
150150
"//sampleConfiguration": {

sdk/monitor/monitor-query/src/timespanConversion.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export function convertIntervalToTimeIntervalObject(timespan: string): QueryTime
4747
export function objectHasProperty<Thing, PropertyName extends string>(
4848
thing: Thing,
4949
property: PropertyName
50-
): thing is Thing & Record<PropertyName, unknown> {
50+
): thing is Extract<Thing, Record<PropertyName, unknown>> {
5151
return typeof thing === "object" && property in (thing as Record<string, unknown>);
5252
}
5353

@@ -70,7 +70,7 @@ export function isDefined<T>(thing: T | undefined | null): thing is T {
7070
export function isObjectWithProperties<Thing, PropertyName extends string>(
7171
thing: Thing,
7272
properties: PropertyName[]
73-
): thing is Thing & Record<PropertyName, unknown> {
73+
): thing is Extract<Thing, Record<PropertyName, unknown>> {
7474
if (!isDefined(thing) || typeof thing !== "object") {
7575
return false;
7676
}

0 commit comments

Comments
 (0)