Skip to content

Commit 3b1ceeb

Browse files
Split internal.d.ts into multiple files (#906)
1 parent bb57638 commit 3b1ceeb

24 files changed

+822
-807
lines changed

script/test/source-files-extension.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@ const process = require('node:process');
44

55
const checkSourceFilesExtension = async () => {
66
try {
7-
const files = await fs.promises.readdir('source');
7+
const files = await fs.promises.readdir('source', {recursive: true});
88

99
let hasIncorrectFileExtension = false;
1010
for (const file of files) {
11+
if (!file.includes('.')) {
12+
continue;
13+
}
14+
1115
if (!file.endsWith('.d.ts')) {
1216
hasIncorrectFileExtension = true;
1317
console.error(`source/${file} extension should be \`.d.ts\`.`);

source/array-slice.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type {LessThanOrEqual} from './less-than-or-equal';
33
import type {GreaterThanOrEqual} from './greater-than-or-equal';
44
import type {GreaterThan} from './greater-than';
55
import type {IsNegative} from './numeric';
6-
import type {Not, ArrayMin} from './internal';
6+
import type {Not, TupleMin} from './internal';
77
import type {IsEqual} from './is-equal';
88
import type {And} from './and';
99
import type {ArraySplice} from './array-splice';
@@ -95,7 +95,7 @@ type ArraySliceHelper<
9595
PositiveE extends number = IsNegative<End> extends true ? Sum<ArrayLength, End> : End,
9696
> = true extends [IsNegative<PositiveS>, LessThanOrEqual<PositiveE, PositiveS>, GreaterThanOrEqual<PositiveS, ArrayLength>][number]
9797
? []
98-
: ArraySliceByPositiveIndex<Array_, ArrayMin<[PositiveS, ArrayLength]>, ArrayMin<[PositiveE, ArrayLength]>>;
98+
: ArraySliceByPositiveIndex<Array_, TupleMin<[PositiveS, ArrayLength]>, TupleMin<[PositiveE, ArrayLength]>>;
9999

100100
type ArraySliceByPositiveIndex<
101101
Array_ extends readonly unknown[],

source/delimiter-case.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type {UpperCaseCharacters, WordSeparators} from '../source/internal';
1+
import type {UpperCaseCharacters, WordSeparators} from './internal';
22

33
// Transforms a string that is fully uppercase into a fully lowercase version. Needed to add support for SCREAMING_SNAKE_CASE, see https://github.com/sindresorhus/type-fest/issues/385
44
type UpperCaseToLowerCase<T extends string> = T extends Uppercase<T> ? Lowercase<T> : T;

source/get.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type {StringDigit} from '../source/internal';
1+
import type {StringDigit} from './internal';
22
import type {Split} from './split';
33
import type {StringKeyOf} from './string-key-of';
44

0 commit comments

Comments
 (0)