Socket
Socket
Sign inDemoInstall

babel-helpers

Package Overview
Dependencies
25
Maintainers
3
Versions
52
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.1.18 to 6.1.20

4

lib/helpers.js

@@ -16,3 +16,3 @@ "use strict";

helpers.createRawReactElement = _babelTemplate2["default"]("\n (function () {\n var REACT_ELEMENT_TYPE = (typeof Symbol === \"function\" && Symbol.for && Symbol.for(\"react.element\")) || 0xeac7;\n\n return function createRawReactElement (type, key, props) {\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: null,\n props: props,\n _owner: null,\n };\n };\n\n })()\n");
helpers.jsx = _babelTemplate2["default"]("\n (function () {\n var REACT_ELEMENT_TYPE = (typeof Symbol === \"function\" && Symbol.for && Symbol.for(\"react.element\")) || 0xeac7;\n\n return function createRawReactElement (type, props, key, children) {\n var defaultProps = type && type.defaultProps;\n var childrenLength = arguments.length - 3;\n\n if (!props && childrenLength !== 0) {\n // If we're going to assign props.children, we create a new object now\n // to avoid mutating defaultProps.\n props = {};\n }\n if (props && defaultProps) {\n for (var propName in defaultProps) {\n if (props[propName] === void 0) {\n props[propName] = defaultProps[propName];\n }\n }\n } else if (!props) {\n props = defaultProps || {};\n }\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 3];\n }\n props.children = childArray;\n }\n\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key === undefined ? null : '' + key,\n ref: null,\n props: props,\n _owner: null,\n };\n };\n\n })()\n");

@@ -25,4 +25,2 @@ helpers.asyncToGenerator = _babelTemplate2["default"]("\n (function (fn) {\n return function () {\n var gen = fn.apply(this, arguments);\n\n return new Promise(function (resolve, reject) {\n var callNext = step.bind(null, \"next\");\n var callThrow = step.bind(null, \"throw\");\n\n function step(key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(callNext, callThrow);\n }\n }\n\n callNext();\n });\n };\n })\n");

helpers.defaultProps = _babelTemplate2["default"]("\n (function (defaultProps, props) {\n if (defaultProps) {\n for (var propName in defaultProps) {\n if (typeof props[propName] === \"undefined\") {\n props[propName] = defaultProps[propName];\n }\n }\n }\n return props;\n })\n");
helpers.defineEnumerableProperties = _babelTemplate2["default"]("\n (function (obj, descs) {\n for (var key in descs) {\n var desc = descs[key];\n desc.configurable = desc.enumerable = true;\n if (\"value\" in desc) desc.writable = true;\n Object.defineProperty(obj, key, desc);\n }\n return obj;\n })\n");

@@ -29,0 +27,0 @@

@@ -16,3 +16,3 @@ "use strict";

var fn = _helpers2["default"][name];
if (!fn) throw ReferenceError;
if (!fn) throw new ReferenceError("Unknown helper " + name);

@@ -19,0 +19,0 @@ return fn().expression;

{
"name": "babel-helpers",
"version": "6.1.18",
"version": "6.1.20",
"description": "Collection of helper functions used by Babel transforms.",

@@ -5,0 +5,0 @@ "author": "Sebastian McKenzie <sebmck@gmail.com>",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc