---
jsApi: true
title: "[F] getPositionBeforeTrivia"

---
```ts
getPositionBeforeTrivia(script, pos): number
```

Adjust the given postion backwards before any trivia.

## Parameters

| Parameter | Type |
| :------ | :------ |
| `script` | [`TypeSpecScriptNode`](../interfaces/TypeSpecScriptNode.md) |
| `pos` | `number` |

## Returns

`number`
