• Checks if the specified object implements the HasLayers interface.

    if (hasLayers(myObject)) {
    myObject.forEachLayer((layer) => console.log(layer));
    }

    Parameters

    • obj: unknown

      The object to test.

    Returns obj is HasLayers