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

next-nprogress-bar

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-nprogress-bar - npm Package Compare versions

Comparing version 2.0.3 to 2.1.0

8

dist/appDir.d.ts

@@ -6,4 +6,8 @@ import React from 'react';

export declare function useRouter(): {
push: (href: string, options?: NavigateOptions) => void;
back(): void;
push: (href: string, options?: NavigateOptions, NProgressOptions?: {
showProgressBar?: boolean;
}) => void;
back: (NProgressOptions?: {
showProgressBar?: boolean;
}) => void;
forward(): void;

@@ -10,0 +14,0 @@ refresh(): void;

@@ -95,7 +95,20 @@ 'use strict';

var router = navigation.useRouter();
function push(href, options) {
var pathname = navigation.usePathname();
function push(href, options, NProgressOptions) {
if ((NProgressOptions === null || NProgressOptions === void 0 ? void 0 : NProgressOptions.showProgressBar) === false)
return router.push(href, options);
var currentUrl = new URL(pathname, location.href);
var targetUrl = new URL(href, location.href);
if (isSameURL(targetUrl, currentUrl) || href === pathname)
return router.push(href, options);
NProgress.start();
return router.push(href, options);
}
return __assign(__assign({}, router), { push: push });
function back(NProgressOptions) {
if ((NProgressOptions === null || NProgressOptions === void 0 ? void 0 : NProgressOptions.showProgressBar) === false)
return router.back();
NProgress.start();
return router.back();
}
return __assign(__assign({}, router), { push: push, back: back });
}

@@ -102,0 +115,0 @@

{
"name": "next-nprogress-bar",
"version": "2.0.3",
"version": "2.1.0",
"description": "NextJS progress bar compatible with new app directory",

@@ -5,0 +5,0 @@ "repository": {

@@ -312,3 +312,15 @@ <div align="center">

// With progress bar
router.push('/about');
router.back();
// Without progress bar
router.push(
'/about',
{},
{
showProgressBar: false,
},
);
router.back({ showProgressBar: false });
```

@@ -315,0 +327,0 @@

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