From 70db28744e341f1460883964cf7fc6480067a279 Mon Sep 17 00:00:00 2001 From: Joseph Cheung Date: Fri, 23 Nov 2018 10:45:48 +0800 Subject: [PATCH 1/2] finished --- lib/meta.js | 1 + lib/quantifier.js | 1 + lib/split.js | 1 + 3 files changed, 3 insertions(+) diff --git a/lib/meta.js b/lib/meta.js index a08ee57..a069156 100644 --- a/lib/meta.js +++ b/lib/meta.js @@ -1,3 +1,4 @@ module.exports = function (str) { // TODO + return /\.$/g.test(str) } \ No newline at end of file diff --git a/lib/quantifier.js b/lib/quantifier.js index a08ee57..eced88e 100644 --- a/lib/quantifier.js +++ b/lib/quantifier.js @@ -1,3 +1,4 @@ module.exports = function (str) { // TODO + return /^\d+\.jpe?g$/g.test(str) } \ No newline at end of file diff --git a/lib/split.js b/lib/split.js index a08ee57..62a430b 100644 --- a/lib/split.js +++ b/lib/split.js @@ -1,3 +1,4 @@ module.exports = function (str) { // TODO + return str.replace(/\s/g, '').split(',') } \ No newline at end of file From efa026f38373fa45592bb4cf1b4cfc28305f1041 Mon Sep 17 00:00:00 2001 From: Joseph Cheung Date: Fri, 23 Nov 2018 11:03:44 +0800 Subject: [PATCH 2/2] another approach --- lib/split.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/split.js b/lib/split.js index 62a430b..86a85b4 100644 --- a/lib/split.js +++ b/lib/split.js @@ -1,4 +1,5 @@ module.exports = function (str) { // TODO - return str.replace(/\s/g, '').split(',') + // return str.replace(/\s/g, '').split(',') + return str.split(/\s*,\s*/g) } \ No newline at end of file