<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@csstools/media-query-list-parser](./media-query-list-parser.md) &gt; [parse](./media-query-list-parser.parse.md)

## parse() function

**Signature:**

```typescript
export declare function parse(source: string, options?: {
    preserveInvalidMediaQueries?: boolean;
    onParseError?: (error: ParseError) => void;
}): Array<MediaQuery>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

source


</td><td>

string


</td><td>


</td></tr>
<tr><td>

options


</td><td>

{ preserveInvalidMediaQueries?: boolean; onParseError?: (error: ParseError) =&gt; void; }


</td><td>

_(Optional)_


</td></tr>
</tbody></table>

**Returns:**

Array&lt;[MediaQuery](./media-query-list-parser.mediaquery.md)<!-- -->&gt;

