Skip to content
This repository has been archived by the owner on Sep 8, 2023. It is now read-only.

Commit

Permalink
breaking: replace cuid with paralleldrive/cuid2 package (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
miguel-osuna authored Apr 10, 2023
1 parent 2685454 commit df6c72e
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 18 deletions.
6 changes: 3 additions & 3 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.

'use strict'

const Cuid = require('cuid')
const { createId } = require('@paralleldrive/cuid2')
const CircuitBreakerState = require('circuit-state')
const Hoek = require('@hapi/hoek')

Expand All @@ -35,7 +35,7 @@ class ServiceClient {
this._servicename = servicename
this._config = config
this._version = version
this._id = Cuid()
this._id = createId()

// Build the base url for this client
if (typeof config.hostname === 'function') {
Expand Down Expand Up @@ -95,7 +95,7 @@ class ServiceClient {
})

// Use our own requestId instead of the one request generates.
const requestId = Cuid()
const requestId = createId()

let baseUrl
if (hostPrefix) {
Expand Down
4 changes: 2 additions & 2 deletions lib/http/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ limitations under the License.

const Wreck = require('@hapi/wreck')
const QueryString = require('querystring')
const Cuid = require('cuid')
const { createId } = require('@paralleldrive/cuid2')

const Read = require('./read')

Expand Down Expand Up @@ -176,7 +176,7 @@ const retryable = function (method, path, options, hooks) {
}

const create = async function (method, path, options, hooks = {}) {
const id = Cuid()
const id = createId()

// If it is going to retry connect failures, use the retryable wrapper.
const deferred = options.maxConnectRetry > 0 ? retryable : makeRequest
Expand Down
45 changes: 33 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
"dependencies": {
"@hapi/hoek": "^9.0.4 || ^10.0.0 || ^11.0.1",
"@hapi/wreck": "^17.0.0",
"@paralleldrive/cuid2": "^2.2.0",
"circuit-state": "^1.0.0",
"cuid": "^3.0.0",
"debug": "^4.0.0",
"individual": "^3.0.0",
"joi": "^17.7.0"
Expand Down

0 comments on commit df6c72e

Please sign in to comment.