Skip to content

Commit

Permalink
fix: use extensions for relative ts imports
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Oct 12, 2022
1 parent 29f34f9 commit 451998a
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/codecs/interface.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ByteView } from '../block/interface'
import type { ByteView } from '../block/interface.js'

/**
* IPLD encoder part of the codec.
Expand Down
2 changes: 1 addition & 1 deletion src/codecs/json.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/**
* @template T
* @typedef {import('./interface').ByteView<T>} ByteView
* @typedef {import('./interface.js').ByteView<T>} ByteView
*/

const textEncoder = new TextEncoder()
Expand Down
2 changes: 1 addition & 1 deletion src/codecs/raw.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { coerce } from '../bytes.js'

/**
* @template T
* @typedef {import('./interface').ByteView<T>} ByteView
* @typedef {import('./interface.js').ByteView<T>} ByteView
*/

export const name = 'raw'
Expand Down
2 changes: 1 addition & 1 deletion src/hashes/digest.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const equals = (a, b) => {
}

/**
* @typedef {import('./interface').MultihashDigest} MultihashDigest
* @typedef {import('./interface.js').MultihashDigest} MultihashDigest
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion src/hashes/hasher.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class Hasher {

/**
* @template {number} Alg
* @typedef {import('./interface').MultihashHasher} MultihashHasher
* @typedef {import('./interface.js').MultihashHasher} MultihashHasher
*/

/**
Expand Down
10 changes: 5 additions & 5 deletions src/interface.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export * from './bases/interface'
export * from './hashes/interface'
export * from './codecs/interface'
export * from './link/interface'
export * from './block/interface'
export * from './bases/interface.js'
export * from './hashes/interface.js'
export * from './codecs/interface.js'
export * from './link/interface.js'
export * from './block/interface.js'
6 changes: 3 additions & 3 deletions src/link/interface.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable @typescript-eslint/no-unnecessary-type-constraint */
/* eslint-disable no-use-before-define */
import type { MultihashDigest } from '../hashes/interface'
import type { MultibaseEncoder, MultibaseDecoder, Multibase } from '../bases/interface'
import type { Phantom, ByteView } from '../block/interface'
import type { MultihashDigest } from '../hashes/interface.js'
import type { MultibaseEncoder, MultibaseDecoder, Multibase } from '../bases/interface.js'
import type { Phantom, ByteView } from '../block/interface.js'

export type { MultihashDigest, MultibaseEncoder, MultibaseDecoder }
export type Version = 0 | 1
Expand Down
2 changes: 1 addition & 1 deletion src/traversal.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { base58btc } from './bases/base58.js'
* @template [C=number] - multicodec code corresponding to codec used to encode the block
* @template [A=number] - multicodec code corresponding to the hashing algorithm used in CID creation.
* @template [V=0|1] - CID version
* @typedef {import('./block/interface').BlockView<T, C, A, V>} BlockView
* @typedef {import('./block/interface.js').BlockView<T, C, A, V>} BlockView
*/

/**
Expand Down
1 change: 1 addition & 0 deletions test/ts-use/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "ts-use",
"private": true,
"type": "module",
"dependencies": {
"multiformats": "file:../../"
},
Expand Down
3 changes: 1 addition & 2 deletions test/ts-use/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"compilerOptions": {
"strict": true,
"moduleResolution": "node",
"module": "NodeNext",
"noImplicitAny": true,
"skipLibCheck": true,
"incremental": true
}
}

0 comments on commit 451998a

Please sign in to comment.