qri-io / starlib

qri's standard library for starlark
MIT License
114 stars 29 forks source link

feat: add Is() as isSelector() #120

Closed chriswhong closed 2 years ago

chriswhong commented 2 years ago

Using the html package, I needed a way to get the type of an element in a selection. goquery has an Is() method which returns a bool if the selection includes a selector passed in as a string.

This PR adds isSelector() as a method on structure, because is() seems to be reserved (or at least when I tried using is() I got "not an identifier" errors, which cleared up when I used any other name).