New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sheet-router

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sheet-router - npm Package Compare versions

Comparing version 4.2.1 to 4.2.2

16

_pathname.js
/* eslint-disable no-useless-escape */
const electron = '^(file:\/\/|\/)(.*\.html?\/?)?'
const protocol = '^(http(s)?(:\/\/))?(www\.)?'
const domain = '[a-zA-Z0-9-_\.]+(:[0-9]{1,5})?(\/{1})?'
const qs = '[\?].*$'
var electron = '^(file:\/\/|\/)(.*\.html?\/?)?'
var protocol = '^(http(s)?(:\/\/))?(www\.)?'
var domain = '[a-zA-Z0-9-_\.]+(:[0-9]{1,5})?(\/{1})?'
var qs = '[\?].*$'
/* eslint-enable no-useless-escape */
const stripElectron = new RegExp(electron)
const prefix = new RegExp(protocol + domain)
const normalize = new RegExp('#')
const suffix = new RegExp(qs)
var stripElectron = new RegExp(electron)
var prefix = new RegExp(protocol + domain)
var normalize = new RegExp('#')
var suffix = new RegExp(qs)

@@ -13,0 +13,0 @@ module.exports = pathname

@@ -1,6 +0,6 @@

const document = require('global/document')
const assert = require('assert')
const xtend = require('xtend')
var document = require('global/document')
var assert = require('assert')
var xtend = require('xtend')
const qs = require('./qs')
var qs = require('./qs')

@@ -20,3 +20,3 @@ module.exports = createLocation

if (!state) {
const newLocation = {
return {
pathname: document.location.pathname,

@@ -27,12 +27,9 @@ search: (document.location.search) ? qs(document.location.search) : {},

}
return newLocation
} else {
assert.equal(typeof state, 'object', 'sheet-router/create-location: state should be an object')
if (typeof patch === 'string') {
const newLocation = parseUrl(patch)
return newLocation
return parseUrl(patch)
} else {
assert.equal(typeof patch, 'object', 'sheet-router/create-location: patch should be an object')
const newLocation = xtend(state, patch)
return newLocation
return xtend(state, patch)
}

@@ -44,3 +41,3 @@ }

function parseUrl (url) {
const a = document.createElement('a')
var a = document.createElement('a')
a.href = url

@@ -47,0 +44,0 @@

@@ -1,3 +0,3 @@

const window = require('global/window')
const assert = require('assert')
var window = require('global/window')
var assert = require('assert')

@@ -4,0 +4,0 @@ module.exports = hash

@@ -1,4 +0,4 @@

const document = require('global/document')
const window = require('global/window')
const assert = require('assert')
var document = require('global/document')
var window = require('global/window')
var assert = require('assert')

@@ -5,0 +5,0 @@ module.exports = history

@@ -1,9 +0,9 @@

const window = require('global/window')
const assert = require('assert')
var window = require('global/window')
var assert = require('assert')
const qs = require('./qs')
var qs = require('./qs')
module.exports = href
const noRoutingAttrName = 'data-no-routing'
var noRoutingAttrName = 'data-no-routing'

@@ -20,3 +20,3 @@ // handle a click if is anchor tag with an href

const node = (function traverse (node) {
var node = (function traverse (node) {
if (!node || node === root) return

@@ -31,3 +31,3 @@ if (node.localName !== 'a') return traverse(node.parentNode)

const isRoutingDisabled = node.hasAttribute(noRoutingAttrName)
var isRoutingDisabled = node.hasAttribute(noRoutingAttrName)
if (isRoutingDisabled) return

@@ -34,0 +34,0 @@

@@ -1,6 +0,6 @@

const pathname = require('./_pathname')
const wayfarer = require('wayfarer')
const assert = require('assert')
var pathname = require('./_pathname')
var wayfarer = require('wayfarer')
var assert = require('assert')
const isElectron = require('is-electron')()
var isElectron = require('is-electron')()

@@ -20,6 +20,6 @@ module.exports = sheetRouter

const dft = opts.default || '/404'
var dft = opts.default || '/404'
assert.equal(typeof dft, 'string', 'sheet-router: dft must be a string')
const router = wayfarer(dft)
var router = wayfarer(dft)
var prevCallback = null

@@ -44,4 +44,4 @@ var prevRoute = null

const cb = (typeof tree[1] === 'function') ? tree[1] : null
const children = (Array.isArray(tree[1]))
var cb = (typeof tree[1] === 'function') ? tree[1] : null
var children = (Array.isArray(tree[1]))
? tree[1]

@@ -57,3 +57,3 @@ : Array.isArray(tree[2]) ? tree[2] : null

if (cb) {
const innerRoute = route
var innerRoute = route
? fullRoute.concat(route).join('/')

@@ -63,3 +63,3 @@ : fullRoute.length ? fullRoute.join('/') : route

// if opts.thunk is false or only enabled for match, don't thunk
const handler = (opts.thunk === false || opts.thunk === 'match')
var handler = (opts.thunk === false || opts.thunk === 'match')
? cb

@@ -66,0 +66,0 @@ : thunkify(cb)

{
"name": "sheet-router",
"version": "4.2.1",
"version": "4.2.2",
"description": "Fast, modular client router",

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

@@ -1,5 +0,5 @@

const window = require('global/window')
var window = require('global/window')
const decodeURIComponent = window.decodeURIComponent
const reg = new RegExp('([^?=&]+)(=([^&]*))?', 'g')
var decodeURIComponent = window.decodeURIComponent
var reg = new RegExp('([^?=&]+)(=([^&]*))?', 'g')

@@ -10,3 +10,3 @@ module.exports = qs

function qs (uri) {
const obj = {}
var obj = {}
uri.replace(/^.*\?/, '').replace(reg, map)

@@ -13,0 +13,0 @@ return obj

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