Fix code quality violations and exclude Manifest from checks
Document application modes (development/debug/production) Add global file drop handler, order column normalization, SPA hash fix Serve CDN assets via /_vendor/ URLs instead of merging into bundles Add production minification with license preservation Improve JSON formatting for debugging and production optimization Add CDN asset caching with CSS URL inlining for production builds Add three-mode system (development, debug, production) Update Manifest CLAUDE.md to reflect helper class architecture Refactor Manifest.php into helper classes for better organization Pre-manifest-refactor checkpoint: Add app_mode documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
48
node_modules/svgo/plugins/cleanupListOfValues.js
generated
vendored
48
node_modules/svgo/plugins/cleanupListOfValues.js
generated
vendored
@@ -1,11 +1,15 @@
|
||||
'use strict';
|
||||
import { removeLeadingZero } from '../lib/svgo/tools.js';
|
||||
|
||||
const { removeLeadingZero } = require('../lib/svgo/tools.js');
|
||||
/**
|
||||
* @typedef CleanupListOfValuesParams
|
||||
* @property {number=} floatPrecision
|
||||
* @property {boolean=} leadingZero
|
||||
* @property {boolean=} defaultPx
|
||||
* @property {boolean=} convertToPx
|
||||
*/
|
||||
|
||||
exports.name = 'cleanupListOfValues';
|
||||
exports.type = 'visitor';
|
||||
exports.active = false;
|
||||
exports.description = 'rounds list of values to the fixed precision';
|
||||
export const name = 'cleanupListOfValues';
|
||||
export const description = 'rounds list of values to the fixed precision';
|
||||
|
||||
const regNumericValues =
|
||||
/^([-+]?\d*\.?\d+([eE][-+]?\d+)?)(px|pt|pc|mm|cm|m|in|ft|em|ex|%)?$/;
|
||||
@@ -25,23 +29,18 @@ const absoluteLengths = {
|
||||
*
|
||||
* @example
|
||||
* <svg viewBox="0 0 200.28423 200.28423" enable-background="new 0 0 200.28423 200.28423">
|
||||
* ⬇
|
||||
* ⬇
|
||||
* <svg viewBox="0 0 200.284 200.284" enable-background="new 0 0 200.284 200.284">
|
||||
*
|
||||
* <polygon points="208.250977 77.1308594 223.069336 ... "/>
|
||||
* ⬇
|
||||
* ⬇
|
||||
* <polygon points="208.251 77.131 223.069 ... "/>
|
||||
*
|
||||
* @author kiyopikko
|
||||
*
|
||||
* @type {import('../lib/types').Plugin<{
|
||||
* floatPrecision?: number,
|
||||
* leadingZero?: boolean,
|
||||
* defaultPx?: boolean,
|
||||
* convertToPx?: boolean
|
||||
* }>}
|
||||
* @type {import('../lib/types.js').Plugin<CleanupListOfValuesParams>}
|
||||
*/
|
||||
exports.fn = (_root, params) => {
|
||||
export const fn = (_root, params) => {
|
||||
const {
|
||||
floatPrecision = 3,
|
||||
leadingZero = true,
|
||||
@@ -50,7 +49,8 @@ exports.fn = (_root, params) => {
|
||||
} = params;
|
||||
|
||||
/**
|
||||
* @type {(lists: string) => string}
|
||||
* @param {string} lists
|
||||
* @returns {string}
|
||||
*/
|
||||
const roundValues = (lists) => {
|
||||
const roundedList = [];
|
||||
@@ -63,19 +63,15 @@ exports.fn = (_root, params) => {
|
||||
if (match) {
|
||||
// round it to the fixed precision
|
||||
let num = Number(Number(match[1]).toFixed(floatPrecision));
|
||||
/**
|
||||
* @type {any}
|
||||
*/
|
||||
let matchedUnit = match[3] || '';
|
||||
/**
|
||||
* @type{'' | keyof typeof absoluteLengths}
|
||||
*/
|
||||
/** @type {any} */
|
||||
const matchedUnit = match[3] || '';
|
||||
/** @type {'' | keyof typeof absoluteLengths} */
|
||||
let units = matchedUnit;
|
||||
|
||||
// convert absolute values to pixels
|
||||
if (convertToPx && units && units in absoluteLengths) {
|
||||
const pxNum = Number(
|
||||
(absoluteLengths[units] * Number(match[1])).toFixed(floatPrecision)
|
||||
(absoluteLengths[units] * Number(match[1])).toFixed(floatPrecision),
|
||||
);
|
||||
|
||||
if (pxNum.toString().length < match[0].length) {
|
||||
@@ -119,7 +115,7 @@ exports.fn = (_root, params) => {
|
||||
|
||||
if (node.attributes['enable-background'] != null) {
|
||||
node.attributes['enable-background'] = roundValues(
|
||||
node.attributes['enable-background']
|
||||
node.attributes['enable-background'],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -129,7 +125,7 @@ exports.fn = (_root, params) => {
|
||||
|
||||
if (node.attributes['stroke-dasharray'] != null) {
|
||||
node.attributes['stroke-dasharray'] = roundValues(
|
||||
node.attributes['stroke-dasharray']
|
||||
node.attributes['stroke-dasharray'],
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user