diff options
author | Minteck <nekostarfan@gmail.com> | 2021-08-24 14:41:48 +0200 |
---|---|---|
committer | Minteck <nekostarfan@gmail.com> | 2021-08-24 14:41:48 +0200 |
commit | d25e11bee6ca5ca523884da132d18e1400e077b9 (patch) | |
tree | 8af39fde19f7ed640a60fb397c7edd647dff1c4c /node_modules/strict-uri-encode | |
download | kartik-iridium-d25e11bee6ca5ca523884da132d18e1400e077b9.tar.gz kartik-iridium-d25e11bee6ca5ca523884da132d18e1400e077b9.tar.bz2 kartik-iridium-d25e11bee6ca5ca523884da132d18e1400e077b9.zip |
Initial commit
Diffstat (limited to 'node_modules/strict-uri-encode')
-rw-r--r-- | node_modules/strict-uri-encode/index.js | 6 | ||||
-rw-r--r-- | node_modules/strict-uri-encode/license | 21 | ||||
-rw-r--r-- | node_modules/strict-uri-encode/package.json | 30 | ||||
-rw-r--r-- | node_modules/strict-uri-encode/readme.md | 40 |
4 files changed, 97 insertions, 0 deletions
diff --git a/node_modules/strict-uri-encode/index.js b/node_modules/strict-uri-encode/index.js new file mode 100644 index 0000000..414de96 --- /dev/null +++ b/node_modules/strict-uri-encode/index.js @@ -0,0 +1,6 @@ +'use strict'; +module.exports = function (str) { + return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { + return '%' + c.charCodeAt(0).toString(16).toUpperCase(); + }); +}; diff --git a/node_modules/strict-uri-encode/license b/node_modules/strict-uri-encode/license new file mode 100644 index 0000000..e0e9158 --- /dev/null +++ b/node_modules/strict-uri-encode/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Kevin Mårtensson <kevinmartensson@gmail.com> (github.com/kevva) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/strict-uri-encode/package.json b/node_modules/strict-uri-encode/package.json new file mode 100644 index 0000000..0028e1b --- /dev/null +++ b/node_modules/strict-uri-encode/package.json @@ -0,0 +1,30 @@ +{ + "name": "strict-uri-encode", + "version": "1.1.0", + "description": "A stricter URI encode adhering to RFC 3986", + "license": "MIT", + "repository": "kevva/strict-uri-encode", + "author": { + "name": "Kevin Mårtensson", + "email": "kevinmartensson@gmail.com", + "url": "github.com/kevva" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "node test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "component", + "encode", + "RFC3986", + "uri" + ], + "devDependencies": { + "ava": "^0.0.4" + } +} diff --git a/node_modules/strict-uri-encode/readme.md b/node_modules/strict-uri-encode/readme.md new file mode 100644 index 0000000..2763272 --- /dev/null +++ b/node_modules/strict-uri-encode/readme.md @@ -0,0 +1,40 @@ +# strict-uri-encode [![Build Status](https://travis-ci.org/kevva/strict-uri-encode.svg?branch=master)](https://travis-ci.org/kevva/strict-uri-encode) + +> A stricter URI encode adhering to [RFC 3986](http://tools.ietf.org/html/rfc3986) + + +## Install + +``` +$ npm install --save strict-uri-encode +``` + + +## Usage + +```js +var strictUriEncode = require('strict-uri-encode'); + +strictUriEncode('unicorn!foobar') +//=> 'unicorn%21foobar' + +strictUriEncode('unicorn*foobar') +//=> 'unicorn%2Afoobar' +``` + + +## API + +### strictUriEncode(string) + +#### string + +*Required* +Type: `string`, `number` + +String to URI encode. + + +## License + +MIT © [Kevin Mårtensson](http://github.com/kevva) |