bindings for encodeURIComponent
@@ -49,8 +49,8 @@ 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.
+ /// 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)]
@@ -66,6 +66,15 @@ extern "C" {
#[wasm_bindgen(js_name = encodeURI)]
pub fn encode_uri(decoded: &str) -> JsString;
+ /// The encodeURIComponent() function encodes a Uniform Resource Identifier (URI) component
+ /// by replacing each instance of certain characters by one, two, three, or four escape sequences
+ /// representing the UTF-8 encoding of the character
+ /// (will only be four escape sequences for characters composed of two "surrogate" characters).
+ ///
+ /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent
+ #[wasm_bindgen(js_name = encodeURIComponent)]
+ pub fn encode_uri_component(decoded: &str) -> JsString;
+
/// The `eval()` function evaluates JavaScript code represented as a string.
///
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval
