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

@convertkit/editor-videos

Package Overview
Dependencies
Maintainers
3
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@convertkit/editor-videos - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

47

es/index.js
import React from 'react';
import isUrl from 'is-url';
import { getEventTransfer } from 'slate-react';

@@ -37,46 +38,2 @@

/**
* Expose `isUrl`.
*/
var isUrl_1 = isUrl;
/**
* RegExps.
* A URL must match #1 and then at least one of #2/#3.
* Use two levels of REs to avoid REDOS.
*/
var protocolAndDomainRE = /^(?:\w+:)?\/\/(\S+)$/;
var localhostDomainRE = /^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/;
var nonLocalhostDomainRE = /^[^\s\.]+\.\S{2,}$/;
/**
* Loosely validate a URL `string`.
*
* @param {String} string
* @return {Boolean}
*/
function isUrl(string) {
if (typeof string !== 'string') {
return false;
}
var match = string.match(protocolAndDomainRE);
if (!match) {
return false;
}
var everythingAfterProtocol = match[1];
if (!everythingAfterProtocol) {
return false;
}
if (localhostDomainRE.test(everythingAfterProtocol) || nonLocalhostDomainRE.test(everythingAfterProtocol)) {
return true;
}
return false;
}
var handledTransferType = function handledTransferType(type) {

@@ -116,3 +73,3 @@ return type == "text" || type == "html";

if (!handledTransferType(transfer.type)) return next();
if (!isUrl_1(transfer.text)) return next();
if (!isUrl(transfer.text)) return next();
if (!transfer.text.match(supportedVideoLinkSnippet)) return next();

@@ -119,0 +76,0 @@ return editor.insertVideo({

6

package.json
{
"name": "@convertkit/editor-videos",
"version": "0.0.5",
"version": "0.0.6",
"description": "A plugin for embedding videos in the ConvertKit Editor",

@@ -33,6 +33,6 @@ "main": "index.js",

"devDependencies": {
"@convertkit/selection-toolbar": "^0.1.6",
"@convertkit/selection-toolbar": "^0.1.7",
"slate-hyperprint": "^2.2.6"
},
"gitHead": "c29893ec56fbd2573583eeabbeb716ed2f92067d"
"gitHead": "b3696cac4ed9258fc7bd2b12c8fa48a8d8c32d29"
}
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