Skip to content

Commit

Permalink
Split internal.d.ts into multiple files (#906)
Browse files Browse the repository at this point in the history
  • Loading branch information
tommy-mitchell authored Jul 14, 2024
1 parent bb57638 commit 3b1ceeb
Show file tree
Hide file tree
Showing 24 changed files with 822 additions and 807 deletions.
6 changes: 5 additions & 1 deletion script/test/source-files-extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ const process = require('node:process');

const checkSourceFilesExtension = async () => {
try {
const files = await fs.promises.readdir('source');
const files = await fs.promises.readdir('source', {recursive: true});

let hasIncorrectFileExtension = false;
for (const file of files) {
if (!file.includes('.')) {
continue;
}

if (!file.endsWith('.d.ts')) {
hasIncorrectFileExtension = true;
console.error(`source/${file} extension should be \`.d.ts\`.`);
Expand Down
4 changes: 2 additions & 2 deletions source/array-slice.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {LessThanOrEqual} from './less-than-or-equal';
import type {GreaterThanOrEqual} from './greater-than-or-equal';
import type {GreaterThan} from './greater-than';
import type {IsNegative} from './numeric';
import type {Not, ArrayMin} from './internal';
import type {Not, TupleMin} from './internal';
import type {IsEqual} from './is-equal';
import type {And} from './and';
import type {ArraySplice} from './array-splice';
Expand Down Expand Up @@ -95,7 +95,7 @@ type ArraySliceHelper<
PositiveE extends number = IsNegative<End> extends true ? Sum<ArrayLength, End> : End,
> = true extends [IsNegative<PositiveS>, LessThanOrEqual<PositiveE, PositiveS>, GreaterThanOrEqual<PositiveS, ArrayLength>][number]
? []
: ArraySliceByPositiveIndex<Array_, ArrayMin<[PositiveS, ArrayLength]>, ArrayMin<[PositiveE, ArrayLength]>>;
: ArraySliceByPositiveIndex<Array_, TupleMin<[PositiveS, ArrayLength]>, TupleMin<[PositiveE, ArrayLength]>>;

type ArraySliceByPositiveIndex<
Array_ extends readonly unknown[],
Expand Down
2 changes: 1 addition & 1 deletion source/delimiter-case.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type {UpperCaseCharacters, WordSeparators} from '../source/internal';
import type {UpperCaseCharacters, WordSeparators} from './internal';

// 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
type UpperCaseToLowerCase<T extends string> = T extends Uppercase<T> ? Lowercase<T> : T;
Expand Down
2 changes: 1 addition & 1 deletion source/get.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type {StringDigit} from '../source/internal';
import type {StringDigit} from './internal';
import type {Split} from './split';
import type {StringKeyOf} from './string-key-of';

Expand Down
Loading

0 comments on commit 3b1ceeb

Please sign in to comment.