Skip to content

Commit

Permalink
Replace _.create with native JS (#430)
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Mar 11, 2021
1 parent 1ba7f04 commit ba1ecfb
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/svg-sprite/mode/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function SVGSpriteCss(spriter, config, data, key) {
*
* @type {Object}
*/
SVGSpriteCss.prototype = _.create(SVGSpriteBase.prototype, {
SVGSpriteCss.prototype = Object.assign(Object.create(SVGSpriteBase.prototype), {
constructor : SVGSpriteCss,
mode : SVGSpriteBase.prototype.MODE_CSS,
tmpl : 'css',
Expand Down
3 changes: 1 addition & 2 deletions lib/svg-sprite/mode/defs.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE
*/

var _ = require('lodash');
var SVGSpriteStandalone = require('./standalone');
var SVGSprite = require('../sprite');

Expand All @@ -31,7 +30,7 @@ function SVGSpriteDefs(spriter, config, data, key) {
*
* @type {Object}
*/
SVGSpriteDefs.prototype = _.create(SVGSpriteStandalone.prototype, {
SVGSpriteDefs.prototype = Object.assign(Object.create(SVGSpriteStandalone.prototype), {
constructor : SVGSpriteDefs,
mode : SVGSpriteStandalone.prototype.MODE_DEFS
});
Expand Down
3 changes: 1 addition & 2 deletions lib/svg-sprite/mode/stack.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE
*/

var _ = require('lodash');
var SVGSpriteStandalone = require('./standalone');
var SVGSprite = require('../sprite');

Expand All @@ -31,7 +30,7 @@ function SVGSpriteStack(spriter, config, data, key) {
*
* @type {Object}
*/
SVGSpriteStack.prototype = _.create(SVGSpriteStandalone.prototype, {
SVGSpriteStack.prototype = Object.assign(Object.create(SVGSpriteStandalone.prototype), {
constructor : SVGSpriteStack,
mode : SVGSpriteStandalone.prototype.MODE_STACK
});
Expand Down
2 changes: 1 addition & 1 deletion lib/svg-sprite/mode/standalone.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function SVGSpriteStandalone(spriter, config, data) {
*
* @type {Object}
*/
SVGSpriteStandalone.prototype = _.create(SVGSpriteBase.prototype, {
SVGSpriteStandalone.prototype = Object.assign(Object.create(SVGSpriteBase.prototype), {
constructor : SVGSpriteStandalone
});

Expand Down
3 changes: 1 addition & 2 deletions lib/svg-sprite/mode/symbol.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE
*/

var _ = require('lodash');
var SVGSpriteStandalone = require('./standalone');
var SVGSprite = require('../sprite');
var symbolAttributes = ['id', 'xml:base', 'xml:lang', 'xml:space', 'onfocusin', 'onfocusout', 'onactivate', 'onclick', 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout', 'onload', 'alignment-baseline', 'baseline-shift', 'clip', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cursor', 'direction', 'display', 'dominant-baseline', 'enable-background', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'image-rendering', 'kerning', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'mask', 'opacity', 'overflow', 'pointer-events', 'shape-rendering', 'stop-color', 'stop-opacity', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'unicode-bidi', 'visibility', 'word-spacing', 'writing-mode', 'class', 'style', 'externalResourcesRequired', 'preserveAspectRatio', 'viewBox', 'aria-labelledby'];
Expand All @@ -32,7 +31,7 @@ function SVGSpriteSymbol(spriter, config, data, key) {
*
* @type {Object}
*/
SVGSpriteSymbol.prototype = _.create(SVGSpriteStandalone.prototype, {
SVGSpriteSymbol.prototype = Object.assign(Object.create(SVGSpriteStandalone.prototype), {
constructor : SVGSpriteSymbol,
mode : SVGSpriteStandalone.prototype.MODE_SYMBOL
});
Expand Down
5 changes: 2 additions & 3 deletions lib/svg-sprite/mode/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE
*/

var _ = require('lodash'),
SVGSpriteStandalone = require('./standalone'),
var SVGSpriteStandalone = require('./standalone'),
SVGSpriteCss = require('./css'),
SVGSprite = require('../sprite');

Expand All @@ -32,7 +31,7 @@ function SVGSpriteView(spriter, config, data, key) {
*
* @type {Object}
*/
SVGSpriteView.prototype = _.create(SVGSpriteCss.prototype, {
SVGSpriteView.prototype = Object.assign(Object.create(SVGSpriteCss.prototype), {
constructor : SVGSpriteView,
mode : SVGSpriteCss.prototype.MODE_VIEW,

Expand Down

0 comments on commit ba1ecfb

Please sign in to comment.