Skip to content

Commit 2aeddc8

Browse files
committed
undo hasProperty use
1 parent 7d16dbc commit 2aeddc8

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

spec/common/providers/identity.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ describe("identity", () => {
920920

921921
it("should not return recaptchaActionOverride if undefined", () => {
922922
const payload = identity.generateResponsePayload(TEST_RESPONSE_RECAPTCHA_UNDEFINED);
923-
expect(Object.hasOwn(payload, "recaptchaActionOverride")).to.be.false;
923+
expect(Object.prototype.hasOwnProperty.call(payload, "recaptchaActionOverride")).to.be.false;
924924
expect(payload).to.deep.equal(EXPECT_PAYLOAD_UNDEFINED);
925925
});
926926
});

spec/helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export function checkAuthContext(
136136
expect(context.auth.token.aud).to.equal(projectId);
137137

138138
// TaskContext & TaskRequest don't have instanceIdToken
139-
if (Object.hasOwn(context, "instanceIdToken")) {
139+
if (Object.prototype.hasOwnProperty.call(context, "instanceIdToken")) {
140140
expect((context as https.CallableContext).instanceIdToken).to.be.undefined;
141141
}
142142
}

src/common/encoding.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export function copyIfPresent<Src, Dest>(
4949
return;
5050
}
5151
for (const field of fields) {
52-
if (!Object.hasOwn(src, field)) {
52+
if (!Object.prototype.hasOwnProperty.call(src, field)) {
5353
continue;
5454
}
5555
dest[field] = src[field] as any;
@@ -68,7 +68,7 @@ export function convertIfPresent<Src, Dest>(
6868
if (!src) {
6969
return;
7070
}
71-
if (!Object.hasOwn(src, srcField)) {
71+
if (!Object.prototype.hasOwnProperty.call(src, srcField)) {
7272
return;
7373
}
7474
dest[destField] = converter(src[srcField]);

src/common/providers/database.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ export class DataSnapshot implements database.DataSnapshot {
289289
let maxKey = 0;
290290
let allIntegerKeys = true;
291291
for (const key in node) {
292-
if (!Object.hasOwn(node, key)) {
292+
if (!Object.prototype.hasOwnProperty.call(node, key)) {
293293
continue;
294294
}
295295
const childNode = node[key];

src/common/providers/identity.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ export function validateAuthResponse(
815815
}
816816
if (authRequest.customClaims) {
817817
const invalidClaims = DISALLOWED_CUSTOM_CLAIMS.filter((claim) =>
818-
Object.hasOwn(authRequest.customClaims, claim)
818+
Object.prototype.hasOwnProperty.call(authRequest.customClaims, claim)
819819
);
820820
if (invalidClaims.length > 0) {
821821
throw new HttpsError(
@@ -832,7 +832,10 @@ export function validateAuthResponse(
832832
}
833833
if (eventType === "beforeSignIn" && (authRequest as BeforeSignInResponse).sessionClaims) {
834834
const invalidClaims = DISALLOWED_CUSTOM_CLAIMS.filter((claim) =>
835-
Object.hasOwn((authRequest as BeforeSignInResponse).sessionClaims, claim)
835+
Object.prototype.hasOwnProperty.call(
836+
(authRequest as BeforeSignInResponse).sessionClaims,
837+
claim
838+
)
836839
);
837840
if (invalidClaims.length > 0) {
838841
throw new HttpsError(
@@ -874,7 +877,10 @@ export function getUpdateMask(authResponse?: BeforeCreateResponse | BeforeSignIn
874877
}
875878
const updateMask: string[] = [];
876879
for (const key in authResponse) {
877-
if (Object.hasOwn(authResponse, key) && typeof authResponse[key] !== "undefined") {
880+
if (
881+
Object.prototype.hasOwnProperty.call(authResponse, key) &&
882+
typeof authResponse[key] !== "undefined"
883+
) {
878884
updateMask.push(key);
879885
}
880886
}

0 commit comments

Comments
 (0)