diff options
author | Saivan <savian@me.com> | 2018-02-27 01:14:06 +1100 |
---|---|---|
committer | Saivan <savian@me.com> | 2018-02-27 01:14:06 +1100 |
commit | 15637375c5a00b64ae6b493187e5791cfadbc94f (patch) | |
tree | 44374e3a4e943de6d3382c9a99f01dc3c052c9ee /src/regex.js | |
parent | bec7881979149425a9c1b894f4741413b28c8141 (diff) | |
download | svg.js-15637375c5a00b64ae6b493187e5791cfadbc94f.tar.gz svg.js-15637375c5a00b64ae6b493187e5791cfadbc94f.zip |
All files now loosely abide by standard linting
This commit completes the rest of the files, making sure they are
in the standard linting format. Next we will add the linter to
the build process of our application.
Diffstat (limited to 'src/regex.js')
-rw-r--r-- | src/regex.js | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/regex.js b/src/regex.js index c0ca706..5a3e3eb 100644 --- a/src/regex.js +++ b/src/regex.js @@ -1,61 +1,61 @@ // Storage for regular expressions SVG.regex = { // Parse unit value - numberAndUnit: /^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i + numberAndUnit: /^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i, // Parse hex value -, hex: /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i + hex: /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i, // Parse rgb value -, rgb: /rgb\((\d+),(\d+),(\d+)\)/ + rgb: /rgb\((\d+),(\d+),(\d+)\)/, // Parse reference id -, reference: /#([a-z0-9\-_]+)/i + reference: /#([a-z0-9\-_]+)/i, // splits a transformation chain -, transforms: /\)\s*,?\s*/ + transforms: /\)\s*,?\s*/, // Whitespace -, whitespace: /\s/g + whitespace: /\s/g, // Test hex value -, isHex: /^#[a-f0-9]{3,6}$/i + isHex: /^#[a-f0-9]{3,6}$/i, // Test rgb value -, isRgb: /^rgb\(/ + isRgb: /^rgb\(/, // Test css declaration -, isCss: /[^:]+:[^;]+;?/ + isCss: /[^:]+:[^;]+;?/, // Test for blank string -, isBlank: /^(\s+)?$/ + isBlank: /^(\s+)?$/, // Test for numeric string -, isNumber: /^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i + isNumber: /^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, // Test for percent value -, isPercent: /^-?[\d\.]+%$/ + isPercent: /^-?[\d.]+%$/, // Test for image url -, isImage: /\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i + isImage: /\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i, // split at whitespace and comma -, delimiter: /[\s,]+/ + delimiter: /[\s,]+/, // The following regex are used to parse the d attribute of a path // Matches all hyphens which are not after an exponent -, hyphen: /([^e])\-/gi + hyphen: /([^e])-/gi, // Replaces and tests for all path letters -, pathLetters: /[MLHVCSQTAZ]/gi + pathLetters: /[MLHVCSQTAZ]/gi, // yes we need this one, too -, isPathLetter: /[MLHVCSQTAZ]/i + isPathLetter: /[MLHVCSQTAZ]/i, // matches 0.154.23.45 -, numbersWithDots: /((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi + numbersWithDots: /((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi, // matches . -, dots: /\./g + dots: /\./g } |