New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

inlines

Package Overview
Dependencies
Maintainers
2
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inlines - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0-alpha.0

12

dist/transform.js

@@ -15,7 +15,11 @@ import { css, keyframes } from 'goober';

export const transform = (p, style, ref) => {
// add some defaults
if ('onClick' in p && !('cursor' in style)) {
style.cursor = 'pointer';
}
const props = { ...p, ref };
const s = {};
for (const key in style) {
for (let key in style) {
// @ts-ignore
const value = style[key];
let value = style[key];
if (typeof value === 'object') {

@@ -33,2 +37,6 @@ if (value !== null) {

else if (key[0] === '&') {
if (key.includes(':hover')) {
value = { [key]: value };
key = '@media (hover: hover)';
}
addImportant(value, style);

@@ -35,0 +43,0 @@ }

2

package.json
{
"name": "inlines",
"description": "When you just want to use the style prop in React",
"version": "0.3.0",
"version": "0.4.0-alpha.0",
"main": "dist/index.js",

@@ -6,0 +6,0 @@ "types": "dist/index.d.ts",

@@ -1,2 +0,1 @@

import { CSSAttribute } from 'goober'
import { css, keyframes } from 'goober'

@@ -18,7 +17,13 @@ import type { Props, Style } from './types'

export const transform = (p: Props, style: Style, ref: any) => {
// add some defaults
if ('onClick' in p && !('cursor' in style)) {
style.cursor = 'pointer'
}
const props = { ...p, ref } as Props
const s = {} as Style
for (const key in style) {
for (let key in style) {
// @ts-ignore
const value = style[key]
let value = style[key]
if (typeof value === 'object') {

@@ -30,9 +35,13 @@ if (value !== null) {

} else if (key[1] === 'k') {
s.animation = `${keyframes(value as CSSAttribute)} 1s`
s.animation = `${keyframes(value)} 1s`
continue
}
} else if (key[0] === '&') {
if (key.includes(':hover')) {
value = { [key]: value }
key = '@media (hover: hover)'
}
addImportant(value, style)
}
const className = css({ [key]: value as CSSAttribute })
const className = css({ [key]: value })
props.className = props.className

@@ -39,0 +48,0 @@ ? `${props.className} ${className}`

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