๐Ÿ“ฆ malash / opentsdb-escape

OpenTSDB Escape for Javascript

โ˜… 4 stars โ‘‚ 0 forks ๐Ÿ‘ 4 watching โš–๏ธ MIT License
๐Ÿ“ฅ Clone https://github.com/malash/opentsdb-escape.git
HTTPS git clone https://github.com/malash/opentsdb-escape.git
SSH git clone git@github.com:malash/opentsdb-escape.git
CLI gh repo clone malash/opentsdb-escape
Malash Malash add engines to package.json 78b8aa4 10 years ago ๐Ÿ“ History
๐Ÿ“‚ master View all commits โ†’
๐Ÿ“ dist
๐Ÿ“ lib
๐Ÿ“ test
๐Ÿ“„ .eslintrc
๐Ÿ“„ .gitignore
๐Ÿ“„ .travis.yml
๐Ÿ“„ bower.json
๐Ÿ“„ gulpfile.js
๐Ÿ“„ LICENSE
๐Ÿ“„ package.json
๐Ÿ“„ README.md
๐Ÿ“„ webpack.config.js
๐Ÿ“„ README.md

OpenTSDB Escape for Javascript

This project use advanced Javascript encodeURIComponent function as OpenTSDB escape function based on the difference between their valid characters.

encodeURIComponent valid characters: ``a-z, A-Z, 0-9, - _ . ! ~' ( )%%CODEBLOCK0%%a-z, A-Z, 0-9, -, _, ., /%%CODEBLOCK1%%javascript var OpentsdbEscape = require('opentsdb-escape'); var originStr = '!\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_abcdefghijklmnopqrstuvwxyz{|}~'; var escapedStr = OpentsdbEscape.escape(originStr); console.log(escapedStr); // 2122232425262728292a2B2C-.2F01234567893A3B3C3D3E3F40ABCDEFGHIJKLMNOPQRSTUVWXYZ5B5C5D5E5f60abcdefghijklmnopqrstuvwxyz7B7C7D7e console.log(OpentsdbEscape.unescape(escapedStr) === originStr); // true

Bower: `bower install opentsdb-escape`
html