@signpostmarv/ts-assert 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { AccessorDeclaration, ArrayBindingElement, ArrayBindingPattern, ArrayLiteralExpression, ArrayTypeNode, ArrowFunction, AsExpression, AssertionExpression, AssertsKeyword, AsteriskToken, AutoAccessorPropertyDeclaration, AwaitExpression, AwaitKeyword, BigIntLiteral, BinaryExpression, BinaryOperatorToken, BindingElement, BindingName, BindingPattern, Block, BreakOrContinueStatement, BreakStatement, Bundle, CallChain, CallExpression, CallLikeExpression, CallSignatureDeclaration, CaseBlock, CaseClause, CaseOrDefaultClause, CatchClause, ClassDeclaration, ClassElement, ClassExpression, ClassLikeDeclaration, ClassStaticBlockDeclaration, ColonToken, CommaListExpression, ComputedPropertyName, ConciseBody, ConditionalExpression, ConditionalTypeNode, ConstructorDeclaration, ConstructorTypeNode, ConstructSignatureDeclaration, ContinueStatement, DebuggerStatement, DeclarationStatement, Decorator, DefaultClause, DeleteExpression, DoStatement, DotDotDotToken, ElementAccessChain, ElementAccessExpression, EmptyStatement, EntityName, EnumDeclaration, EnumMember, EqualsGreaterThanToken, ExclamationToken, ExportAssignment, ExportDeclaration, ExportSpecifier, Expression, ExpressionStatement, ExpressionWithTypeArguments, ExternalModuleReference, ForInitializer, ForInStatement, ForOfStatement, ForStatement, FunctionDeclaration, FunctionExpression, FunctionTypeNode, GetAccessorDeclaration, HeritageClause, Identifier, IfStatement, ImportAttribute, ImportAttributeName, ImportAttributes, ImportClause, ImportDeclaration, ImportEqualsDeclaration, ImportSpecifier, ImportTypeNode, IndexedAccessTypeNode, IndexSignatureDeclaration, InferTypeNode, InterfaceDeclaration, IntersectionTypeNode, JSDoc, JSDocAllType, JSDocAugmentsTag, JSDocAuthorTag, JSDocCallbackTag, JSDocClassTag, JSDocDeprecatedTag, JSDocEnumTag, JSDocFunctionType, JSDocImplementsTag, JSDocImportTag, JSDocLink, JSDocLinkCode, JSDocLinkPlain, JSDocMemberName, JSDocNamepathType, JSDocNameReference, JSDocNonNullableType, JSDocNullableType, JSDocOptionalType, JSDocOverloadTag, JSDocOverrideTag, JSDocParameterTag, JSDocPrivateTag, JSDocPropertyLikeTag, JSDocPropertyTag, JSDocProtectedTag, JSDocPublicTag, JSDocReadonlyTag, JSDocReturnTag, JSDocSatisfiesTag, JSDocSeeTag, JSDocSignature, JSDocTemplateTag, JSDocThisTag, JSDocThrowsTag, JSDocTypedefTag, JSDocTypeExpression, JSDocTypeLiteral, JSDocTypeTag, JSDocUnknownTag, JSDocUnknownType, JSDocVariadicType, JsxAttribute, JsxAttributeLike, JsxAttributes, JsxChild, JsxClosingElement, JsxClosingFragment, JsxElement, JsxExpression, JsxFragment, JsxNamespacedName, JsxOpeningElement, JsxOpeningFragment, JsxOpeningLikeElement, JsxSelfClosingElement, JsxSpreadAttribute, JsxTagNameExpression, JsxText, LabeledStatement, LeftHandSideExpression, LiteralExpression, LiteralTypeNode, MappedTypeNode, MemberName, MetaProperty, MethodDeclaration, MethodSignature, MinusToken, MissingDeclaration, Modifier, ModifierLike, ModuleBlock, ModuleBody, ModuleDeclaration, ModuleName, ModuleReference, NamedExportBindings, NamedExports, NamedImportBindings, NamedImports, NamedTupleMember, NamespaceExport, NamespaceExportDeclaration, NamespaceImport, NewExpression, Node, NonNullChain, NonNullExpression, NoSubstitutionTemplateLiteral, NotEmittedStatement, NumericLiteral, ObjectBindingPattern, ObjectLiteralElement, ObjectLiteralElementLike, ObjectLiteralExpression, OmittedExpression, OptionalTypeNode, ParameterDeclaration, ParenthesizedExpression, ParenthesizedTypeNode, PartiallyEmittedExpression, PlusToken, PostfixUnaryExpression, PrefixUnaryExpression, PrivateIdentifier, PropertyAccessChain, PropertyAccessExpression, PropertyAssignment, PropertyDeclaration, PropertyName, PropertySignature, QualifiedName, QuestionDotToken, QuestionToken, RegularExpressionLiteral, RestTypeNode, ReturnStatement, SatisfiesExpression, SemicolonClassElement, SetAccessorDeclaration, ShorthandPropertyAssignment, SourceFile, SpreadAssignment, SpreadElement, Statement, StringLiteral, SwitchStatement, SyntheticExpression, TaggedTemplateExpression, TemplateExpression, TemplateHead, TemplateLiteral, TemplateLiteralToken, TemplateLiteralTypeNode, TemplateLiteralTypeSpan, TemplateMiddle, TemplateSpan, TemplateTail, ThisTypeNode, ThrowStatement, TryStatement, TupleTypeNode, TypeAliasDeclaration, TypeAssertion, TypeElement, TypeLiteralNode, TypeNode, TypeOfExpression, TypeOnlyAliasDeclaration, TypeOnlyExportDeclaration, TypeOnlyImportDeclaration, TypeOperatorNode, TypeParameterDeclaration, TypePredicateNode, TypeQueryNode, TypeReferenceNode, UnionTypeNode, VariableDeclaration, VariableDeclarationList, VariableStatement, VoidExpression, WhileStatement, WithStatement, YieldExpression } from "typescript";
1
+ import type { AccessorDeclaration, ArrayBindingElement, ArrayBindingPattern, ArrayLiteralExpression, ArrayTypeNode, ArrowFunction, AsExpression, AssertionExpression, AssertsKeyword, AsteriskToken, AutoAccessorPropertyDeclaration, AwaitExpression, AwaitKeyword, BigIntLiteral, BinaryExpression, BinaryOperatorToken, BindingElement, BindingName, BindingPattern, Block, BreakOrContinueStatement, BreakStatement, Bundle, CallChain, CallExpression, CallLikeExpression, CallSignatureDeclaration, CaseBlock, CaseClause, CaseOrDefaultClause, CatchClause, ClassDeclaration, ClassElement, ClassExpression, ClassLikeDeclaration, ClassStaticBlockDeclaration, ColonToken, CommaListExpression, ComputedPropertyName, ConciseBody, ConditionalExpression, ConditionalTypeNode, ConstructorDeclaration, ConstructorTypeNode, ConstructSignatureDeclaration, ContinueStatement, DebuggerStatement, DeclarationStatement, Decorator, DefaultClause, DeleteExpression, DoStatement, DotDotDotToken, ElementAccessChain, ElementAccessExpression, EmptyStatement, EntityName, EnumDeclaration, EnumMember, EqualsGreaterThanToken, ExclamationToken, ExportAssignment, ExportDeclaration, ExportSpecifier, Expression, ExpressionStatement, ExpressionWithTypeArguments, ExternalModuleReference, ForInitializer, ForInStatement, ForOfStatement, ForStatement, FunctionDeclaration, FunctionExpression, FunctionTypeNode, GetAccessorDeclaration, HeritageClause, Identifier, IfStatement, ImportAttribute, ImportAttributeName, ImportAttributes, ImportClause, ImportDeclaration, ImportEqualsDeclaration, ImportSpecifier, ImportTypeNode, IndexedAccessTypeNode, IndexSignatureDeclaration, InferTypeNode, InterfaceDeclaration, IntersectionTypeNode, JSDoc, JSDocAllType, JSDocAugmentsTag, JSDocAuthorTag, JSDocCallbackTag, JSDocClassTag, JSDocDeprecatedTag, JSDocEnumTag, JSDocFunctionType, JSDocImplementsTag, JSDocImportTag, JSDocLink, JSDocLinkCode, JSDocLinkPlain, JSDocMemberName, JSDocNamepathType, JSDocNameReference, JSDocNonNullableType, JSDocNullableType, JSDocOptionalType, JSDocOverloadTag, JSDocOverrideTag, JSDocParameterTag, JSDocPrivateTag, JSDocPropertyLikeTag, JSDocPropertyTag, JSDocProtectedTag, JSDocPublicTag, JSDocReadonlyTag, JSDocReturnTag, JSDocSatisfiesTag, JSDocSeeTag, JSDocSignature, JSDocTemplateTag, JSDocThisTag, JSDocThrowsTag, JSDocTypedefTag, JSDocTypeExpression, JSDocTypeLiteral, JSDocTypeTag, JSDocUnknownTag, JSDocUnknownType, JSDocVariadicType, JsxAttribute, JsxAttributeLike, JsxAttributes, JsxCallLike, JsxChild, JsxClosingElement, JsxClosingFragment, JsxElement, JsxExpression, JsxFragment, JsxNamespacedName, JsxOpeningElement, JsxOpeningFragment, JsxOpeningLikeElement, JsxSelfClosingElement, JsxSpreadAttribute, JsxTagNameExpression, JsxText, LabeledStatement, LeftHandSideExpression, LiteralExpression, LiteralTypeNode, MappedTypeNode, MemberName, MetaProperty, MethodDeclaration, MethodSignature, MinusToken, MissingDeclaration, Modifier, ModifierLike, ModuleBlock, ModuleBody, ModuleDeclaration, ModuleExportName, ModuleName, ModuleReference, NamedExportBindings, NamedExports, NamedImportBindings, NamedImports, NamedTupleMember, NamespaceExport, NamespaceExportDeclaration, NamespaceImport, NewExpression, Node, NonNullChain, NonNullExpression, NoSubstitutionTemplateLiteral, NotEmittedStatement, NumericLiteral, ObjectBindingPattern, ObjectLiteralElement, ObjectLiteralElementLike, ObjectLiteralExpression, OmittedExpression, OptionalTypeNode, ParameterDeclaration, ParenthesizedExpression, ParenthesizedTypeNode, PartiallyEmittedExpression, PlusToken, PostfixUnaryExpression, PrefixUnaryExpression, PrivateIdentifier, PropertyAccessChain, PropertyAccessExpression, PropertyAssignment, PropertyDeclaration, PropertyName, PropertySignature, QualifiedName, QuestionDotToken, QuestionToken, RegularExpressionLiteral, RestTypeNode, ReturnStatement, SatisfiesExpression, SemicolonClassElement, SetAccessorDeclaration, ShorthandPropertyAssignment, SourceFile, SpreadAssignment, SpreadElement, Statement, StringLiteral, SwitchStatement, SyntheticExpression, TaggedTemplateExpression, TemplateExpression, TemplateHead, TemplateLiteral, TemplateLiteralToken, TemplateLiteralTypeNode, TemplateLiteralTypeSpan, TemplateMiddle, TemplateSpan, TemplateTail, ThisTypeNode, ThrowStatement, TryStatement, TupleTypeNode, TypeAliasDeclaration, TypeAssertion, TypeElement, TypeLiteralNode, TypeNode, TypeOfExpression, TypeOnlyAliasDeclaration, TypeOnlyExportDeclaration, TypeOnlyImportDeclaration, TypeOperatorNode, TypeParameterDeclaration, TypePredicateNode, TypeQueryNode, TypeReferenceNode, UnionTypeNode, VariableDeclaration, VariableDeclarationList, VariableStatement, VoidExpression, WhileStatement, WithStatement, YieldExpression } from "typescript";
2
2
  export declare function isAccessor(node: Node, message?: string | Error): asserts node is AccessorDeclaration;
