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

react-text-replace

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-text-replace - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

2

package.json
{
"name": "react-text-replace",
"version": "0.0.1",
"version": "0.0.2",
"description": "A package that makes replace jsx components content easier.",

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

@@ -9,3 +9,3 @@ # React Text Replace

- Use: `require('react-text-replace')`
- Install: `npm install --save react-string-to-source`
- Install: `npm install --save react-text-source`

@@ -21,9 +21,9 @@ ### [YARN](https://yarnpkg.com/)

``` javascript
import React from 'react'
import { textReplace } from 'react-text-replace'
import uuidv1 from 'uuid/v1'
import React from "react"
import { textReplace } from "react-text-replace"
import uuidv1 from "uuid/v1"
const App = props =>
textReplace({
source: '>> Hello >> world >> !!',
source: ">> Hello >> world >> !!",
find: />>(.*)/,

@@ -54,4 +54,8 @@ call(match, $1) {

call(match, $1) {
return <span style={{fontSize: '2em'}} key={uuidv1()}>{$1}</span>
},
return (
<span style={{ fontSize: "2em" }} key={uuidv1()}>
{$1}
</span>
)
}
},

@@ -63,6 +67,7 @@ {

}
},
}
]
var App = props => textReplace(source, options) || textReplace(source, ...options)
var App = props =>
textReplace(source, options) || textReplace(source, ...options)
```

@@ -73,3 +78,3 @@

``` html
<span style="font-size: 2em;">
<span style="font-size: 2em">
Hello >> world >> <i>!!</i>

@@ -83,17 +88,20 @@ </span>

``` javascript
import React from 'react'
import { TextReplace } from 'react-text-replace'
import uuidv1 from 'uuid/v1'
import React from "react"
import { TextReplace } from "react-text-replace"
import uuidv1 from "uuid/v1"
// Creates a cache that lasts until close the page
const App = props =>
const App = props => (
<TextReplace
source = { ">> Hello >> world >> !!" }
pipe = {[
source={">> Hello >> world >> !!"}
pipe={[
{
find: />>(.*)/,
call(match, $1) {
return <span style={{fontSize: '2em'}} key={uuidv1()}>{$1}</span>
return (
<span style={{ fontSize: "2em" }} key={uuidv1()}>
{$1}
</span>
)
},

@@ -107,5 +115,6 @@ isRecursive: true

}
},
}
]}
/>
)
```

@@ -116,5 +125,5 @@

``` html
<span style="font-size: 2em;"> Hello
<span style="font-size: 2em;"> world
<span style="font-size: 2em;">
<span style="font-size: 2em"> Hello
<span style="font-size: 2em"> world
<span style="font-size: 2em">
<i>!!</i>

@@ -121,0 +130,0 @@ </span>

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