From 8a756ba108925108949a5fcb329a4fde1ea4c0d4 Mon Sep 17 00:00:00 2001 From: martind2000 Date: Sun, 10 Apr 2016 10:33:28 +0100 Subject: [PATCH] Moved the main file into lib, v0.0.3 --- index.js => lib/md-utils.js | 18 ++++++++---------- package.json | 11 +++++++++-- 2 files changed, 17 insertions(+), 12 deletions(-) rename index.js => lib/md-utils.js (84%) diff --git a/index.js b/lib/md-utils.js similarity index 84% rename from index.js rename to lib/md-utils.js index bbced15..d50d114 100644 --- a/index.js +++ b/lib/md-utils.js @@ -1,6 +1,5 @@ -'use strict'; /** - * + * * * User: Martin Donnelly * Date: 2016-03-15 * Time: 15:08 @@ -46,7 +45,7 @@ module.exports = { } return rObj; - }, sanitiseObj: function(obj, methods) { + }, sanitiseObj(obj, methods) { for (var item in methods) { if (obj.hasOwnProperty(item)) { if (typeof obj[item] === 'string') { @@ -61,9 +60,9 @@ module.exports = { var s = []; var SCRIPT_REGEX = /)<[^<]*)*<\/script>/gi; - var CHECKCHARS = "0123456789" + // Numeric - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + // Alphabetic - "abcdefghijklmnopqrstuvwxyz-'" + (_loose === false ? '' : "_,.!~*()@:+/\\"); + var CHECKCHARS = '0123456789' + // Numeric + 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + // Alphabetic + "abcdefghijklmnopqrstuvwxyz-'" + (_loose === false ? '' : "_,.!~*()@:+/\\");// jscs:ignore validateQuoteMarks if (typeof text === 'string') { while (SCRIPT_REGEX.test(text)) { @@ -74,18 +73,17 @@ module.exports = { ch = text.charAt(i); if (ch === ' ') { s.push(' '); - } - else if (ch.charCodeAt(0) < 255 && CHECKCHARS.indexOf(ch) !== -1) { + } else if (ch.charCodeAt(0) < 255 && CHECKCHARS.indexOf(ch) !== -1) { s.push(ch); } } text = s.join('').trim(); } return text; - }, cloneTrim: function(from) { + }, cloneTrim(from) { var _out = {}; if (typeof from === 'object' && Object.keys(from).length !== 0) { - // copy the required fields into the data object.. + // Copy the required fields into the data object.. for (var key in from) { if (from.hasOwnProperty(key)) { diff --git a/package.json b/package.json index cb80d97..1f6885e 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,18 @@ { "name": "md-utils", - "version": "0.0.2", + "version": "0.0.3", "description": "A suite of useful misc utils", - "main": "index.js", + "repository": { + "type": "git", + "url": "http://gitlab.silvrtree.co.uk/martind2000/md-utils.git" + }, + "main": "lib/md-utils.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, + "dependencies": {}, + "devDependencies": { + }, "author": "Martin Donnelly ", "license": "ISC" }