Skip to content

Commit 3f1277c

Browse files
committed
Add deprecatedCompat for isParameter
1 parent 5f0023a commit 3f1277c

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import {
2+
Node,
3+
ParameterDeclaration,
4+
SyntaxKind,
5+
} from "../_namespaces/ts";
6+
import {
7+
deprecate,
8+
} from "../deprecate";
9+
10+
// DEPRECATION: Renamed node tests
11+
// DEPRECATION PLAN:
12+
// - soft: 5.5
13+
// - warn: 5.6
14+
// - error: TBD
15+
/** @deprecated Use `isParameterDeclaration` instead. */
16+
export const isParameter = deprecate(function isParameter(node: Node): node is ParameterDeclaration {
17+
return node.kind === SyntaxKind.Parameter;
18+
}, {
19+
since: "5.5",
20+
warnAfter: "5.6",
21+
message: "Use `isParameterDeclaration` instead.",
22+
});

src/deprecatedCompat/_namespaces/ts.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
export * from "../../compiler/_namespaces/ts";
44
export * from "../deprecations";
55
export * from "../5.0/identifierProperties";
6+
export * from "../5.5/isParameter";

tests/baselines/reference/api/typescript.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11205,5 +11205,7 @@ declare namespace ts {
1120511205
* @param compilerOptions Optional compiler options.
1120611206
*/
1120711207
function transform<T extends Node>(source: T | T[], transformers: TransformerFactory<T>[], compilerOptions?: CompilerOptions): TransformationResult<T>;
11208+
/** @deprecated Use `isParameterDeclaration` instead. */
11209+
const isParameter: (node: Node) => node is ParameterDeclaration;
1120811210
}
1120911211
export = ts;

0 commit comments

Comments
 (0)