Socket
Socket
Sign inDemoInstall

styled-system

Package Overview
Dependencies
Maintainers
1
Versions
149
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

styled-system - npm Package Compare versions

Comparing version 1.0.0-4 to 1.0.0-5

9

dist/util.js
'use strict';
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -51,3 +53,5 @@

var joinObj = function joinObj(acc, obj) {
return Object.assign(acc, obj);
return Object.assign(acc, Object.keys(obj).reduce(function (result, key) {
return Object.assign(result, _defineProperty({}, key, _typeof(acc[key]) === 'object' && _typeof(obj[key]) === 'object' ? [acc[key], obj[key]].reduce(joinObj, {}) : obj[key]));
}, {}));
};

@@ -65,3 +69,4 @@

dec: dec,
joinObj: joinObj
joinObj: joinObj,
mq: mq
};
{
"name": "styled-system",
"version": "1.0.0-4",
"version": "1.0.0-5",
"description": "Design system utilities for styled-components, glamorous, and other css-in-js libraries",

@@ -35,9 +35,6 @@ "main": "dist/index.js",

"react-x-ray": "^1.0.0-2",
"styled-components": "^2.1.0",
"webpack": "^2.6.1",
"webpack-dev-server": "^2.4.5"
},
"dependencies": {
"glamorous": "^3.23.2",
"styled-components": "^2.1.0"
}
}

@@ -16,3 +16,15 @@ const { breakpoints } = require('./constants')

const media = bp => (d, i) => bp[i] ? ({[bp[i]]: d}) : d
const joinObj = (acc, obj) => Object.assign(acc, obj)
const joinObj = (acc, obj) =>
Object.assign(
acc,
Object.keys(obj).reduce(
(result, key) =>
Object.assign(result, {
[key]: typeof acc[key] === 'object' && typeof obj[key] === 'object'
? [acc[key], obj[key]].reduce(joinObj, {})
: obj[key],
}),
{}
)
);

@@ -30,2 +42,3 @@ module.exports = {

joinObj,
mq
}

@@ -159,2 +159,14 @@ import test from 'ava'

test('space returns responsive directional margins', t => {
const a = space({mt: [0, 1], mb: [2, 3]})
t.deepEqual(a, {
marginBottom: '16px',
marginTop: '0px',
'@media screen and (min-width: 40em)': {
marginBottom: '32px',
marginTop: '8px',
},
})
})
test('space returns padding declarations', t => {

@@ -197,2 +209,14 @@ const dec = space({p: 1})

test('space returns responsive directional paddings', t => {
const a = space({pt: [0, 1], pb: [2, 3]})
t.deepEqual(a, {
paddingBottom: '16px',
paddingTop: '0px',
'@media screen and (min-width: 40em)': {
paddingBottom: '32px',
paddingTop: '8px',
},
})
})
test('space can be configured with a theme', t => {

@@ -199,0 +223,0 @@ const a = space({theme, m: 1})

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