You want to mimic [this condition](https://github.com/systemed/iD/blob/56f0bf3d700b1bdcae7cfe7b6a37fd390f95112e/js/id/actions/delete_way.js#L4-6) here.