# UtilsAPI.isLayer
Type guard that returns true when the given node is a Layer.

{/* Do not edit this file. It is automatically generated by API Documenter. */}

## UtilsAPI.isLayer method

Type guard that returns `true` when the given node is a [Layer](/en/creator-api/nodes/layer) (`SHAPE_LAYER`, `IMAGE_LAYER`, `TEXT_LAYER`, or `SCENE_LAYER`).

**Signature:**

```typescript
isLayer(node: Layer | Shape): node is Layer;
```

## Parameters

<table>
  <thead>
    <tr>
      <th>
        Parameter
      </th>

      <th>
        Type
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        node
      </td>

      <td>
        [Layer](/en/creator-api/nodes/layer) | [Shape](/en/creator-api/nodes/shape)
      </td>

      <td>
        The node to test.
      </td>
    </tr>
  </tbody>
</table>

**Returns:** `node is Layer`

A TypeScript type predicate. When `true`, the compiler narrows `node` to `Layer` in the calling scope.

## Example

```ts
for (const node of creator.selection.nodes) {
  if (creator.utils.isLayer(node)) {
    // `node` is narrowed to Layer here
    console.log(node.startFrame, node.endFrame);
  }
}
```
