Module: Playwright::JavaScript

Defined in:
lib/playwright/javascript.rb,
lib/playwright/javascript/function.rb,
lib/playwright/javascript/expression.rb,
lib/playwright/javascript/value_parser.rb,
lib/playwright/javascript/value_serializer.rb

Defined Under Namespace

Classes: Expression, Function, ValueParser, ValueSerializer

Class Method Summary collapse

Class Method Details

.function?(str) ⇒ Boolean

Detect if str is likely to be a function

Returns:

  • (Boolean)


9
10
11
# File 'lib/playwright/javascript.rb', line 9

module_function def function?(str)
  ['async', 'function'].any? { |key| str.strip.start_with?(key) } || str.include?('=>')
end