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

styled-jsx-plugin-postcss

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

styled-jsx-plugin-postcss - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

9

index.js

@@ -5,2 +5,6 @@ const loopWhile = require('deasync').loopWhile

module.exports = (css, settings) => {
const cssWithPlaceholders = css
.replace(/%%styled-jsx-placeholder-(\d+)%%/g, (_, id) =>
`/*%%styled-jsx-placeholder-${id}%%*/`
)
let processedCss

@@ -14,3 +18,3 @@ let wait = true

processor(css)
processor(cssWithPlaceholders)
.then(resolved)

@@ -25,2 +29,5 @@ .catch(resolved)

return processedCss
.replace(/\/\*%%styled-jsx-placeholder-(\d+)%%\*\//g, (_, id) =>
`%%styled-jsx-placeholder-${id}%%`
)
}

2

package.json
{
"name": "styled-jsx-plugin-postcss",
"version": "0.1.0",
"version": "0.1.1",
"description": "Plugin to add PostCSS support to styled-jsx",

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

@@ -12,6 +12,6 @@ const assert = require('assert')

it('works with expressions placeholders', () => {
it('works with placeholders', () => {
assert.equal(
plugin('p { img { display: block } color: %%styled-jsx-expression-1%%; }'),
'p { color: %%styled-jsx-expression-1%%; } p img { display: block }'
plugin('p { img { display: block } color: %%styled-jsx-placeholder-0%%; } %%styled-jsx-placeholder-1%%'),
'p { color: %%styled-jsx-placeholder-0%%; } p img { display: block } %%styled-jsx-placeholder-1%%'
)

@@ -18,0 +18,0 @@ })

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