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

@backpackjs/transform-redirects

Package Overview
Dependencies
Maintainers
7
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@backpackjs/transform-redirects - npm Package Compare versions

Comparing version 4.2.0 to 4.2.1-canary.47.2552574952.0

14

dist/index.js

@@ -24,3 +24,3 @@ "use strict";

if (!from || !to) {
throw new Error('Malformed redirect');
throw new Error("Malformed redirect");
}

@@ -30,4 +30,4 @@ const fromUrl = new URL(from, process.env.SITE_URL);

const fromQuery = Array.from(fromUrl.searchParams)
.map(([key, value]) => `${key}=${value.replace(/\s/g, '+')}`)
.join(' ');
.map(([key, value]) => `${key}=${value.replace(/\s/g, "+")}`)
.join(" ");
return `${fromPath} ${fromQuery} ${to} ${status}`;

@@ -46,4 +46,4 @@ };

const backpackRedirects = await fetchBackpackRedirects();
const toProductsRedirect = toResourceRedirect('products');
const toCollectionsRedirect = toResourceRedirect('collections');
const toProductsRedirect = toResourceRedirect("products");
const toCollectionsRedirect = toResourceRedirect("collections");
const redirects = [

@@ -54,7 +54,7 @@ ...backpackRedirects.map(toBackpackRedirect),

];
await fs_extra_1.default.outputFile(path_1.default.resolve(input.context.target, `public/_redirects`), redirects.join('\n'));
await fs_extra_1.default.outputFile(path_1.default.resolve(input.context.target, `public/_redirects`), redirects.join("\n"));
return input;
}
catch (error) {
input._task.title = `❌ error in Redirects Transform: ${error.message}`;
input.task.title = `❌ error in Redirects Transform: ${error.message}`;
return input;

@@ -61,0 +61,0 @@ // throw error;

{
"name": "@backpackjs/transform-redirects",
"version": "4.2.0",
"version": "4.2.1-canary.47.2552574952.0",
"license": "MIT",

@@ -23,3 +23,3 @@ "author": "BackpackJS <dev@packdigial.com> (http://packdigital.com/)",

},
"gitHead": "ff414f68854e024e4344a7ff8b16619afd4ce474"
"gitHead": "4ee331912d8ddeca478c2aeaa12f69aaaa8c5d27"
}

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

import path from 'path';
import fs from 'fs-extra';
import path from "path";
import fs from "fs-extra";
import query from './query';
import client from './client';
import query from "./query";
import client from "./client";

@@ -28,3 +28,3 @@ const fetchBackpackRedirects = async () => {

if (!from || !to) {
throw new Error('Malformed redirect');
throw new Error("Malformed redirect");
}

@@ -35,4 +35,4 @@

const fromQuery = Array.from(fromUrl.searchParams)
.map(([key, value]) => `${key}=${value.replace(/\s/g, '+')}`)
.join(' ');
.map(([key, value]) => `${key}=${value.replace(/\s/g, "+")}`)
.join(" ");

@@ -55,4 +55,4 @@ return `${fromPath} ${fromQuery} ${to} ${status}`;

const toProductsRedirect = toResourceRedirect('products');
const toCollectionsRedirect = toResourceRedirect('collections');
const toProductsRedirect = toResourceRedirect("products");
const toCollectionsRedirect = toResourceRedirect("collections");

@@ -67,3 +67,3 @@ const redirects = [

path.resolve(input.context.target, `public/_redirects`),
redirects.join('\n')
redirects.join("\n")
);

@@ -73,3 +73,3 @@

} catch (error) {
input._task.title = `❌ error in Redirects Transform: ${error.message}`;
input.task.title = `❌ error in Redirects Transform: ${error.message}`;
return input;

@@ -76,0 +76,0 @@ // throw error;

Sorry, the diff of this file is not supported yet

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