Socket
Socket
Sign inDemoInstall

@vercel/stega

Package Overview
Dependencies
Maintainers
8
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vercel/stega - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

README.md

28

dist/cjs/encode.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.vercelStegaEncode = void 0;
exports.vercelStegaCombine = exports.vercelStegaEncode = void 0;
const map_1 = require("./map");

@@ -25,1 +25,27 @@ /**

exports.vercelStegaEncode = vercelStegaEncode;
function isDate(string) {
return Boolean(Date.parse(string));
}
function isUrl(string) {
try {
new URL(string);
}
catch {
return false;
}
return true;
}
/**
* Adds an encoded JSON object to a string as hidden characters
* @param string - The string the JSON will be added to
* @param json - The JSON to add to the string
* @param skip - Whether to skip encoding (default: "auto")
*/
function vercelStegaCombine(string, json, skip = 'auto') {
if (skip === true)
return string;
if (skip === 'auto' && (isDate(string) || isUrl(string)))
return string;
return `${string}${vercelStegaEncode(json)}`;
}
exports.vercelStegaCombine = vercelStegaCombine;

@@ -7,1 +7,10 @@ /**

export declare function vercelStegaEncode<T>(json: T): string;
type SkipValue = 'auto' | boolean;
/**
* Adds an encoded JSON object to a string as hidden characters
* @param string - The string the JSON will be added to
* @param json - The JSON to add to the string
* @param skip - Whether to skip encoding (default: "auto")
*/
export declare function vercelStegaCombine<T>(string: string, json: T, skip?: SkipValue): string;
export {};

@@ -21,1 +21,26 @@ import { HEX_DIGIT_MAP } from './map';

}
function isDate(string) {
return Boolean(Date.parse(string));
}
function isUrl(string) {
try {
new URL(string);
}
catch {
return false;
}
return true;
}
/**
* Adds an encoded JSON object to a string as hidden characters
* @param string - The string the JSON will be added to
* @param json - The JSON to add to the string
* @param skip - Whether to skip encoding (default: "auto")
*/
export function vercelStegaCombine(string, json, skip = 'auto') {
if (skip === true)
return string;
if (skip === 'auto' && (isDate(string) || isUrl(string)))
return string;
return `${string}${vercelStegaEncode(json)}`;
}

2

package.json
{
"name": "@vercel/stega",
"version": "0.0.4",
"version": "0.0.5",
"description": "Utilities for steganography",

@@ -5,0 +5,0 @@ "main": "./dist/cjs/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