Skip to content

Conversation

@kateinoigakukun
Copy link
Member

This feature satisfies the scenario shown in #247 in a Ruby way. The form of the shorthand looks much Rubyish and smarter than == JS::True, also it brings minimum complexity.
e.g.

searchParams = JS.global[:URLSearchParams].new(JS.global[:location][:search])
# "URLSearchParams.has" returns Boolean in JS,
# and '?' indicates the returned JS boolean is converted to Ruby boolean
if searchParams.has?('q')
  # ...
end

This idea itself is suggested by @znz. Thanks!

@kateinoigakukun kateinoigakukun force-pushed the katei/js-predicate-method branch from 520ada6 to c1e2afd Compare July 24, 2023 08:02
@kateinoigakukun kateinoigakukun marked this pull request as ready for review July 24, 2023 08:53
@kateinoigakukun kateinoigakukun merged commit 67ae96b into main Jul 24, 2023
@kateinoigakukun kateinoigakukun deleted the katei/js-predicate-method branch July 24, 2023 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant