Socket
Socket
Sign inDemoInstall

@jlengstorf/get-share-image

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jlengstorf/get-share-image - npm Package Compare versions

Comparing version 0.2.1 to 0.3.0

18

index.js
"use strict";
exports.__esModule = true;
/**
* Encodes characters for Cloudinary URL
* Encodes some not allowed in Cloudinary parameter values twice:
* hash, comma, slash, question mark, backslash
* https://support.cloudinary.com/hc/en-us/articles/202521512-How-to-add-a-slash-character-or-any-other-special-characters-in-text-overlays-
*/
function cleanText(text) {
return encodeURIComponent(text).replace(/%(23|2C|2F|3F|5C)/g, "%25$1");
}
;
/**
* Generates a social sharing image with custom text using Cloudinary’s APIs.

@@ -26,6 +36,6 @@ *

"y_" + titleBottomOffset,
"l_text:" + titleFont + "_" + titleFontSize + titleExtraConfig + ":" + encodeURIComponent(title),
"l_text:" + titleFont + "_" + titleFontSize + titleExtraConfig + ":" + cleanText(title),
].join(',');
// configure the tagline text
var taglineConfig = [
var taglineConfig = tagline ? [
"w_" + textAreaWidth,

@@ -37,4 +47,4 @@ 'c_fit',

"y_" + taglineTopOffset,
"l_text:" + taglineFont + "_" + taglineFontSize + taglineExtraConfig + ":" + encodeURIComponent(tagline),
].join(',');
"l_text:" + taglineFont + "_" + taglineFontSize + taglineExtraConfig + ":" + cleanText(tagline),
].join(',') : undefined;
// combine all the pieces required to generate a Cloudinary URL

@@ -41,0 +51,0 @@ var urlParts = [

{
"name": "@jlengstorf/get-share-image",
"version": "0.2.1",
"version": "0.3.0",
"main": "index.js",

@@ -5,0 +5,0 @@ "author": "Jason Lengstorf <jason@lengstorf.com> (https://lengstorf.com)",

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