Skip to content

Commit 2c68a1a

Browse files
committed
remove .d.ts from import paths
1 parent 7fb11f4 commit 2c68a1a

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/index.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ function parentDir(p) {
3737
return path.dirname(p) || path.sep;
3838
}
3939

40-
/** @type {import('./index.d.ts').LoaderSync} */
40+
/** @type {import('./index').LoaderSync} */
4141
const jsonLoader = (_, content) => JSON.parse(content);
42-
/** @type {import('./index.d.ts').LoadersSync} */
42+
/** @type {import('./index').LoadersSync} */
4343
const defaultLoadersSync = Object.freeze({
4444
'.js': require,
4545
'.json': require,
@@ -48,7 +48,7 @@ const defaultLoadersSync = Object.freeze({
4848
});
4949
module.exports.defaultLoadersSync = defaultLoadersSync;
5050

51-
/** @type {import('./index.d.ts').Loader} */
51+
/** @type {import('./index').Loader} */
5252
const dynamicImport = async id => {
5353
try {
5454
const mod = await import(id);
@@ -74,7 +74,7 @@ const dynamicImport = async id => {
7474
}
7575
};
7676

77-
/** @type {import('./index.d.ts').Loaders} */
77+
/** @type {import('./index').Loaders} */
7878
const defaultLoaders = Object.freeze({
7979
'.js': dynamicImport,
8080
'.mjs': dynamicImport,
@@ -86,12 +86,12 @@ module.exports.defaultLoaders = defaultLoaders;
8686

8787
/**
8888
* @param {string} name
89-
* @param {import('./index.d.ts').Options | import('./index.d.ts').OptionsSync} options
89+
* @param {import('./index').Options | import('./index').OptionsSync} options
9090
* @param {boolean} sync
91-
* @returns {Required<import('./index.d.ts').Options | import('./index.d.ts').OptionsSync>}
91+
* @returns {Required<import('./index').Options | import('./index').OptionsSync>}
9292
*/
9393
function getOptions(name, options, sync) {
94-
/** @type {Required<import('./index.d.ts').Options>} */
94+
/** @type {Required<import('./index').Options>} */
9595
const conf = {
9696
stopDir: os.homedir(),
9797
searchPlaces: getDefaultSearchPlaces(name, sync),
@@ -138,7 +138,7 @@ function validateFilePath(filepath) {
138138
if (!filepath) throw new Error('load must pass a non-empty string');
139139
}
140140

141-
/** @type {(loader: import('./index.d.ts').Loader, ext: string) => void} */
141+
/** @type {(loader: import('./index').Loader, ext: string) => void} */
142142
function validateLoader(loader, ext) {
143143
if (!loader) throw new Error(`No loader specified for extension "${ext}"`);
144144
if (typeof loader !== 'function')
@@ -151,7 +151,7 @@ const makeEmplace = enableCache => (c, filepath, res) => {
151151
return res;
152152
};
153153

154-
/** @type {import('./index.d.ts').lilconfig} */
154+
/** @type {import('./index').lilconfig} */
155155
module.exports.lilconfig = function lilconfig(name, options) {
156156
const {
157157
ignoreEmptySearchPlaces,
@@ -168,7 +168,7 @@ module.exports.lilconfig = function lilconfig(name, options) {
168168

169169
return {
170170
async search(searchFrom = process.cwd()) {
171-
/** @type {import('./index.d.ts').LilconfigResult} */
171+
/** @type {import('./index').LilconfigResult} */
172172
const result = {
173173
config: null,
174174
filepath: '',
@@ -264,7 +264,7 @@ module.exports.lilconfig = function lilconfig(name, options) {
264264
}),
265265
);
266266
}
267-
/** @type {import('./index.d.ts').LilconfigResult} */
267+
/** @type {import('./index').LilconfigResult} */
268268
const result = {
269269
config: null,
270270
filepath: absPath,
@@ -310,7 +310,7 @@ module.exports.lilconfig = function lilconfig(name, options) {
310310
};
311311
};
312312

313-
/** @type {import('./index.d.ts').lilconfigSync} */
313+
/** @type {import('./index').lilconfigSync} */
314314
module.exports.lilconfigSync = function lilconfigSync(name, options) {
315315
const {
316316
ignoreEmptySearchPlaces,
@@ -327,7 +327,7 @@ module.exports.lilconfigSync = function lilconfigSync(name, options) {
327327

328328
return {
329329
search(searchFrom = process.cwd()) {
330-
/** @type {import('./index.d.ts').LilconfigResult} */
330+
/** @type {import('./index').LilconfigResult} */
331331
const result = {
332332
config: null,
333333
filepath: '',

0 commit comments

Comments
 (0)