From bc9474c04bf02c680ea423a101eae4b687ef8d03 Mon Sep 17 00:00:00 2001 From: Daniel Leite de Oliveira Date: Sun, 1 May 2016 10:25:32 -0300 Subject: [PATCH] Add urlEncode and urlDecode functions. --- src/string.utils.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/string.utils.js b/src/string.utils.js index 1d331f0..3d607d8 100644 --- a/src/string.utils.js +++ b/src/string.utils.js @@ -891,3 +891,12 @@ const decDecode = (value) => value.match(/.{1,5}/g).map((data)=>String.fromCharCode(parseInt(data, 10))).join(''); export {decDecode}; + +const urlEncode = (value) => encodeURI(value); + +export {urlEncode}; + +const urlDecode = (value) => decodeURI(value); + +export {urlDecode}; +