mild-encode-uri

1.0.0 • Public • Published

mild-encode-uri

npm GitHub license Build Status

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

Readme

Keywords

none

Package Sidebar

Install

npm i mild-encode-uri

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • black_glory