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

@salesforcedevs/sfdocs-no-relative-link

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@salesforcedevs/sfdocs-no-relative-link - npm Package Compare versions

Comparing version 0.0.1-alpha to 0.0.1-alphav2

5

dist/index.js

@@ -13,3 +13,2 @@ "use strict";

const vfile_message_1 = __importDefault(require("vfile-message"));
const path_1 = __importDefault(require("path"));
/**

@@ -32,5 +31,5 @@ * To find whether a given link is of internal markdown file.

function check(node) {
const denyInternalLinkInFile = path_1.default.basename(path_1.default.dirname(file.path)) === folder;
const denyInternalLinkInFile = file.path.includes(folder);
if (isInternalPath(node.url) && denyInternalLinkInFile) {
const errorMessage = new vfile_message_1.default(`Internal link is not allowed in ${folder} files: ${node.url}`, node, "relative-link-not-allowed");
const errorMessage = new vfile_message_1.default(`Using relative links is not allowed in ${folder} files. Please use absolute links instead of ${node.url}.`, node, "relative-link-not-allowed");
errorMessage.fatal = true;

@@ -37,0 +36,0 @@ file.messages.push(errorMessage);

2

package.json
{
"name": "@salesforcedevs/sfdocs-no-relative-link",
"version": "0.0.1-alpha",
"version": "0.0.1-alphav2",
"description": "Validate the relative links in any folder and throw error/warning after check",

@@ -5,0 +5,0 @@ "author": "SFDocs Team",

@@ -65,3 +65,3 @@ import dedent from 'dedent';

expect(result.messages[0].fatal).toBeTruthy();
expect(result.messages[0].toString()).toBe('2:1-2:32: Internal link is not allowed in shared files: ./testing.md');
expect(result.messages[0].toString()).toBe('2:1-2:32: Using relative links is not allowed in shared files. Please use absolute links instead of ./testing.md.');
});

@@ -89,3 +89,3 @@

expect(result.messages[0].fatal).toBeTruthy();
expect(result.messages[0].toString()).toBe('2:1-2:40: Internal link is not allowed in shared files: ../guides/testing.md');
expect(result.messages[0].toString()).toBe('2:1-2:40: Using relative links is not allowed in shared files. Please use absolute links instead of ../guides/testing.md.');
});

@@ -92,0 +92,0 @@

@@ -11,3 +11,2 @@ /**

import VMessage, { VFileMessage } from 'vfile-message';
import path from 'path';

@@ -33,6 +32,6 @@ /**

const denyInternalLinkInFile = path.basename(path.dirname(file.path)) === folder;
const denyInternalLinkInFile = file.path.includes(folder);
if (isInternalPath(node.url) && denyInternalLinkInFile) {
const errorMessage: VFileMessage = new VMessage(`Internal link is not allowed in ${folder} files: ${node.url}`, node, "relative-link-not-allowed");
const errorMessage: VFileMessage = new VMessage(`Using relative links is not allowed in ${folder} files. Please use absolute links instead of ${node.url}.`, node, "relative-link-not-allowed");
errorMessage.fatal = true;

@@ -39,0 +38,0 @@ file.messages.push(errorMessage);

Sorry, the diff of this file is not supported yet

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