Hook into RSpec via:
config.include SolanoHelpers, type: :system
Hook into RSpec via:
config.include SolanoHelpers, type: :system
module HashDelegate | |
# Like `delegate :foo, to: :bar` only for hashes instead | |
# of objects. So these are the same: | |
# | |
# def foo | |
# bar[:foo] | |
# end | |
# | |
# hash_delegate :foo, to: :bar |
It's great that JavaScript now has the URLSearchParams
object to help manage query string manipulation. Unfortunately the common conventions for encoding complex data (I think
started by PHP) are not supported.
This provides a utility function to do that encoding. Might later add a similar function to do parsing. This allows you to
keep using the built-in URLSearchParams
object (which is integrated into other APIs such as
URL
), while also not being limited to simple values.
Tests used to verify correct functionality are included. See the tests for usage examples.
/* | |
* My ideal would be something like this: | |
* | |
* form.addEventListener('submit', async function(event) { | |
* const shouldCancel = await someAsyncActivity() | |
* if( shouldCancel ) event.preventDefault() | |
* }) | |
* | |
* Unfortuantly calling `preventDefault` AFTER any async activity will not work | |
* AFAIK. This function provides an abstraction to work around this. Usage |
# A module to execute JS in a safe sandbox. The JS engine is Spidermonkey | |
# (the engine used in Firefox). The sandbox is wasmer. | |
# | |
# This module assume the compiled wasm spidermonkey binary is in the same | |
# directory. Use one of the binaries from Mozilla directly listed here: | |
# | |
# https://github.com/mozilla-spidermonkey/sm-wasi-demo/blob/main/data.json | |
# | |
# The one on wapm is very out-dated and will not work with this module. | |
# |