Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@umijs/route-utils

Package Overview
Dependencies
Maintainers
14
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@umijs/route-utils - npm Package Compare versions

Comparing version 1.0.35 to 1.0.36

15

dist/transformRoute/transformRoute.js

@@ -8,5 +8,14 @@ import isEqual from 'fast-deep-equal/es6/index';

}
/* eslint no-useless-escape:0 import/prefer-default-export:0 */
const reg = /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/;
export const isUrl = (path) => reg.test(path);
export const isUrl = (path) => {
if (!path.startsWith('http')) {
return false;
}
try {
const url = new URL(path);
return !!url;
}
catch (error) {
return false;
}
};
export const getKeyByPath = (item) => {

@@ -13,0 +22,0 @@ const { path } = item;

14

es/transformRoute/transformRoute.js

@@ -68,7 +68,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

}
/* eslint no-useless-escape:0 import/prefer-default-export:0 */
export var isUrl = function isUrl(path) {
if (!path.startsWith('http')) {
return false;
}
var reg = /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/;
export var isUrl = function isUrl(path) {
return reg.test(path);
try {
var url = new URL(path);
return !!url;
} catch (error) {
return false;
}
};

@@ -75,0 +81,0 @@ export var getKeyByPath = function getKeyByPath(item) {

@@ -82,9 +82,14 @@ "use strict";

}
/* eslint no-useless-escape:0 import/prefer-default-export:0 */
var isUrl = function isUrl(path) {
if (!path.startsWith('http')) {
return false;
}
var reg = /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/;
var isUrl = function isUrl(path) {
return reg.test(path);
try {
var url = new URL(path);
return !!url;
} catch (error) {
return false;
}
};

@@ -91,0 +96,0 @@

{
"name": "@umijs/route-utils",
"version": "1.0.35",
"version": "1.0.36",
"description": "Quickly process the routing of umi",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

Sorry, the diff of this file is not supported yet

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