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

conditional-wrap

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

conditional-wrap - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

5

es/index.d.ts

@@ -7,3 +7,4 @@ /// <reference types="react" />

}
declare const _default: ({ condition, children, wrap }: ConditionalWrapProps) => JSX.Element;
export default _default;
declare const ConditionalWrap: ({ condition, children, wrap }: ConditionalWrapProps) => JSX.Element;
export { ConditionalWrap, ConditionalWrap as default };

10

es/index.js
import React from 'react';
export default (function (_ref) {
export var ConditionalWrap = function ConditionalWrap(_ref) {
var condition = _ref.condition,
children = _ref.children,
wrap = _ref.wrap;
children = _ref.children,
wrap = _ref.wrap;
return condition ? React.cloneElement(wrap(children)) : children;
});
};
export default ConditionalWrap;

@@ -7,3 +7,4 @@ /// <reference types="react" />

}
declare const _default: ({ condition, children, wrap }: ConditionalWrapProps) => JSX.Element;
export default _default;
declare const ConditionalWrap: ({ condition, children, wrap }: ConditionalWrapProps) => JSX.Element;
export { ConditionalWrap, ConditionalWrap as default };

@@ -1,18 +0,15 @@

'use strict';
"use strict";
exports.__esModule = true;
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function (_ref) {
exports["default"] = exports.ConditionalWrap = void 0;
var _react = _interopRequireDefault(require("react"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var ConditionalWrap = function ConditionalWrap(_ref) {
var condition = _ref.condition,
children = _ref.children,
wrap = _ref.wrap;
return condition ? _react2.default.cloneElement(wrap(children)) : children;
children = _ref.children,
wrap = _ref.wrap;
return condition ? _react["default"].cloneElement(wrap(children)) : children;
};
module.exports = exports['default'];
exports.ConditionalWrap = ConditionalWrap;
var _default = ConditionalWrap;
exports["default"] = _default;
{
"name": "conditional-wrap",
"version": "1.0.2",
"version": "1.0.3",
"description": "conditional-wrap React component",

@@ -23,7 +23,7 @@ "main": "lib/index.js",

"peerDependencies": {
"react": "16.x"
"react": ">=16.0.0"
},
"devDependencies": {
"@types/react": "^16.9.17",
"nwb": "0.21.x",
"nwb": "0.25.2",
"react": "^16.4.0",

@@ -30,0 +30,0 @@ "react-dom": "^16.4.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