mild-encode-uri
v1.0.0
Published
Let the decodable %XX be no longer encode, cut off the infinite encoding of encodeURI.
Downloads
2
Readme
mild-encode-uri
Let the decodable %XX be no longer encode, cut off the infinite encoding of encodeURI.
Usage
const decodableStirng = '%E7%82%92%E9%B8%A1%E6%88%98%E5%A3%AB'
const undecodableString = '%AA'
mildEncodeURI(decodableStirng) === decodableStirng // true
mildEncodeURI(undecodableString) === encodeURI(undecodableString) // true
mildEncodeURIComponent(decodableStirng) === decodableStirng // true
mildEncodeURIComponent(undecodableString) === encodeURIComponent(undecodableString) // true
Install
NPM
npm install mild-encode-uri
Yarn
yarn add mild-encode-uri
Import
ECMAScript Next Style
import { encodeURI as mildEncodeURI, encodeURIComponent as mildEncodeURIComponent } from 'mild-encode-uri'
CommonJS Style
const { encodeURI: mildEncodeURI, encodeURIComponent: mildEncodeURIComponent } = require('mild-encode-uri')
Test
NPM
npm test
Yarn
yarn test