Skip to content

Commit 451998a

Browse files
committed
fix: use extensions for relative ts imports
Ref: #199 (comment)
1 parent 29f34f9 commit 451998a

File tree

10 files changed

+16
-16
lines changed

10 files changed

+16
-16
lines changed

src/codecs/interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ByteView } from '../block/interface'
1+
import type { ByteView } from '../block/interface.js'
22

33
/**
44
* IPLD encoder part of the codec.

src/codecs/json.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/**
44
* @template T
5-
* @typedef {import('./interface').ByteView<T>} ByteView
5+
* @typedef {import('./interface.js').ByteView<T>} ByteView
66
*/
77

88
const textEncoder = new TextEncoder()

src/codecs/raw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { coerce } from '../bytes.js'
44

55
/**
66
* @template T
7-
* @typedef {import('./interface').ByteView<T>} ByteView
7+
* @typedef {import('./interface.js').ByteView<T>} ByteView
88
*/
99

1010
export const name = 'raw'

src/hashes/digest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const equals = (a, b) => {
6161
}
6262

6363
/**
64-
* @typedef {import('./interface').MultihashDigest} MultihashDigest
64+
* @typedef {import('./interface.js').MultihashDigest} MultihashDigest
6565
*/
6666

6767
/**

src/hashes/hasher.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export class Hasher {
5252

5353
/**
5454
* @template {number} Alg
55-
* @typedef {import('./interface').MultihashHasher} MultihashHasher
55+
* @typedef {import('./interface.js').MultihashHasher} MultihashHasher
5656
*/
5757

5858
/**

src/interface.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
export * from './bases/interface'
2-
export * from './hashes/interface'
3-
export * from './codecs/interface'
4-
export * from './link/interface'
5-
export * from './block/interface'
1+
export * from './bases/interface.js'
2+
export * from './hashes/interface.js'
3+
export * from './codecs/interface.js'
4+
export * from './link/interface.js'
5+
export * from './block/interface.js'

src/link/interface.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* eslint-disable @typescript-eslint/no-unnecessary-type-constraint */
22
/* eslint-disable no-use-before-define */
3-
import type { MultihashDigest } from '../hashes/interface'
4-
import type { MultibaseEncoder, MultibaseDecoder, Multibase } from '../bases/interface'
5-
import type { Phantom, ByteView } from '../block/interface'
3+
import type { MultihashDigest } from '../hashes/interface.js'
4+
import type { MultibaseEncoder, MultibaseDecoder, Multibase } from '../bases/interface.js'
5+
import type { Phantom, ByteView } from '../block/interface.js'
66

77
export type { MultihashDigest, MultibaseEncoder, MultibaseDecoder }
88
export type Version = 0 | 1

src/traversal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { base58btc } from './bases/base58.js'
1212
* @template [C=number] - multicodec code corresponding to codec used to encode the block
1313
* @template [A=number] - multicodec code corresponding to the hashing algorithm used in CID creation.
1414
* @template [V=0|1] - CID version
15-
* @typedef {import('./block/interface').BlockView<T, C, A, V>} BlockView
15+
* @typedef {import('./block/interface.js').BlockView<T, C, A, V>} BlockView
1616
*/
1717

1818
/**

test/ts-use/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "ts-use",
33
"private": true,
4+
"type": "module",
45
"dependencies": {
56
"multiformats": "file:../../"
67
},

test/ts-use/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
{
22
"compilerOptions": {
33
"strict": true,
4-
"moduleResolution": "node",
4+
"module": "NodeNext",
55
"noImplicitAny": true,
6-
"skipLibCheck": true,
76
"incremental": true
87
}
98
}

0 commit comments

Comments
 (0)