+23
-0
@@ -0,1 +1,24 @@ | ||
| ## <small>1.0.2 (2020-08-24)</small> | ||
| * Add minimal documentation ([bf6cc25](https://github.com/kikobeats/parse-uri/commit/bf6cc25)) | ||
| * Release 1.0.1 ([9af3814](https://github.com/kikobeats/parse-uri/commit/9af3814)) | ||
| * Update README.md ([2c9827a](https://github.com/kikobeats/parse-uri/commit/2c9827a)) | ||
| * build: add files meta ([70c7cb6](https://github.com/kikobeats/parse-uri/commit/70c7cb6)) | ||
| * build: exit early if input is falsy ([2a3b48e](https://github.com/kikobeats/parse-uri/commit/2a3b48e)) | ||
| * build: remove unnecessary files ([7c56428](https://github.com/kikobeats/parse-uri/commit/7c56428)) | ||
| * docs(readme): add Greenkeeper badge ([89d54ac](https://github.com/kikobeats/parse-uri/commit/89d54ac)) | ||
| ## <small>1.0.1 (2020-08-24)</small> | ||
| * build: add files meta ([70c7cb6](https://github.com/kikobeats/parse-uri/commit/70c7cb6)) | ||
| * build: exit early if input is falsy ([2a3b48e](https://github.com/kikobeats/parse-uri/commit/2a3b48e)) | ||
| * build: remove unnecessary files ([7c56428](https://github.com/kikobeats/parse-uri/commit/7c56428)) | ||
| * Add minimal documentation ([bf6cc25](https://github.com/kikobeats/parse-uri/commit/bf6cc25)) | ||
| * Update README.md ([2c9827a](https://github.com/kikobeats/parse-uri/commit/2c9827a)) | ||
| * docs(readme): add Greenkeeper badge ([89d54ac](https://github.com/kikobeats/parse-uri/commit/89d54ac)) | ||
| <a name="1.0.0"></a> | ||
@@ -2,0 +25,0 @@ # 1.0.0 (2016-02-04) |
+21
-2
| 'use strict' | ||
| module.exports = function parseURI (str, opts) { | ||
| function parseURI (str, opts) { | ||
| if (!str) return undefined | ||
| opts = opts || {} | ||
| var o = { | ||
| key: ['source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'], | ||
| key: [ | ||
| 'source', | ||
| 'protocol', | ||
| 'authority', | ||
| 'userInfo', | ||
| 'user', | ||
| 'password', | ||
| 'host', | ||
| 'port', | ||
| 'relative', | ||
| 'path', | ||
| 'directory', | ||
| 'file', | ||
| 'query', | ||
| 'anchor' | ||
| ], | ||
| q: { | ||
@@ -31,1 +48,3 @@ name: 'queryKey', | ||
| } | ||
| module.exports = parseURI |
+6
-13
@@ -5,7 +5,7 @@ { | ||
| "homepage": "https://github.com/Kikobeats/parse-uri", | ||
| "version": "1.0.0", | ||
| "version": "1.0.2", | ||
| "main": "./index.js", | ||
| "author": { | ||
| "email": "josefrancisco.verdu@gmail.com", | ||
| "name": "Kiko Beats", | ||
| "email": "josefrancisco.verdu@gmail.com", | ||
| "url": "https://github.com/Kikobeats" | ||
@@ -26,15 +26,5 @@ }, | ||
| "devDependencies": { | ||
| "browserify": "latest", | ||
| "coffee-script": "latest", | ||
| "coffeeify": "latest", | ||
| "git-dirty": "latest", | ||
| "gulp": "latest", | ||
| "gulp-header": "latest", | ||
| "gulp-uglify": "latest", | ||
| "gulp-util": "latest", | ||
| "mocha": "latest", | ||
| "should": "latest", | ||
| "standard": "latest", | ||
| "vinyl-buffer": "latest", | ||
| "vinyl-source-stream": "latest" | ||
| "standard": "latest" | ||
| }, | ||
@@ -44,2 +34,5 @@ "engines": { | ||
| }, | ||
| "files": [ | ||
| "index.js" | ||
| ], | ||
| "scripts": { | ||
@@ -46,0 +39,0 @@ "clean": "rm -rf node_modules", |
+19
-0
@@ -38,4 +38,23 @@ # parse-uri | ||
| ## API | ||
| ### parseURI(str, [options]) | ||
| #### options | ||
| ##### strictMode | ||
| Type: `boolean` | ||
| Default: `false` | ||
| Determinate if use `loose` or `strict` mode. | ||
| > Loose mode deviates slightly from the official generic URI spec ([RFC 3986](http://tools.ietf.org/html/rfc3986)) | ||
| ### Related | ||
| * [is-uri](https://github.com/Kikobeats/is-uri#is-uri) – Determinate if a string is a valid URI. | ||
| ## License | ||
| MIT © [Kiko Beats](http://kikobeats.com) |
Sorry, the diff of this file is not supported yet
| # http://editorconfig.org | ||
| root = true | ||
| [*] | ||
| indent_style = space | ||
| indent_size = 2 | ||
| end_of_line = lf | ||
| charset = utf-8 | ||
| trim_trailing_whitespace = true | ||
| insert_final_newline = true | ||
| max_line_length = 80 | ||
| indent_brace_style = 1TBS | ||
| spaces_around_operators = true | ||
| quote_type = auto | ||
| [package.json] | ||
| indent_style = space | ||
| indent_size = 2 | ||
| [*.md] | ||
| trim_trailing_whitespace = false |
| * text=auto |
Sorry, the diff of this file is not supported yet
| language: node_js | ||
| node_js: | ||
| - "stable" | ||
| - "5" | ||
| - "4" |
-33
| { | ||
| "name": "parse-uri", | ||
| "description": "Lightweight module for parse an URI.", | ||
| "homepage": "https://github.com/Kikobeats/parse-uri", | ||
| "version": "1.0.0", | ||
| "main": "./dist/parse-uri.js", | ||
| "authors": [ | ||
| { | ||
| "email": "josefrancisco.verdu@gmail.com", | ||
| "name": "Kiko Beats", | ||
| "url": "https://github.com/Kikobeats" | ||
| } | ||
| ], | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/kikobeats/parse-uri.git" | ||
| }, | ||
| "bugs": { | ||
| "url": "https://github.com/Kikobeats/parse-uri/issues" | ||
| }, | ||
| "keywords": [ | ||
| "URI", | ||
| "parse" | ||
| ], | ||
| "ignore": [ | ||
| "**/.*", | ||
| "bower_components", | ||
| "node_modules", | ||
| "test", | ||
| "tests" | ||
| ], | ||
| "license": "MIT" | ||
| } |
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <title>parse-uri</title> | ||
| </head> | ||
| <body> | ||
| <script src="parse-uri.js" type="text/javascript" charset="utf-8"></script> | ||
| </body> | ||
| </html> |
| /** | ||
| * parse-uri - Lightweight module for parse an URI. | ||
| * @version v1.0.0 | ||
| * @link https://github.com/Kikobeats/parse-uri | ||
| * @license MIT | ||
| */require=function r(e,t,o){function n(i,s){if(!t[i]){if(!e[i]){var a="function"==typeof require&&require;if(!s&&a)return a(i,!0);if(u)return u(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var f=t[i]={exports:{}};e[i][0].call(f.exports,function(r){var t=e[i][1][r];return n(t?t:r)},f,f.exports,r,e,t,o)}return t[i].exports}for(var u="function"==typeof require&&require,i=0;i<o.length;i++)n(o[i]);return n}({"parse-uri":[function(r,e,t){"use strict";e.exports=function(r,e){e=e||{};for(var t={key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},o=t.parser[e.strictMode?"strict":"loose"].exec(r),n={},u=14;u--;)n[t.key[u]]=o[u]||"";return n[t.q.name]={},n[t.key[12]].replace(t.q.parser,function(r,e,o){e&&(n[t.q.name][e]=o)}),n}},{}]},{},[]); |
| 'use strict' | ||
| # -- Dependencies -------------------------------------------------------------- | ||
| gulp = require 'gulp' | ||
| coffeeify = require 'coffeeify' | ||
| gutil = require 'gulp-util' | ||
| browserify = require 'browserify' | ||
| header = require 'gulp-header' | ||
| uglify = require 'gulp-uglify' | ||
| buffer = require 'vinyl-buffer' | ||
| pkg = require './package.json' | ||
| source = require 'vinyl-source-stream' | ||
| # -- Files --------------------------------------------------------------------- | ||
| src = | ||
| main: './index.js' | ||
| module = | ||
| filename : "#{pkg.name}.js" | ||
| shortcut : "#{pkg.name}" | ||
| dist : 'dist' | ||
| banner = [ | ||
| "/**" | ||
| " * <%= pkg.name %> - <%= pkg.description %>" | ||
| " * @version v<%= pkg.version %>" | ||
| " * @link <%= pkg.homepage %>" | ||
| " * @license <%= pkg.license %>" | ||
| " */"].join("\n") | ||
| # -- Tasks --------------------------------------------------------------------- | ||
| gulp.task 'browserify', -> | ||
| browserify extensions: ['.coffee', '.js'] | ||
| .transform coffeeify, global: true | ||
| .require(src.main, { expose: module.shortcut}) | ||
| .ignore('coffee-script') | ||
| .bundle().on('error', gutil.log) | ||
| .pipe source module.filename | ||
| .pipe buffer() | ||
| .pipe uglify() | ||
| .pipe header banner, pkg: pkg | ||
| .pipe gulp.dest module.dist | ||
| gulp.task 'default', -> | ||
| gulp.start 'browserify' | ||
| return |
| /* global describe, it */ | ||
| 'use strict' | ||
| var URI = require('..') | ||
| var should = require('should') | ||
| var URLS = [ | ||
| 'https://github.com/garycourt/uri-js', | ||
| 'magnet:?xt=urn:sha1:PDAQRAOQQRYS76MRZJ33LK4MMVZBDSCL', | ||
| 'https://🐀.ws/🐀🐀' | ||
| ] | ||
| describe('parse uri', function () { | ||
| it('works fine', function () { | ||
| URLS.forEach(function (url) { | ||
| URI(url).protocol.should.be.ok() | ||
| }) | ||
| }) | ||
| }) |
Sorry, the diff of this file is not supported yet
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
3
-76.92%0
-100%60
46.34%0
-100%6275
-38.29%5
-68.75%41
-47.44%