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

asset-parser

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asset-parser - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

24

asset.js

@@ -1,5 +0,5 @@

import React, { version } from 'react';
import diagnostics from 'diagnostics';
import { Pass } from './passthrough';
import transform from './transform';
import React from 'react';
import { G } from 'svgs';

@@ -13,11 +13,2 @@

/**
* Detect which version of React we're using and if we can optimize
* our render process.
*
* @type {Boolean}
* @private
*/
const react16 = +version.slice(0, 2) >= 16;
/**
* Representation of a single Asset of an bundle.

@@ -54,3 +45,3 @@ *

if (react16) return {
return {
props: this.parsed.props,

@@ -63,14 +54,3 @@ svg: (

};
return {
props: this.parsed.props,
svg: (
<Pass { ...changes } modify={ this.hooks }>
<G>
{ this.parsed.svg }
</G>
</Pass>
)
}
}
}

4

CHANGELOG.md
# CHANGELOG
### 2.0.0
- Removed React 15 support.
### 1.0.0
- Initial public release.

@@ -11,6 +11,2 @@ 'use strict';

var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _diagnostics = require('diagnostics');

@@ -26,2 +22,6 @@

var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _svgs = require('svgs');

@@ -39,11 +39,2 @@

/**
* Detect which version of React we're using and if we can optimize
* our render process.
*
* @type {Boolean}
* @private
*/
var react16 = +_react.version.slice(0, 2) >= 16;
/**
* Representation of a single Asset of an bundle.

@@ -92,3 +83,3 @@ *

if (react16) return {
return {
props: this.parsed.props,

@@ -101,15 +92,2 @@ svg: _react2.default.createElement(

};
return {
props: this.parsed.props,
svg: _react2.default.createElement(
_passthrough.Pass,
_extends({}, changes, { modify: this.hooks }),
_react2.default.createElement(
_svgs.G,
null,
this.parsed.svg
)
)
};
}

@@ -116,0 +94,0 @@ }]);

{
"name": "asset-parser",
"version": "1.0.0",
"version": "1.0.1",
"description": "Parse SVG asset bundles",

@@ -9,3 +9,3 @@ "main": "./lib/",

"test:web": "mocha --colors --require babel-register --require test/setup.js test/*.test.js",
"test": "nyc --reporter=text --reporter=json-summary npm run test:web",
"test": "nyc --reporter=text --reporter=lcov npm run test:web",
"prepublish": "npm run build",

@@ -12,0 +12,0 @@ "build": "rm -rf ./lib && babel ./asset.js ./index.js ./packer/*.js ./passthrough/*.js ./transform.js -d ./lib",

@@ -20,7 +20,2 @@ # asset-parser

**IMPORTANT** This module was build with React 16+ in mind. If you are using
React 15, you will end up with useless elements in your SVG tree as we need to
wrap children with an extra `</ G>` tag. It's advised to upgrade to React 16+
as soon as possible.
## Table of contents

@@ -27,0 +22,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