Skip to content

Commit

Permalink
Merge 018edd9 into d2b5a91
Browse files Browse the repository at this point in the history
  • Loading branch information
Kreeg committed Mar 14, 2022
2 parents d2b5a91 + 018edd9 commit 4c86d75
Show file tree
Hide file tree
Showing 29 changed files with 8,568 additions and 4,505 deletions.
12 changes: 0 additions & 12 deletions .c8rc.json

This file was deleted.

8 changes: 0 additions & 8 deletions .mocharc.json

This file was deleted.

26 changes: 26 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
'use strict';

module.exports = {
clearMocks: true,
resetMocks: true,
coverageProvider: 'v8',
coverageReporters: ['html', 'lcov', 'text'],
collectCoverageFrom: [
'bin/*.js',
'lib/**/*.js',
'!**/node_modules/**'
],
moduleFileExtensions: [
'js',
'json'
],
testMatch: [
'**/*.test.js'
],
testPathIgnorePatterns: [
'/node_modules/'
],
setupFilesAfterEnv: ['<rootDir>/test/jest/setup.js'],
globalSetup: '<rootDir>/test/jest/setup.global.js',
testTimeout: 10_000
};
4 changes: 3 additions & 1 deletion lib/svg-sprite/shape.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ const async = require('async');
const fixXMLString = require('./utils/fix-xml-string.js');
const { isFunction, isString } = require('./utils/index.js');

const DEFAULT_XML_DECLARATION = '<?xml version="1.0" encoding="utf-8"?>';

/**
* Default callback for shape ID generation
*
Expand Down Expand Up @@ -172,7 +174,7 @@ function SVGShape(file, spriter) {
// XML declaration and doctype
const xmldecl = this.svg.current.match(/<\?xml.*?>/g);
const doctype = this.svg.current.match(/<!DOCTYPE.*?>/g);
this.xmlDeclaration = xmldecl ? xmldecl[0] : '<?xml version="1.0" encoding="utf-8"?>';
this.xmlDeclaration = xmldecl ? xmldecl[0] : DEFAULT_XML_DECLARATION;
this.doctypeDeclaration = doctype ? doctype[0] : '';

this.spriter.verbose('Added shape "%s:%s"', this.base, this.state || 'regular');
Expand Down

0 comments on commit 4c86d75

Please sign in to comment.