From fde12164e6c020eb1c9e10e9dba0c3df0734b40f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Ma=C5=82ecki?= Date: Thu, 13 Oct 2011 23:35:33 +0200 Subject: [PATCH] [refactor minor] Use `JSON.parse` when getting version --- lib/vows.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/vows.js b/lib/vows.js index bd54e18..a446499 100644 --- a/lib/vows.js +++ b/lib/vows.js @@ -187,5 +187,6 @@ vows.describe = function (subject) { }; -vows.version = require('fs').readFileSync(path.join(__dirname, '..', 'package.json')) - .toString().match(/"version"\s*:\s*"([\d.]+)"/)[1]; +vows.version = JSON.parse(require('fs') + .readFileSync(path.join(__dirname, '..', 'package.json'))) + .version