Test filesSource code › sample.ts

Sample TypeScript file (sample)

A TypeScript module using generics, a discriminated union, enums, decorators and JSX-free type syntax.

↓ Download sample.ts
Filenamesample.ts
FormatTypeScript
Size774 bytes (774 bytes)
MIME typetext/plain; charset=utf-8
SHA-256389cc0a1a1881fa69c8ae72735d23e0fbf782174c35110f59e85bd675e7bf8f1
What this file catchesHighlighters and parsers that treat .ts as plain JavaScript. The type annotations, generic angle brackets and "satisfies" operator are the constructs that break a JS-only tokeniser, usually by mistaking < and > for comparison.

Download & verify

curl -fsSL -o "sample.ts" "https://files.hexaqa.com/code/sample.ts"
curl -fsSL "https://files.hexaqa.com/code/sample.ts" | sha256sum # expect: 389cc0a1a1881fa69c8ae72735d23e0fbf782174c35110f59e85bd675e7bf8f1

More source code test files

mixed-indentation.pysample.pyschema.sql

← All Source code files