Socket
Socket
Sign inDemoInstall

embeds

Package Overview
Dependencies
Maintainers
4
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.5.1 to 2.6.0

dist/types/tumblr.js

6

dist/types/index.js

@@ -39,2 +39,6 @@ 'use strict';

var _tumblr = require('./tumblr');
var tumblr = _interopRequireWildcard(_tumblr);
var _custom = require('./custom');

@@ -57,3 +61,3 @@

var types = {
image: image, video: video, youtube: youtube, twitter: twitter, instagram: instagram, facebook: facebook, vine: vine, spotify: spotify,
image: image, video: video, youtube: youtube, twitter: twitter, instagram: instagram, facebook: facebook, vine: vine, spotify: spotify, tumblr: tumblr,
custom: custom /* last element */

@@ -60,0 +64,0 @@ };

3

lib/types/index.js

@@ -9,2 +9,3 @@ import * as image from './image';

import * as spotify from './spotify';
import * as tumblr from './tumblr';
import * as custom from './custom';

@@ -15,3 +16,3 @@ import assert from 'assert';

const types = {
image, video, youtube, twitter, instagram, facebook, vine, spotify,
image, video, youtube, twitter, instagram, facebook, vine, spotify, tumblr,
custom /* last element */

@@ -18,0 +19,0 @@ };

{
"name": "embeds",
"version": "2.5.1",
"version": "2.6.0",
"description": "Parse & render embeds",

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

@@ -12,3 +12,4 @@ const fs = require('fs');

tweetNoUser: fs.readFileSync(`${__dirname}/tweet-no-user.html`, 'utf8').trim(),
tweetVideo: fs.readFileSync(`${__dirname}/tweet-video.html`, 'utf8').trim()
tweetVideo: fs.readFileSync(`${__dirname}/tweet-video.html`, 'utf8').trim(),
tumblrPost: fs.readFileSync(`${__dirname}/tumblr-post.html`, 'utf8').trim()
};

@@ -536,2 +536,17 @@ import test from './tape-wrapper';

test('parse() tumblr embed', t => {
const input = fixtures.tumblrPost;
const actual = parse(input);
const expected = {
type: 'tumblr',
did: '7c08ba46cb75162284770cdee2a59365891a5e18',
url: 'https://embed.tumblr.com/embed/post/8_SX4ALNOf1fYyEcjq78YQ/147291233392',
text: [{
content: 'http://jencita.tumblr.com/post/147291233392/tswiftdaily-taylor-swift-at-lady-cilento',
href: 'http://jencita.tumblr.com/post/147291233392/tswiftdaily-taylor-swift-at-lady-cilento'
}]
};
t.deepEqual(actual, expected);
});
test('parse() custom embed', t => {

@@ -538,0 +553,0 @@ const input = '<iframe src="http://custom.com" width="600" height="600" frameborder="0"></iframe>';

@@ -53,1 +53,8 @@ import test from './tape-wrapper';

});
test('parse() + render() tumblr post', t => {
const input = fixtures.tumblrPost;
const expected = input;
const actual = parseAndRender(input);
t.is(actual, expected);
});

@@ -334,2 +334,17 @@ import test from './tape-wrapper';

test('render() tumblr', t => {
const input = {
type: 'tumblr',
did: '7c08ba46cb75162284770cdee2a59365891a5e18',
url: 'https://embed.tumblr.com/embed/post/8_SX4ALNOf1fYyEcjq78YQ/147291233392',
text: [{
content: 'http://jencita.tumblr.com/post/147291233392/tswiftdaily-taylor-swift-at-lady-cilento',
href: 'http://jencita.tumblr.com/post/147291233392/tswiftdaily-taylor-swift-at-lady-cilento'
}]
};
const actual = render(input);
const expected = fixtures.tumblrPost;
t.is(actual, expected);
});
test('renderText()', t => {

@@ -336,0 +351,0 @@ t.deepEqual(renderText(undefined), []);

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