@salesforcedevs/sfdocs-image-transformer
Advanced tools
Comparing version
@@ -8,2 +8,6 @@ import { VFile } from 'vfile'; | ||
}; | ||
/** Function to check if the provided imagePath is a local path or not | ||
* If the URL start with https:// or www. or /, then this function returns | ||
* false (meaning, these path are treated as external URL's) | ||
*/ | ||
export declare function isInternalPath(imagePath: string): boolean; | ||
@@ -10,0 +14,0 @@ /** |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.updateImagePath = exports.isInternalPath = void 0; | ||
// Function to check if the provided imagePath is a local path or not | ||
/** Function to check if the provided imagePath is a local path or not | ||
* If the URL start with https:// or www. or /, then this function returns | ||
* false (meaning, these path are treated as external URL's) | ||
*/ | ||
function isInternalPath(imagePath) { | ||
return imagePath && !(imagePath.match(/^(https?:\/\/|www\.).*/)); | ||
return imagePath && !(imagePath.match(/^(https?:\/\/|www\.|\/).*/)); | ||
} | ||
@@ -8,0 +11,0 @@ exports.isInternalPath = isInternalPath; |
{ | ||
"version": "1.0.5-alpha", | ||
"version": "1.0.5-fix-alpha", | ||
"name": "@salesforcedevs/sfdocs-image-transformer", | ||
@@ -4,0 +4,0 @@ "description": "Salesforce Docs markdown plugin for image transormation", |
@@ -11,5 +11,8 @@ import { VFile } from 'vfile'; | ||
// Function to check if the provided imagePath is a local path or not | ||
/** Function to check if the provided imagePath is a local path or not | ||
* If the URL start with https:// or www. or /, then this function returns | ||
* false (meaning, these path are treated as external URL's) | ||
*/ | ||
export function isInternalPath(imagePath: string): boolean { | ||
return imagePath && !(imagePath.match(/^(https?:\/\/|www\.).*/)); | ||
return imagePath && !(imagePath.match(/^(https?:\/\/|www\.|\/).*/)); | ||
} | ||
@@ -16,0 +19,0 @@ |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
539
1.89%51871
-20.27%1
Infinity%