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

@nozbe/zacs

Package Overview
Dependencies
Maintainers
8
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nozbe/zacs - npm Package Compare versions

Comparing version 1.1.0-11 to 1.1.0-12

2

package.json
{
"name": "@nozbe/zacs",
"version": "1.1.0-11",
"version": "1.1.0-12",
"description": "Zero Abstraction Cost Styling (for React DOM and React Native)",

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

@@ -985,29 +985,47 @@ /* eslint-disable no-use-before-define */

visitor: {
VariableDeclarator(path, state) {
if (!isZacsDeclaration(t, path.node)) {
return
}
VariableDeclarator: {
enter(path, state) {
if (!isZacsDeclaration(t, path.node)) {
return
}
validateZacsDeclaration(t, path)
validateZacsDeclaration(t, path)
const { node } = path
const { init } = node
const zacsMethod = init.callee.property.name
const { node } = path
const { init } = node
const zacsMethod = init.callee.property.name
if (zacsMethod === '_experimentalStyleSheet') {
transformStyleSheet(t, state, path)
} else if (zacsMethod.startsWith('create')) {
node.init = createZacsComponent(t, state, path)
} else {
const id = node.id.name
const stateKey = componentKey(id)
if (state.get(stateKey)) {
throw path.buildCodeFrameError(`Duplicate ZACS declaration for name: ${id}`)
if (zacsMethod === '_experimentalStyleSheet') {
// do nothing, will process on exit
// eslint-disable-next-line no-useless-return
return
} else if (zacsMethod.startsWith('create')) {
node.init = createZacsComponent(t, state, path)
} else {
const id = node.id.name
const stateKey = componentKey(id)
if (state.get(stateKey)) {
throw path.buildCodeFrameError(`Duplicate ZACS declaration for name: ${id}`)
}
state.set(stateKey, node)
if (!state.opts.keepDeclarations) {
path.remove()
}
}
state.set(stateKey, node)
},
// StyleSheets must be processed on exit so that other babel plugins that transform
// inline expressions into literals can do their work first
// TODO: Deduplicate
exit(path, state) {
if (!isZacsDeclaration(t, path.node)) {
return
}
if (!state.opts.keepDeclarations) {
path.remove()
const zacsMethod = path.node.init.callee.property.name
if (zacsMethod !== '_experimentalStyleSheet') {
return
}
}
transformStyleSheet(t, state, path)
},
},

@@ -1014,0 +1032,0 @@ JSXElement(path, state) {

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