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

single-spa

Package Overview
Dependencies
Maintainers
1
Versions
139
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

single-spa - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

26

lib/single-spa.js

@@ -20,2 +20,3 @@ 'use strict';

exports.triggerAppChange = triggerAppChange;
exports.navigateToUrl = navigateToUrl;

@@ -186,2 +187,27 @@ var _singleSpaChildAppError = require('./single-spa-child-app-error.js');

function navigateToUrl(obj) {
var url = void 0;
if (typeof obj === 'string') {
url = obj;
} else if (this && this.href) {
url = this.href;
} else if (obj && obj.currentTarget && obj.currentTarget.href && obj.preventDefault) {
url = obj.currentTarget.href;
obj.preventDefault();
} else {
throw new Error('singleSpaNavigate must be either called with a string url, with an <a> tag as its context, or with an event whose currentTarget is an <a> tag');
}
var anchorElement = document.createElement('a');
anchorElement.setAttribute('href', url);
if (window.location.origin + window.location.pathname === anchorElement.origin + anchorElement.pathname) {
window.location.hash = anchorElement.hash;
} else {
window.history.pushState(null, null, url);
}
}
window.singleSpaNavigate = navigateToUrl;
function urlReroute() {

@@ -188,0 +214,0 @@ performAppChanges([], arguments);

4

package.json
{
"name": "single-spa",
"version": "2.0.1",
"version": "2.0.2",
"description": "Multiple applications, one page",

@@ -12,3 +12,3 @@ "main": "lib/single-spa.js",

"test": "jasmine",
"build:canopy": "npm run build && rm -rf ../../workplace/customer-spa/jspm_packages/npm/single-spa@2.0.0 && rsync -av . ../../workplace/customer-spa/jspm_packages/npm/single-spa@2.0.0 --exclude node_modules --exclude .git --exclude --spec --exclude examples"
"build:canopy": "npm run build && rm -rf ../../workplace/customer-spa/jspm_packages/npm/single-spa@2.0.2 && rsync -av . ../../workplace/customer-spa/jspm_packages/npm/single-spa@2.0.2 --exclude node_modules --exclude .git --exclude --spec --exclude examples"
},

@@ -15,0 +15,0 @@ "repository": "https://github.com/CanopyTax/single-spa",

@@ -150,2 +150,27 @@ import { handleChildAppError } from './single-spa-child-app-error.js';

export function navigateToUrl(obj) {
let url;
if (typeof obj === 'string') {
url = obj ;
} else if (this && this.href) {
url = this.href;
} else if (obj && obj.currentTarget && obj.currentTarget.href && obj.preventDefault) {
url = obj.currentTarget.href;
obj.preventDefault();
} else {
throw new Error(`singleSpaNavigate must be either called with a string url, with an <a> tag as its context, or with an event whose currentTarget is an <a> tag`);
}
const anchorElement= document.createElement('a');
anchorElement.setAttribute('href', url);
if (window.location.origin + window.location.pathname === anchorElement.origin + anchorElement.pathname) {
window.location.hash = anchorElement.hash;
} else {
window.history.pushState(null, null, url);
}
}
window.singleSpaNavigate = navigateToUrl;
function urlReroute() {

@@ -152,0 +177,0 @@ performAppChanges([], arguments)

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