# UtilsAPI.isShape
Type guard that returns true when the given node is a Shape.

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

## UtilsAPI.isShape method

Type guard that returns `true` when the given node is a [Shape](/en/creator-api/nodes/shape) (`RECTANGLE`, `ELLIPSE`, `POLYGON`, `STAR`, `PATH`, or `GROUP`).

**Signature:**

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

## 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 Shape`

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

## Example

```ts
for (const node of creator.selection.nodes) {
  if (creator.utils.isShape(node)) {
    // `node` is narrowed to Shape here
    console.log(node.type);
  }
}
```
