UtilsAPI.isLayer
Returns true if the given value is a Layer.
UtilsAPI.isLayer() method
Returns true if the given value is a Layer.
Signature:
isLayer(node: Layer | Shape): node is Layer;Parameters
Parameter | Type | Description |
|---|---|---|
node | The value to check |
Returns:
node is Layer
true if node is a Layer, otherwise false.
Example
for (const node of creator.selection.nodes) {
if (creator.utils.isLayer(node)) {
// node is narrowed to Layer
console.log(node.startFrame);
}
}Last updated: October 8, 2026 at 10:45 AMEdit this page