Socket
Socket
Sign inDemoInstall

protocolify

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

protocolify - npm Package Compare versions

Comparing version 1.0.3 to 2.0.0

10

index.js
'use strict';
var fileUrl = require('file-url');
var prependHttp = require('prepend-http');
var pathExists = require('path-exists');
const fs = require('fs');
const fileUrl = require('file-url');
const prependHttp = require('prepend-http');
module.exports = function (url) {
if (typeof url !== 'string') {
throw new TypeError('Expected a string, got ' + typeof url);
throw new TypeError(`Expected a string, got ${typeof url}`);
}
return pathExists.sync(url) ? fileUrl(url) : prependHttp(url);
return fs.existsSync(url) ? fileUrl(url) : prependHttp(url);
};
{
"name": "protocolify",
"version": "1.0.3",
"version": "2.0.0",
"description": "Prepend `http://` to humanized URLs like `todomvc.com` and `file://` to file paths",

@@ -13,3 +13,3 @@ "license": "MIT",

"engines": {
"node": ">=0.10.0"
"node": ">=4"
},

@@ -33,4 +33,3 @@ "scripts": {

"dependencies": {
"file-url": "^1.0.0",
"path-exists": "^2.0.0",
"file-url": "^2.0.0",
"prepend-http": "^1.0.4"

@@ -37,0 +36,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc