Skip to content

Commit 695def9

Browse files
committed
remove duplicate type
1 parent 48c3103 commit 695def9

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,10 @@ interface ExpectedNull {
258258
type: 'null';
259259
}
260260

261+
/**
262+
* a pair of `ts.TemplateLiteralType.texts` and the `intrinsicName`s for `ts.TemplateLiteralType.types`,
263+
* @see https://github.com/microsoft/TypeScript/pull/40336
264+
*/
261265
type TemplateLiteralPair = [string, 'string' | 'number' | 'bigint' | 'any' | 'undefined' | 'null' | undefined];
262266

263267
interface ExpectedTemplateLiteral {

src/transform-inline/visitor-type-check.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import * as VisitorIndexedAccess from './visitor-indexed-access';
77
import * as VisitorIsStringKeyof from './visitor-is-string-keyof';
88
import * as VisitorTypeName from './visitor-type-name';
99
import { sliceSet } from './utils';
10+
import {TemplateLiteralPair} from '../../index';
1011

1112
function visitDateType(type: ts.ObjectType, visitorContext: VisitorContext) {
1213
const name = VisitorTypeName.visitType(type, visitorContext, { type: 'type-check' });
@@ -695,7 +696,7 @@ function visitTemplateLiteralType(type: ts.TemplateLiteralType, visitorContext:
695696
const name = VisitorTypeName.visitType(type, visitorContext, {type: 'type-check'});
696697
const typePairs = type.texts.reduce((prev, curr, i: number) =>
697698
[...prev, [curr, typeof type.types[i] === 'undefined' ? undefined : VisitorUtils.getIntrinsicName(type.types[i])]] as never,
698-
[] as VisitorUtils.TemplateLiteralPair[]
699+
[] as TemplateLiteralPair[]
699700
)
700701
const templateLiteralTypeError = VisitorUtils.createErrorObject({
701702
type: 'template-literal',

src/transform-inline/visitor-utils.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ import * as tsutils from 'tsutils/typeguard/3.0';
44
import { VisitorContext } from './visitor-context';
55
import { Reason } from '../../index';
66

7-
/**
8-
* a pair of {@link ts.TemplateLiteralType.texts} and the `intrinsicName`s for {@link ts.TemplateLiteralType.types},
9-
* @see https://github.com/microsoft/TypeScript/pull/40336
10-
*/
11-
export type TemplateLiteralPair = [string, 'string' | 'number' | 'bigint' | 'any' | 'undefined' | 'null' | undefined];
12-
137
export const objectIdentifier = ts.createIdentifier('object');
148
export const pathIdentifier = ts.createIdentifier('path');
159
const keyIdentifier = ts.createIdentifier('key');

0 commit comments

Comments
 (0)