Skip to content

Commit

Permalink
Add tsignores
Browse files Browse the repository at this point in the history
  • Loading branch information
hsubox76 committed Oct 5, 2021
1 parent 5ab9103 commit f8348bf
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/firestore/src/platform/node/grpc_connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@
* limitations under the License.
*/

// This is a hack fix for Node ES modules to use `require`.
// @ts-ignore To avoid using `allowSyntheticDefaultImports` flag.
import module from 'module';

import {
Metadata,
GrpcObject,
credentials as GrpcCredentials,
ServiceError
} from '@grpc/grpc-js';
import { version as grpcVersion } from '@grpc/grpc-js/package.json';

import { Token } from '../../api/credentials';
import { DatabaseInfo } from '../../core/database_info';
Expand All @@ -35,6 +38,12 @@ import { logError, logDebug, logWarn } from '../../util/log';
import { NodeCallback, nodePromise } from '../../util/node_api';
import { Deferred } from '../../util/promise';

// This is a hack fix for Node ES modules to use `require`.
// @ts-ignore To avoid using `--module es2020` flag.
const require = module.createRequire(import.meta.url);
// eslint-disable-next-line @typescript-eslint/no-require-imports
const { version: grpcVersion } = require('@grpc/grpc-js/package.json');

const LOG_TAG = 'Connection';
const X_GOOG_API_CLIENT_VALUE = `gl-node/${process.versions.node} fire/${SDK_VERSION} grpc/${grpcVersion}`;

Expand Down

0 comments on commit f8348bf

Please sign in to comment.