mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-23 01:31:34 +00:00
add bindings for array.prototype.some() (#341)
following the example set in https://github.com/rustwasm/wasm-bindgen/pull/314
This commit is contained in:
committed by
Alex Crichton
parent
2f465d3d23
commit
9193218648
@ -205,6 +205,13 @@ extern {
|
||||
#[wasm_bindgen(method)]
|
||||
pub fn slice(this: &Array, start: u32, end: u32) -> Array;
|
||||
|
||||
/// The some() method tests whether at least one element in the array passes the test implemented
|
||||
/// by the provided function.
|
||||
/// Note: This method returns false for any condition put on an empty array.
|
||||
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some
|
||||
#[wasm_bindgen(method)]
|
||||
pub fn some(this: &Array, predicate: &mut FnMut(JsValue) -> bool) -> bool;
|
||||
|
||||
/// The sort() method sorts the elements of an array in place and returns
|
||||
/// the array. The sort is not necessarily stable. The default sort
|
||||
/// order is according to string Unicode code points.
|
||||
|
Reference in New Issue
Block a user