bindings for decodeURIComponent

This commit is contained in:
Alexander Kryvomaz
2018-07-01 15:53:44 +03:00
parent f850a6fafc
commit 0f07dd9048
2 changed files with 34 additions and 1 deletions

View File

@ -49,6 +49,13 @@ extern "C" {
#[wasm_bindgen(catch, js_name = decodeURI)]
pub fn decode_uri(encoded: &str) -> Result<JsString, JsValue>;
/// The decodeURIComponent() function decodes a Uniform Resource Identifier (URI)
/// component previously created by encodeURIComponent or by a similar routine.
///
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent
#[wasm_bindgen(catch, js_name = decodeURIComponent)]
pub fn decode_uri_component(encoded: &str) -> Result<JsString, JsValue>;
/// The `encodeURI()` function encodes a Uniform Resource Identifier (URI)
/// by replacing each instance of certain characters by one, two, three, or
/// four escape sequences representing the UTF-8 encoding of the character