---
title: "isTypeshadeSource(): function in Authoring, TypeShade API"
description: "isTypeshadeSource, a function in Authoring. Return whether a TypeScript source string opts into TypeShade with the \"use typeshade\" directive."
url: https://typeshade.dev/api/istypeshadesource/
language: en
---

# `isTypeshadeSource()`

Function in Authoring

Return whether a TypeScript source string opts into TypeShade with the "use typeshade" directive.

`import { isTypeshadeSource } from 'typeshade'`

The signature, the description and the examples come from the compiler's own source at commit af54ddad5.

## Syntax

```ts
function isTypeshadeSource(source: string, fileName = 'check.ts'): boolean
```

## Parameters

**`source` `string`**

**`fileName` optional `unknown`**

## Return value

`boolean`

## Source

[`src/compiler/ts/source-file.ts`, line 797](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/source-file.ts#L797), at commit af54ddad5
