Skip to content

Commit

Permalink
Merge branch 'master' into update-js-yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Mar 11, 2021
2 parents 475069f + ba1ecfb commit ed1918f
Show file tree
Hide file tree
Showing 20 changed files with 41 additions and 43 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ Please refer to the [changelog](CHANGELOG.md) for a complete release history.

## Legal

Copyright © 2018 Joschi Kuphal <joschi@kuphal.net> / [@jkphl](https://twitter.com/jkphl). *svg-sprite* is licensed under the terms of the [MIT license](LICENSE.txt). The contained example SVG icons are part of the [Tango Icon Library](http://tango.freedesktop.org/Tango_Icon_Library) and belong to the Public Domain.
Copyright © 2018 Joschi Kuphal <joschi@kuphal.net> / [@jkphl](https://twitter.com/jkphl). *svg-sprite* is licensed under the terms of the [MIT license](LICENSE). The contained example SVG icons are part of the [Tango Icon Library](http://tango.freedesktop.org/Tango_Icon_Library) and belong to the Public Domain.


[npm-url]: https://npmjs.org/package/svg-sprite
Expand Down
20 changes: 11 additions & 9 deletions bin/svg-sprite.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/usr/bin/env node

'use strict';

/**
* svg-sprite is a Node.js module for creating SVG sprites
*
* @see https://github.com/svg-sprite/svg-sprite
*
* @author Joschi Kuphal <joschi@kuphal.net> (https://github.com/jkphl)
* @copyright © 2018 Joschi Kuphal
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE.txt
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE
*/

'use strict';

/**
* Module dependencies.
*/
Expand Down Expand Up @@ -106,14 +106,16 @@ function addConfigMap(store, path, value) {
*/
function mergeConfig(from, to) {
for (var f in from) {
if (_.isObject(from[f])) {
if (!_.isObject(to[f])) {
to[f] = from[f];
if (Object.prototype.hasOwnProperty.call(from, f)) {
if (Object.prototype.hasOwnProperty.call(to, f) && _.isObject(from[f])) {
if (!_.isObject(to[f])) {
to[f] = from[f];
} else {
mergeConfig(from[f], to[f]);
}
} else {
mergeConfig(from[f], to[f]);
to[f] = from[f];
}
} else {
to[f] = from[f];
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/svg-sprite.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* @author Joschi Kuphal <joschi@kuphal.net> (https://github.com/jkphl)
* @copyright © 2018 Joschi Kuphal
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE.txt
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE
*/

var CONFIG = require('./svg-sprite/config');
Expand Down
2 changes: 1 addition & 1 deletion lib/svg-sprite/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* @author Joschi Kuphal <joschi@kuphal.net> (https://github.com/jkphl)
* @copyright © 2018 Joschi Kuphal
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE.txt
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE
*/

var _ = require('lodash'),
Expand Down
2 changes: 1 addition & 1 deletion lib/svg-sprite/layouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* @author Joschi Kuphal <joschi@kuphal.net> (https://github.com/jkphl)
* @copyright © 2018 Joschi Kuphal
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE.txt
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE
*/

var _ = require('lodash'),
Expand Down
2 changes: 1 addition & 1 deletion lib/svg-sprite/mode/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* @author Joschi Kuphal <joschi@kuphal.net> (https://github.com/jkphl)
* @copyright © 2018 Joschi Kuphal
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE.txt
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE
*/

var path = require('path'),
Expand Down
4 changes: 2 additions & 2 deletions lib/svg-sprite/mode/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* @author Joschi Kuphal <joschi@kuphal.net> (https://github.com/jkphl)
* @copyright © 2018 Joschi Kuphal
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE.txt
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE
*/

var _ = require('lodash');
Expand All @@ -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
2 changes: 1 addition & 1 deletion lib/svg-sprite/mode/css/packer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* @author Joschi Kuphal <joschi@kuphal.net> (https://github.com/jkphl)
* @copyright © 2018 Joschi Kuphal
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE.txt
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE
*/

/**
Expand Down
5 changes: 2 additions & 3 deletions lib/svg-sprite/mode/defs.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
*
* @author Joschi Kuphal <joschi@kuphal.net> (https://github.com/jkphl)
* @copyright © 2018 Joschi Kuphal
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE.txt
* @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
5 changes: 2 additions & 3 deletions lib/svg-sprite/mode/stack.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
*
* @author Joschi Kuphal <joschi@kuphal.net> (https://github.com/jkphl)
* @copyright © 2018 Joschi Kuphal
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE.txt
* @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
4 changes: 2 additions & 2 deletions lib/svg-sprite/mode/standalone.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* @author Joschi Kuphal <joschi@kuphal.net> (https://github.com/jkphl)
* @copyright © 2018 Joschi Kuphal
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE.txt
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE
*/

var _ = require('lodash'),
Expand All @@ -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
5 changes: 2 additions & 3 deletions lib/svg-sprite/mode/symbol.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
*
* @author Joschi Kuphal <joschi@kuphal.net> (https://github.com/jkphl)
* @copyright © 2018 Joschi Kuphal
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE.txt
* @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
7 changes: 3 additions & 4 deletions lib/svg-sprite/mode/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
*
* @author Joschi Kuphal <joschi@kuphal.net> (https://github.com/jkphl)
* @copyright © 2018 Joschi Kuphal
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE.txt
* @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
2 changes: 1 addition & 1 deletion lib/svg-sprite/queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* @author Joschi Kuphal <joschi@kuphal.net> (https://github.com/jkphl)
* @copyright © 2018 Joschi Kuphal
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE.txt
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE
*/

var path = require('path'),
Expand Down
2 changes: 1 addition & 1 deletion lib/svg-sprite/shape.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* @author Joschi Kuphal <joschi@kuphal.net> (https://github.com/jkphl)
* @copyright © 2018 Joschi Kuphal
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE.txt
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE
*/

var _ = require('lodash'),
Expand Down
6 changes: 3 additions & 3 deletions lib/svg-sprite/shape/dimensions.phantom.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
'use strict';

/* jshint -W117 */

/**
* svg-sprite is a Node.js module for creating SVG sprites
*
* @see https://github.com/svg-sprite/svg-sprite
*
* @author Joschi Kuphal <joschi@kuphal.net> (https://github.com/jkphl)
* @copyright © 2018 Joschi Kuphal
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE.txt
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE
*/

/* jshint -W117 */

var system = require('system');

if (system.args.length !== 3) {
Expand Down
2 changes: 1 addition & 1 deletion lib/svg-sprite/sprite.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* @author Joschi Kuphal <joschi@kuphal.net> (https://github.com/jkphl)
* @copyright © 2018 Joschi Kuphal
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE.txt
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE
*/

var _ = require('lodash'),
Expand Down
2 changes: 1 addition & 1 deletion lib/svg-sprite/transform/svgo.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* @author Joschi Kuphal <joschi@kuphal.net> (https://github.com/jkphl)
* @copyright © 2018 Joschi Kuphal
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE.txt
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE
*/

var SVGO = require('svgo'),
Expand Down
8 changes: 4 additions & 4 deletions test/svg-sprite.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
'use strict';

/* jshint -W117 */
/* jshint -W030 */

/**
* svg-sprite is a Node.js module for creating SVG sprites
*
* @see https://github.com/svg-sprite/svg-sprite
*
* @author Joschi Kuphal <joschi@kuphal.net> (https://github.com/jkphl)
* @copyright © 2018 Joschi Kuphal
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE.txt
* @license MIT https://github.com/svg-sprite/svg-sprite/blob/master/LICENSE
*/

/* jshint -W117 */
/* jshint -W030 */

var fs = require('fs');
var util = require('util');
var svg2png = require('svg2png');
Expand Down

0 comments on commit ed1918f

Please sign in to comment.