diff --git a/package.json b/package.json index a17af79..f341ec3 100644 --- a/package.json +++ b/package.json @@ -181,7 +181,7 @@ }, "devDependencies": { "@libp2p/peer-id-factory": "^4.0.2", - "aegir": "^42.1.1", + "aegir": "^44.1.1", "protons": "^7.3.3" }, "sideEffects": false diff --git a/src/index.ts b/src/index.ts index aac9f0c..f6373cc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -170,7 +170,7 @@ export async function create (peerId: PeerId, value: CID | PeerId | string, seq: // Validity in ISOString with nanoseconds precision and validity type EOL const expirationDate = new NanoDate(Date.now() + Number(lifetime)) const validityType = IpnsEntry.ValidityType.EOL - const ttlNs = BigInt(options.ttlNs != null ? options.ttlNs : DEFAULT_TTL_NS) + const ttlNs = BigInt(options.ttlNs ?? DEFAULT_TTL_NS) return _create(peerId, value, seq, validityType, expirationDate.toString(), ttlNs, options) } @@ -197,7 +197,7 @@ export async function createWithExpiration (peerId: PeerId, value: CID | PeerId export async function createWithExpiration (peerId: PeerId, value: CID | PeerId | string, seq: number | bigint, expiration: string, options: CreateOptions = defaultCreateOptions): Promise { const expirationDate = NanoDate.fromString(expiration) const validityType = IpnsEntry.ValidityType.EOL - const ttlNs = BigInt(options.ttlNs != null ? options.ttlNs : DEFAULT_TTL_NS) + const ttlNs = BigInt(options.ttlNs ?? DEFAULT_TTL_NS) return _create(peerId, value, seq, validityType, expirationDate.toString(), ttlNs, options) }