From fd5a91399f27f559178974fed9490b7fa1daea37 Mon Sep 17 00:00:00 2001 From: Horcrux Date: Wed, 8 Jun 2016 21:21:01 +0800 Subject: [PATCH] fix #51 fix #51 --- Example/examples/Path.js | 4 ++++ lib/SerializablePath.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Example/examples/Path.js b/Example/examples/Path.js index 906742b6..b85f79ab 100644 --- a/Example/examples/Path.js +++ b/Example/examples/Path.js @@ -21,6 +21,10 @@ class PathExample extends Component{ /> + ; } } diff --git a/lib/SerializablePath.js b/lib/SerializablePath.js index b69cc518..e0e9904b 100644 --- a/lib/SerializablePath.js +++ b/lib/SerializablePath.js @@ -19,7 +19,7 @@ export default class SerializablePath { /* parser */ push = () => { let p = Array.prototype.join.call(arguments, ' ') - .replace(/(\.[\d]+)(\-?\.)/ig, '$1,$2') //-.3-.575 => -.3,-.575 + .replace(/(\.\d+)(?=\-?\.)/ig, '$1,') //-.3-.575 => -.3,-.575 .match(/[a-df-z]|[\-+]?(?:[\d\.]e[\-+]?|[^\s\-+,a-z])+/ig); if (!p) {