3
3
  export declare function isArrayBindingElement(node: Node, message?: string | Error): asserts node is ArrayBindingElement;
4
4
  export declare function isArrayBindingPattern(node: Node, message?: string | Error): asserts node is ArrayBindingPattern;
@@ -138,6 +138,7 @@ export declare function isJSDocVariadicType(node: Node, message?: string | Error
138
138
  export declare function isJsxAttribute(node: Node, message?: string | Error): asserts node is JsxAttribute;
139
139
  export declare function isJsxAttributeLike(node: Node, message?: string | Error): asserts node is JsxAttributeLike;
140
140
  export declare function isJsxAttributes(node: Node, message?: string | Error): asserts node is JsxAttributes;
141
+ export declare function isJsxCallLike(node: Node, message?: string | Error): asserts node is JsxCallLike;
141
142
  export declare function isJsxChild(node: Node, message?: string | Error): asserts node is JsxChild;
142
143
  export declare function isJsxClosingElement(node: Node, message?: string | Error): asserts node is JsxClosingElement;
143
144
  export declare function isJsxClosingFragment(node: Node, message?: string | Error): asserts node is JsxClosingFragment;
@@ -168,6 +169,7 @@ export declare function isModifierLike(node: Node, message?: string | Error): as
168
169
  export declare function isModuleBlock(node: Node, message?: string | Error): asserts node is ModuleBlock;
169
170
  export declare function isModuleBody(node: Node, message?: string | Error): asserts node is ModuleBody;
170
171
  export declare function isModuleDeclaration(node: Node, message?: string | Error): asserts node is ModuleDeclaration;
172
+ export declare function isModuleExportName(node: Node, message?: string | Error): asserts node is ModuleExportName;
171
173
  export declare function isModuleName(node: Node, message?: string | Error): asserts node is ModuleName;
172
174
  export declare function isModuleReference(node: Node, message?: string | Error): asserts node is ModuleReference;
173
175
  export declare function isNamedExportBindings(node: Node, message?: string | Error): asserts node is NamedExportBindings;
@@ -398,6 +400,7 @@ declare const _default: {
398
400
  isJsxAttribute: typeof isJsxAttribute;
399
401
  isJsxAttributeLike: typeof isJsxAttributeLike;
400
402
  isJsxAttributes: typeof isJsxAttributes;
403
+ isJsxCallLike: typeof isJsxCallLike;
401
404
  isJsxChild: typeof isJsxChild;
402
405
  isJsxClosingElement: typeof isJsxClosingElement;
403
406
  isJsxClosingFragment: typeof isJsxClosingFragment;
@@ -428,6 +431,7 @@ declare const _default: {
428
431
  isModuleBlock: typeof isModuleBlock;
429
432
  isModuleBody: typeof isModuleBody;
430
433
  isModuleDeclaration: typeof isModuleDeclaration;
434
+ isModuleExportName: typeof isModuleExportName;
431
435
  isModuleName: typeof isModuleName;
432
436
  isModuleReference: typeof isModuleReference;
433
437
  isNamedExportBindings: typeof isNamedExportBindings;
@@ -417,6 +417,9 @@ export function isJsxAttributeLike(node, message = `expected JsxAttributeLike, r
417
417
  export function isJsxAttributes(node, message = `expected JsxAttributes, received ${ts.SyntaxKind[node.kind]}`) {
418
418
  assert.equal(ts.isJsxAttributes(node), true, message);
419
419
  }
420
+ export function isJsxCallLike(node, message = `expected JsxCallLike, received ${ts.SyntaxKind[node.kind]}`) {
421
+ assert.equal(ts.isJsxCallLike(node), true, message);
422
+ }
420
423
  export function isJsxChild(node, message = `expected JsxChild, received ${ts.SyntaxKind[node.kind]}`) {
421
424
  assert.equal(ts.isJsxChild(node), true, message);
422
425
  }
@@ -507,6 +510,9 @@ export function isModuleBody(node, message = `expected ModuleBody, received ${ts
507
510
  export function isModuleDeclaration(node, message = `expected ModuleDeclaration, received ${ts.SyntaxKind[node.kind]}`) {
508
511
  assert.equal(ts.isModuleDeclaration(node), true, message);
509
512
  }
513
+ export function isModuleExportName(node, message = `expected ModuleExportName, received ${ts.SyntaxKind[node.kind]}`) {
514
+ assert.equal(ts.isModuleExportName(node), true, message);
515
+ }
510
516
  export function isModuleName(node, message = `expected ModuleName, received ${ts.SyntaxKind[node.kind]}`) {
511
517
  assert.equal(ts.isModuleName(node), true, message);
512
518
  }
@@ -917,6 +923,7 @@ export default {
917
923
  isJsxAttribute,
918
924
  isJsxAttributeLike,
919
925
  isJsxAttributes,
926
+ isJsxCallLike,
920
927
  isJsxChild,
921
928
  isJsxClosingElement,
922
929
  isJsxClosingFragment,
@@ -947,6 +954,7 @@ export default {
947
954
  isModuleBlock,
948
955
  isModuleBody,
949
956
  isModuleDeclaration,
957
+ isModuleExportName,
950
958
  isModuleName,
951
959
  isModuleReference,
952
960
  isNamedExportBindings,
package/lib/main.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { isExpression, isIdentifier } from '../generated/assertions';
2
- import ts, { FalseLiteral, Identifier, Node, TrueLiteral, TypeNode } from 'typescript';
2
+ import type { FalseLiteral, Identifier, Node, TrueLiteral, TypeNode } from 'typescript';
3
+ import ts from 'typescript';
3
4
  export declare function isBooleanLiteral(node: Node, type: boolean, message?: string | Error): asserts node is typeof type extends true ? TrueLiteral : FalseLiteral;
4
5
  export declare function isTokenWithExpectedKind(maybe: Node, expected_kind: ts.SyntaxKind, message?: string | Error): asserts maybe is TypeNode & {
5
6
  kind: typeof expected_kind;
@@ -154,6 +155,7 @@ declare const _default: {
154
155
  isJsxAttribute: typeof import("../generated/assertions").isJsxAttribute;
155
156
  isJsxAttributeLike: typeof import("../generated/assertions").isJsxAttributeLike;
156
157
  isJsxAttributes: typeof import("../generated/assertions").isJsxAttributes;
158
+ isJsxCallLike: typeof import("../generated/assertions").isJsxCallLike;
157
159
  isJsxChild: typeof import("../generated/assertions").isJsxChild;
158
160
  isJsxClosingElement: typeof import("../generated/assertions").isJsxClosingElement;
159
161
  isJsxClosingFragment: typeof import("../generated/assertions").isJsxClosingFragment;
@@ -184,6 +186,7 @@ declare const _default: {
184
186
  isModuleBlock: typeof import("../generated/assertions").isModuleBlock;
185
187
  isModuleBody: typeof import("../generated/assertions").isModuleBody;
186
188
  isModuleDeclaration: typeof import("../generated/assertions").isModuleDeclaration;
189
+ isModuleExportName: typeof import("../generated/assertions").isModuleExportName;
187
190
  isModuleName: typeof import("../generated/assertions").isModuleName;
188
191
  isModuleReference: typeof import("../generated/assertions").isModuleReference;
189
192
  isNamedExportBindings: typeof import("../generated/assertions").isNamedExportBindings;
package/package.json CHANGED
@@ -16,17 +16,17 @@
16
16
  },
17
17
  "types": "./lib/main.d.ts",
18
18
  "devDependencies": {
19
- "@signpostmarv/eslint-config": "^0.2.0",
19
+ "@signpostmarv/eslint-config": "^0.4.0",
20
20
  "@types/eslint": "^9.6.1",
21
- "@types/node": "^20.12.7",
21
+ "@types/node": "^24.3.1",
22
22
  "c8": "^10.1.2",
23
- "eslint": "^9.9.1",
23
+ "eslint": "^9.34.0",
24
24
  "prettier": "^3.2.5",
25
25
  "ts-node": "^10.9.2",
26
- "typescript-eslint": "^8.2.0"
26
+ "typescript-eslint": "^8.42.0"
27
27
  },
28
28
  "dependencies": {
29
- "typescript": "~5.5.2"
29
+ "typescript": "~5.9.2"
30
30
  },
31
- "version": "0.3.1"
31
+ "version": "0.4.0"
32
32
  }