Comparing version 1.0.4 to 1.0.5
@@ -5,3 +5,2 @@ "use strict"; | ||
const grpc_js_1 = require("@grpc/grpc-js"); | ||
const channel_1 = require("@grpc/grpc-js/build/src/channel"); | ||
function createChannel(address, credentials, options = {}) { | ||
@@ -12,3 +11,3 @@ const match = /^(?:([^:]+):\/\/)?(.*?)(?::(\d+))?$/.exec(address); | ||
} | ||
const [, protocol = 'http', host, port = protocol === 'http' ? '80' : '443',] = match; | ||
const [, protocol = 'http', host, port = protocol === 'http' ? '80' : '443'] = match; | ||
if (protocol === 'http') { | ||
@@ -29,3 +28,3 @@ credentials !== null && credentials !== void 0 ? credentials : (credentials = grpc_js_1.ChannelCredentials.createInsecure()); | ||
const state = channel.getConnectivityState(true); | ||
if (state === channel_1.ConnectivityState.READY) { | ||
if (state === grpc_js_1.connectivityState.READY) { | ||
return; | ||
@@ -32,0 +31,0 @@ } |
{ | ||
"name": "nice-grpc", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "A Node.js gRPC library that is nice to you", | ||
@@ -28,3 +28,3 @@ "keywords": [ | ||
"prepare:proto:grpc-js": "mkdirp ./fixtures/grpc-js && grpc_tools_node_protoc --plugin=protoc-gen-grpc=./node_modules/.bin/grpc_tools_node_protoc_plugin --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts --js_out=import_style=commonjs,binary:./fixtures/grpc-js --ts_out=grpc_js:./fixtures/grpc-js --grpc_out=grpc_js:./fixtures/grpc-js -I fixtures fixtures/*.proto", | ||
"prepare:proto:ts-proto": "mkdirp ./fixtures/ts-proto && grpc_tools_node_protoc --ts_proto_out=./fixtures/ts-proto --ts_proto_opt=outputServices=generic-definitions,esModuleInterop=true -I fixtures fixtures/*.proto", | ||
"prepare:proto:ts-proto": "mkdirp ./fixtures/ts-proto && grpc_tools_node_protoc --ts_proto_out=./fixtures/ts-proto --ts_proto_opt=outputServices=generic-definitions,useExactTypes=false,esModuleInterop=true -I fixtures fixtures/*.proto", | ||
"prepare:proto": "npm run prepare:proto:grpc-js && npm run prepare:proto:ts-proto", | ||
@@ -47,3 +47,3 @@ "prepare": "npm run prepare:proto" | ||
"rimraf": "^2.6.3", | ||
"ts-proto": "^1.82.0" | ||
"ts-proto": "^1.97.0" | ||
}, | ||
@@ -53,6 +53,6 @@ "dependencies": { | ||
"abort-controller-x": "^0.2.4", | ||
"nice-grpc-common": "^1.0.3", | ||
"nice-grpc-common": "^1.0.4", | ||
"node-abort-controller": "^1.2.1" | ||
}, | ||
"gitHead": "44e6462e3fd71bfbf2aa6a8717575f406baa75c2" | ||
"gitHead": "5d08d062313f513648d2632af85d77607513637c" | ||
} |
@@ -74,3 +74,3 @@ # nice-grpc [![npm version][npm-image]][npm-url] <!-- omit in toc --> | ||
--ts_proto_out=./compiled_proto \ | ||
--ts_proto_opt=outputServices=generic-definitions \ | ||
--ts_proto_opt=outputServices=generic-definitions,useExactTypes=false \ | ||
--proto_path=./proto \ | ||
@@ -77,0 +77,0 @@ ./proto/example.proto |
@@ -1,3 +0,7 @@ | ||
import {Channel, ChannelCredentials, ChannelOptions} from '@grpc/grpc-js'; | ||
import {ConnectivityState} from '@grpc/grpc-js/build/src/channel'; | ||
import { | ||
Channel, | ||
ChannelCredentials, | ||
ChannelOptions, | ||
connectivityState, | ||
} from '@grpc/grpc-js'; | ||
@@ -15,8 +19,4 @@ export function createChannel( | ||
const [ | ||
, | ||
protocol = 'http', | ||
host, | ||
port = protocol === 'http' ? '80' : '443', | ||
] = match; | ||
const [, protocol = 'http', host, port = protocol === 'http' ? '80' : '443'] = | ||
match; | ||
@@ -43,3 +43,3 @@ if (protocol === 'http') { | ||
if (state === ConnectivityState.READY) { | ||
if (state === connectivityState.READY) { | ||
return; | ||
@@ -46,0 +46,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
188734
3280
Updatednice-grpc-common@^1.0.4