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

styled-tools

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

styled-tools - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

39

dist/index.js

@@ -8,2 +8,4 @@ '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; };
var _get2 = require('lodash/get');

@@ -34,3 +36,8 @@

*/
const get = exports.get = (path, defaultValue) => (props = {}) => (0, _get3.default)(props, path, defaultValue);
var get = exports.get = function get(path, defaultValue) {
return function () {
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return (0, _get3.default)(props, path, defaultValue);
};
};

@@ -51,14 +58,20 @@ /**

*/
const ifProp = exports.ifProp = (needle, pass, fail) => (props = {}) => {
let result;
if (Array.isArray(needle)) {
result = !(0, _at2.default)(props, needle).filter(value => !value).length;
} else if (typeof needle === 'object') {
const needleKeys = Object.keys(needle);
const needleValues = (0, _values2.default)(needle);
result = !(0, _difference2.default)((0, _at2.default)(props, needleKeys), needleValues).length;
} else {
result = (0, _get3.default)(props, needle);
}
return result ? pass : fail;
var ifProp = exports.ifProp = function ifProp(needle, pass, fail) {
return function () {
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var result = void 0;
if (Array.isArray(needle)) {
result = !(0, _at2.default)(props, needle).filter(function (value) {
return !value;
}).length;
} else if ((typeof needle === 'undefined' ? 'undefined' : _typeof(needle)) === 'object') {
var needleKeys = Object.keys(needle);
var needleValues = (0, _values2.default)(needle);
result = !(0, _difference2.default)((0, _at2.default)(props, needleKeys), needleValues).length;
} else {
result = (0, _get3.default)(props, needle);
}
return result ? pass : fail;
};
};
{
"name": "styled-tools",
"version": "0.1.2",
"version": "0.1.3",
"description": "Utilities for styled-components",

@@ -5,0 +5,0 @@ "license": "MIT",

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