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

react-live

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-live - npm Package Compare versions

Comparing version 1.4.9 to 1.4.10

8

lib/utils/test/transpile.test.js

@@ -52,2 +52,10 @@ 'use strict';

});
it('should ignore comments', function () {
var code = '// Comment\n<div>Hello World!</div>';
var element = (0, _transpile.generateElement)({ code: code });
var wrapper = (0, _enzyme.shallow)(element);
expect(wrapper.text()).toBe('Hello World!');
});
});

@@ -54,0 +62,0 @@

4

lib/utils/transpile/index.js

@@ -29,5 +29,5 @@ 'use strict';

// NOTE: Workaround for classes, since buble doesn't allow `return` without a function
var transformed = (0, _transform2.default)(code).trim().replace(/^var \w+ =/, '');
var transformed = (0, _transform2.default)(code).trim().replace(/^var \w+ =/, '').replace(/;$/, '');
return (0, _errorBoundary2.default)((0, _evalCode2.default)('return ' + transformed, scope), errorCallback);
return (0, _errorBoundary2.default)((0, _evalCode2.default)('return (' + transformed + ')', scope), errorCallback);
};

@@ -34,0 +34,0 @@

{
"name": "react-live",
"version": "1.4.9",
"version": "1.4.10",
"description": "A production-focused playground for live editing React code",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -44,2 +44,10 @@ import React from 'react'

})
it('should ignore comments', () => {
const code = '// Comment\n<div>Hello World!</div>'
const element = generateElement({ code })
const wrapper = shallow(element)
expect(wrapper.text()).toBe('Hello World!')
})
})

@@ -46,0 +54,0 @@

@@ -13,6 +13,7 @@ import transform from './transform'

.replace(/^var \w+ =/, '')
.replace(/;$/, '')
return errorBoundary(
evalCode(
`return ${transformed}`,
`return (${transformed})`,
scope

@@ -19,0 +20,0 @@ ),

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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