Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[@azure/service-bus] Fix invalid check for Node #12985

Merged
merged 2 commits into from
Dec 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions sdk/servicebus/service-bus/src/util/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import isBuffer from "is-buffer";
import { Buffer } from "buffer";
import * as Constants from "../util/constants";
import { AbortError, AbortSignalLike } from "@azure/abort-controller";
import { HttpOperationResponse, HttpResponse } from "@azure/core-http";
import { HttpOperationResponse, HttpResponse, isNode } from "@azure/core-http";

// This is the only dependency we have on DOM types, so rather than require
// the DOM lib we can just shim this in.
Expand All @@ -25,13 +25,6 @@ interface Navigator {
*/
declare const navigator: Navigator;

/**
* @internal
* @ignore
* A constant that indicates whether the environment is node.js or browser based.
*/
export const isNode = typeof navigator === "undefined" && typeof process !== "undefined";

/**
* @internal
* @ignore
Expand Down
3 changes: 2 additions & 1 deletion sdk/servicebus/service-bus/test/atomManagement.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { isNode } from "@azure/core-http";
import { PageSettings } from "@azure/core-paging";
import { DefaultAzureCredential } from "@azure/identity";
import chai from "chai";
Expand All @@ -19,7 +20,7 @@ import {
ServiceBusAdministrationClient,
WithResponse
} from "../src/serviceBusAtomManagementClient";
import { EntityStatus, EntityAvailabilityStatus, isNode } from "../src/util/utils";
import { EntityStatus, EntityAvailabilityStatus } from "../src/util/utils";
import { EnvVarNames, getEnvVars } from "./utils/envVarUtils";
import { recreateQueue, recreateSubscription, recreateTopic } from "./utils/managementUtils";
import { EntityNames } from "./utils/testUtils";
Expand Down
2 changes: 1 addition & 1 deletion sdk/servicebus/service-bus/test/streamingReceiver.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import {
getRandomTestClientTypeWithNoSessions
} from "./utils/testutils2";
import { getDeliveryProperty } from "./utils/misc";
import { isNode } from "../src/util/utils";
import { verifyMessageCount } from "./utils/managementUtils";
import sinon from "sinon";
import { isNode } from "@azure/core-http";

const should = chai.should();
chai.use(chaiAsPromised);
Expand Down