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

react-document-meta

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-document-meta - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

50

dist/index.js

@@ -48,3 +48,5 @@ 'use strict';

// ograph( props );
if (props.auto) {
autoProps(props);
}

@@ -54,21 +56,30 @@ return props;

function autoProps(props) {
if (props.auto.ograph === true) {
ograph(props);
}
return props;
}
function ograph(p) {
/* const og = p.ograph;
if ( og ) {
if ( p.title && !og.title ) {
p.tags.push({ property: 'og:title', content: p.title });
}
if ( p.description && !og.description ) {
p.tags.push({ property: 'og:description', content: p.description });
}
if ( p.canonical && !og.url ) {
p.tags.push({ property: 'og:url', content: p.canonical });
}
Object.keys(og).reduce(( acc, key ) => {
acc.push({ property: 'og:'+key, content: og[key] });
return acc;
}, p.tags);
if (!p.meta) {
p.meta = {};
}
if (!p.meta.property) {
p.meta.property = {};
}
var group = p.meta.property;
if (group) {
if (p.title && !group['og:title']) {
group['og:title'] = p.title;
}
*/
if (p.description && !group['og:description']) {
group['og:description'] = p.description;
}
// if ( p.canonical && !group['og:url'] ) {
// group['og:url'] = p.canonical;
// }
}
return p;

@@ -188,3 +199,4 @@ }

meta: _React2['default'].PropTypes.objectOf(_React2['default'].PropTypes.objectOf(_React2['default'].PropTypes.string)),
link: _React2['default'].PropTypes.objectOf(_React2['default'].PropTypes.objectOf(_React2['default'].PropTypes.string))
link: _React2['default'].PropTypes.objectOf(_React2['default'].PropTypes.objectOf(_React2['default'].PropTypes.string)),
auto: _React2['default'].PropTypes.objectOf(_React2['default'].PropTypes.bool)
},

@@ -191,0 +203,0 @@

@@ -34,3 +34,5 @@ import React from 'react';

// ograph( props );
if (props.auto) {
autoProps( props );
}

@@ -40,21 +42,30 @@ return props;

function autoProps ( props ) {
if (props.auto.ograph === true) {
ograph(props);
}
return props;
}
function ograph ( p ) {
/* const og = p.ograph;
if ( og ) {
if ( p.title && !og.title ) {
p.tags.push({ property: 'og:title', content: p.title });
if (!p.meta) {
p.meta = {};
}
if (!p.meta.property) {
p.meta.property = {};
}
const group = p.meta.property;
if ( group ) {
if ( p.title && !group['og:title'] ) {
group['og:title'] = p.title;
}
if ( p.description && !og.description ) {
p.tags.push({ property: 'og:description', content: p.description });
if ( p.description && !group['og:description'] ) {
group['og:description'] = p.description;
}
if ( p.canonical && !og.url ) {
p.tags.push({ property: 'og:url', content: p.canonical });
}
Object.keys(og).reduce(( acc, key ) => {
acc.push({ property: 'og:'+key, content: og[key] });
return acc;
}, p.tags);
// if ( p.canonical && !group['og:url'] ) {
// group['og:url'] = p.canonical;
// }
}
*/
return p;

@@ -163,3 +174,4 @@ }

meta: React.PropTypes.objectOf(React.PropTypes.objectOf(React.PropTypes.string)),
link: React.PropTypes.objectOf(React.PropTypes.objectOf(React.PropTypes.string))
link: React.PropTypes.objectOf(React.PropTypes.objectOf(React.PropTypes.string)),
auto: React.PropTypes.objectOf(React.PropTypes.bool)
},

@@ -166,0 +178,0 @@

{
"name": "react-document-meta",
"version": "0.1.1",
"version": "0.1.2",
"description": "Declarative, nested and stateful HTML document meta tags for React",

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

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