Socket
Socket
Sign inDemoInstall

embeds

Package Overview
Dependencies
Maintainers
5
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

embeds - npm Package Compare versions

Comparing version 2.11.5 to 2.11.6

test/fixtures/facebook-video-invalid-2.html

2

dist/types/facebook.js

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

var blockquoteElm = elm.getElementsByTagName('blockquote')[0];
var date = blockquoteElm ? (0, _lodash2.default)(blockquoteElm.childNodes).data.replace(' on ', '') : '';
var date = blockquoteElm ? (((0, _lodash2.default)(blockquoteElm.childNodes) || {}).data || '').replace(' on ', '') : '';
var user = {

@@ -59,0 +59,0 @@ url: aElms[1] && aElms[1].getAttribute('href') || '',

@@ -31,3 +31,3 @@ const type = 'facebook';

const blockquoteElm = elm.getElementsByTagName('blockquote')[0];
const date = blockquoteElm ? last(blockquoteElm.childNodes).data.replace(' on ', '') : '';
const date = blockquoteElm ? ((last(blockquoteElm.childNodes) || {}).data || '').replace(' on ', '') : '';
const user = {

@@ -34,0 +34,0 @@ url: aElms[1] && aElms[1].getAttribute('href') || '',

{
"name": "embeds",
"version": "2.11.5",
"version": "2.11.6",
"description": "Parse & render embeds",

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

@@ -10,2 +10,4 @@ const fs = require('fs');

facebookVideo: fs.readFileSync(`${__dirname}/facebook-video.html`, 'utf8').trim(),
facebookVideoInvalid: fs.readFileSync(`${__dirname}/facebook-video-invalid.html`, 'utf8').trim(),
facebookVideoInvalid2: fs.readFileSync(`${__dirname}/facebook-video-invalid-2.html`, 'utf8').trim(),
facebookPhoto: fs.readFileSync(`${__dirname}/facebook-photo.html`, 'utf8').trim(),

@@ -12,0 +14,0 @@ facebookEmbedCode: fs.readFileSync(`${__dirname}/facebook-embed-code.html`, 'utf8').trim(),

@@ -509,2 +509,38 @@ import test from './tape-wrapper';

test('parse() facebook - video invalid', t => {
const input = fixtures.facebookVideoInvalid;
const actual = parse(input);
const expected = {
embedAs: 'video',
type: 'facebook',
url: 'https://www.facebook.com/MicMedia/videos/1060315987324524/',
headline: '',
date: '',
user: {
url: '',
name: ''
},
text: []
};
t.deepEqual(actual, expected);
});
test('parse() facebook - video invalid 2', t => {
const input = fixtures.facebookVideoInvalid2;
const actual = parse(input);
const expected = {
embedAs: 'video',
type: 'facebook',
url: 'https://www.facebook.com/MicMedia/videos/1060315987324524/',
headline: '',
date: '1',
user: {
url: '',
name: ''
},
text: []
};
t.deepEqual(actual, expected);
});
test('parse() vine', t => {

@@ -511,0 +547,0 @@ const input = '<iframe src="https://vine.co/v/bjHh0zHdgZT/embed/simple" width="600" height="600" frameborder="0"></iframe><script src="https://platform.vine.co/static/scripts/embed.js"></script>';

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