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

react-lorem-component

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-lorem-component - npm Package Compare versions

Comparing version 0.3.4 to 0.4.0

25

index.js

@@ -12,20 +12,19 @@ "use strict";

getDefaultProps: function() {
return { count: 5, random: random, seed: 0 };
return { count: 5, seed: 0 };
},
getInitialState: function() {
render: function() {
var options = merge(this.props, {
units: "paragraphs",
format: "html",
random: random
});
random.seed(this.props.seed);
var options = merge(this.props, { units: "paragraphs", format: "plain" });
var paragraphs = loremIpsum(options).split(/\r?\n/).filter(function(p) { return p.length; });
var html = loremIpsum(options);
return { paragraphs: paragraphs };
},
render: function() {
var content = this.state.paragraphs.map(function(paragraph, i) {
return React.DOM.p({ key: i }, paragraph);
});
return this.transferPropsTo(React.DOM.div(null, content));
return this.transferPropsTo(
React.DOM.div({ dangerouslySetInnerHTML: { __html: html } })
);
}

@@ -32,0 +31,0 @@ });

{
"name": "react-lorem-component",
"version": "0.3.4",
"version": "0.4.0",
"description": "A component for React that renders paragraph tags full of lorem ipsum text",

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

@@ -7,8 +7,15 @@ var assert = require("assert");

it("renders lorem ipsum text", function() {
var component = LoremIpsum({ count: 1, words: ["foo"] });
var component = LoremIpsum({
count: 2,
words: ["foo"],
sentenceLowerBound: 3,
sentenceUpperBound: 3,
paragraphLowerBound: 2,
paragraphUpperBound: 2
});
React.renderComponentToString(component, function(markup) {
assert(/foo/.test(markup));
assert(/<p>Foo foo foo. Foo foo foo.<\/p><p>Foo foo foo. Foo foo foo.<\/p>/.test(markup));
});
});
});
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