Socket
Socket
Sign inDemoInstall

embeds

Package Overview
Dependencies
9
Maintainers
3
Versions
30
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.4.3 to 1.5.0

20

dist/parse-input.js

@@ -31,3 +31,3 @@ 'use strict';

var allowed = [[/(https?:)?\/\/(www\.)?instagram\.com\/p\/([A-Za-z0-9_-]+)/, function (match) {
var allowed = [[/(https?:)?\/\/(www\.)?instagram\.com\/p\/([\w.-]+)/, function (match) {
var id = match[3];

@@ -40,3 +40,3 @@ return {

};
}], [/(https?:)?\/\/(www\.)?giphy\.com\/embed\/([A-Za-z0-9_-]+)/, function (match) {
}], [/(https?:)?\/\/(www\.)?giphy\.com\/embed\/([\w.-]+)/, function (match) {
var id = match[3];

@@ -49,3 +49,3 @@ return {

};
}], [/(https?:)?\/\/(www\.)?facebook\.com\/([A-Za-z0-9_-]+)\/(videos|posts)\/([0-9]+)/, function (match) {
}], [/(https?:)?\/\/(www\.)?facebook\.com\/([\w.-]+)\/(videos|posts)\/([0-9]+)/, function (match) {
var user = match[3];

@@ -62,3 +62,3 @@ var type = match[4];

};
}], [/(https?:)?\/\/(www\.)?twitter\.com\/([A-Za-z0-9_-]+)\/status\/([0-9]+)/, function (match) {
}], [/(https?:)?\/\/(www\.)?twitter\.com\/([\w.-]+)\/status\/([0-9]+)/, function (match) {
var user = match[3];

@@ -72,3 +72,3 @@ var id = match[4];

};
}], [/(https?:)?\/\/(www\.)?youtube\.com\/(embed\/|watch\?v=)([A-Za-z0-9_-]+)/, function (match) {
}], [/(https?:)?\/\/(www\.)?youtube\.com\/(embed\/|watch\?v=)([\w.-]+)/, function (match) {
var id = match[4];

@@ -80,3 +80,3 @@ return {

};
}], [/(https?:)?\/\/(www\.)?youtu\.be\/([A-Za-z0-9_-]+)/, function (match) {
}], [/(https?:)?\/\/(www\.)?youtu\.be\/([\w.-]+)/, function (match) {
var id = match[3];

@@ -88,3 +88,3 @@ return {

};
}], [/(https?:)?\/\/embed\.tumblr\.com\/embed\/post\/([A-Za-z0-9_-]+)\/([0-9]+)/, function (match) {
}], [/(https?:)?\/\/embed\.tumblr\.com\/embed\/post\/([\w.-]+)\/([0-9]+)/, function (match) {
var key = match[2];

@@ -97,3 +97,3 @@ var id = match[3];

};
}], [/(https?:)?\/\/(www\.)?vine\.co\/v\/([A-Za-z0-9_-]+)/, function (match) {
}], [/(https?:)?\/\/(www\.)?vine\.co\/v\/([\w.-]+)/, function (match) {
var id = match[3];

@@ -105,3 +105,3 @@ return {

};
}], [/(https?:)?\/\/(www\.)?imgur\.com\/(gallery\/)?([A-Za-z0-9_-]+)/, function (match) {
}], [/(https?:)?\/\/(www\.)?imgur\.com\/(gallery\/)?([\w.-]+)/, function (match) {
var id = match[4];

@@ -113,3 +113,3 @@ return {

};
}], [/(https?:)?\/\/(www\.|w\.)?graphiq\.com\/(wlp|w)\/([A-Za-z0-9_-]+)/, function (match) {
}], [/(https?:)?\/\/(www\.|w\.)?graphiq\.com\/(wlp|w)\/([\w.-]+)/, function (match) {
var id = match[4];

@@ -116,0 +116,0 @@ return {

const allowed = [
[/(https?:)?\/\/(www\.)?instagram\.com\/p\/([A-Za-z0-9_-]+)/, match => {
[/(https?:)?\/\/(www\.)?instagram\.com\/p\/([\w.-]+)/, match => {
const id = match[3];

@@ -11,3 +11,3 @@ return {

}],
[/(https?:)?\/\/(www\.)?giphy\.com\/embed\/([A-Za-z0-9_-]+)/, match => {
[/(https?:)?\/\/(www\.)?giphy\.com\/embed\/([\w.-]+)/, match => {
const id = match[3];

@@ -21,3 +21,3 @@ return {

}],
[/(https?:)?\/\/(www\.)?facebook\.com\/([A-Za-z0-9_-]+)\/(videos|posts)\/([0-9]+)/, match => {
[/(https?:)?\/\/(www\.)?facebook\.com\/([\w.-]+)\/(videos|posts)\/([0-9]+)/, match => {
const user = match[3];

@@ -35,3 +35,3 @@ const type = match[4];

}],
[/(https?:)?\/\/(www\.)?twitter\.com\/([A-Za-z0-9_-]+)\/status\/([0-9]+)/, match => {
[/(https?:)?\/\/(www\.)?twitter\.com\/([\w.-]+)\/status\/([0-9]+)/, match => {
const user = match[3];

@@ -46,3 +46,3 @@ const id = match[4];

}],
[/(https?:)?\/\/(www\.)?youtube\.com\/(embed\/|watch\?v=)([A-Za-z0-9_-]+)/, match => {
[/(https?:)?\/\/(www\.)?youtube\.com\/(embed\/|watch\?v=)([\w.-]+)/, match => {
const id = match[4];

@@ -55,3 +55,3 @@ return {

}],
[/(https?:)?\/\/(www\.)?youtu\.be\/([A-Za-z0-9_-]+)/, match => {
[/(https?:)?\/\/(www\.)?youtu\.be\/([\w.-]+)/, match => {
const id = match[3];

@@ -64,3 +64,3 @@ return {

}],
[/(https?:)?\/\/embed\.tumblr\.com\/embed\/post\/([A-Za-z0-9_-]+)\/([0-9]+)/, match => {
[/(https?:)?\/\/embed\.tumblr\.com\/embed\/post\/([\w.-]+)\/([0-9]+)/, match => {
const key = match[2];

@@ -74,3 +74,3 @@ const id = match[3];

}],
[/(https?:)?\/\/(www\.)?vine\.co\/v\/([A-Za-z0-9_-]+)/, match => {
[/(https?:)?\/\/(www\.)?vine\.co\/v\/([\w.-]+)/, match => {
const id = match[3];

@@ -83,3 +83,3 @@ return {

}],
[/(https?:)?\/\/(www\.)?imgur\.com\/(gallery\/)?([A-Za-z0-9_-]+)/, match => {
[/(https?:)?\/\/(www\.)?imgur\.com\/(gallery\/)?([\w.-]+)/, match => {
const id = match[4];

@@ -92,3 +92,3 @@ return {

}],
[/(https?:)?\/\/(www\.|w\.)?graphiq\.com\/(wlp|w)\/([A-Za-z0-9_-]+)/, match => {
[/(https?:)?\/\/(www\.|w\.)?graphiq\.com\/(wlp|w)\/([\w.-]+)/, match => {
const id = match[4];

@@ -95,0 +95,0 @@ return {

{
"name": "embeds",
"version": "1.4.3",
"version": "1.5.0",
"description": "Parse & render embeds",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -382,1 +382,24 @@ import test from 'ava';

});
test('facebook allow periods in username', t => {
const expected = {
type: 'facebook',
embedAs: 'video',
user: 'rick.morty',
url: 'https://www.facebook.com/rick.morty/videos/1337',
id: '1337'
};
const actual = parseInput('https://www.facebook.com/rick.morty/videos/1337');
t.deepEqual(expected, actual);
});
test('twitter allow periods in username', t => {
const expected = {
type: 'twitter',
url: 'https://twitter.com/rick.morty/status/42',
user: 'rick.morty',
id: '42'
};
const actual = parseInput('https://twitter.com/rick.morty/status/42');
t.deepEqual(expected, actual);
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc