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

react-build-sitemap

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-build-sitemap - npm Package Compare versions

Comparing version 0.1.22 to 0.1.23

15

index.js
import babelParser from "@babel/parser";
import fs from "fs";
import PropTypes from "prop-types";
import { warn } from "console";

@@ -18,3 +17,3 @@ const buildSitemap = (fileName, buildPath, url) => {

if (fileType === undefined) {
throw new warn(
throw new Error(
"The passed file is neither Javascript nor Typescript. Skipping."

@@ -32,5 +31,5 @@ );

];
// if component does not exist, throw warning and skip.
// if component does not exist, throw error and skip.
if (fileName === undefined || fileName === null) {
throw new warn("Component does not exist to generate sitemap. Skipping.");
throw new Error("Component does not exist to generate sitemap. Skipping.");
}

@@ -69,3 +68,3 @@ // read through jsx

if (functionObj.length === 0 && classObj.length === 0) {
throw new warn(
throw new Error(
"There is no function declaration in this file: Perhaps it is not a React Component? Skipping."

@@ -153,3 +152,3 @@ );

if (renderJson.length === 0) {
throw new warn(
throw new Error(
"There is no return statement in this file: Have you written any JSX? Skipping."

@@ -172,5 +171,5 @@ );

}
// if does not exist, throw a warning saying it doesn't exist and skip running.
// if does not exist, throw an error saying it doesn't exist and skip running.
if (router === undefined) {
throw new warn(
throw new Error(
"The component you passed has no router to iterate through. Skipping."

@@ -177,0 +176,0 @@ );

{
"name": "react-build-sitemap",
"version": "0.1.22",
"version": "0.1.23",
"description": "simple library that generates a sitemap from your react router",

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

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