Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Commit

Permalink
Simplify regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
scf2k committed Nov 21, 2014
1 parent b24fe68 commit 89a1665
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/browser/client-scripts/gemini.js
Expand Up @@ -126,7 +126,7 @@
}

function parseBoxShadow(value) {
var regex = /([-+]?\d*\.?\d+)px (?:([-+]?\d*\.?\d+)px)? (?:([-+]?\d*\.?\d+)px)? (?:([-+]?\d*\.?\d+)px)?/,
var regex = /[-+]?\d*\.?\d+px/g,
values = value.split(','),
results = [],
match;
Expand All @@ -135,10 +135,10 @@
value = values[value];
if ((match = value.match(regex))) {
results.push({
offsetX: +match[1],
offsetY: +match[2] || 0,
blurRadius: +match[3] || 0,
spreadRadius: +match[4] || 0,
offsetX: parseFloat(match[0]),
offsetY: parseFloat(match[1]) || 0,
blurRadius: parseFloat(match[2]) || 0,
spreadRadius: parseFloat(match[3]) || 0,
inset: value.indexOf('inset') !== -1
});
}
Expand Down

0 comments on commit 89a1665

Please sign in to comment.