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

gatsby-plugin-client-side-redirect

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-plugin-client-side-redirect - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

.github/workflows/CI.yml

2

clientSideRedirect.js

@@ -13,3 +13,3 @@ module.exports = function getMetaRedirect(toPath) {

if(hasTrailingSlash) {
if (hasTrailingSlash && url.length > 1) {
url = url.slice(0, -1);

@@ -16,0 +16,0 @@ }

@@ -12,7 +12,15 @@ const path = require('path');

const FILE_PATH = path.join(
folder,
fromPath.replace(pathPrefix, ''),
'index.html'
);
let FILE_PATH
if (fromPath.endsWith(".html")) {
// Allow redirects from file
FILE_PATH = path.join(folder, fromPath.replace(pathPrefix, ''));
} else {
// If it's not a .html file, then use the xyz/index.html pattern
// to support an exact link
FILE_PATH = path.join(
folder,
fromPath.replace(pathPrefix, ''),
'index.html'
);
}

@@ -19,0 +27,0 @@ const fileExists = await exists(FILE_PATH);

{
"name": "gatsby-plugin-client-side-redirect",
"version": "1.0.0",
"version": "1.1.0",
"repository": "git@github.com:dhakerShiv/gatsby-plugin-client-side-redirect.git",

@@ -5,0 +5,0 @@ "author": "Shivnarayan Dhaker <shivnarayandhakar@gmail.com>",

@@ -46,3 +46,3 @@ # gatsby-plugin-client-side-redirect

You can use it using an node api provided by gatsby, for an example
You can use it using the node api provided by gatsby, for an example
Let's take `createPages`

@@ -52,3 +52,3 @@

```
```js
exports.createPages = ({ graphql, actions }) => {

@@ -63,3 +63,3 @@ const {createRedirect} = actions //actions is collection of many actions - https://www.gatsbyjs.org/docs/actions

```
```js
exports.createPages = async ({ graphql, actions }) => {

@@ -66,0 +66,0 @@ const {createRedirect} = actions

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