Moved the main file into lib, v0.0.3

This commit is contained in:
martind2000 2016-04-10 10:33:28 +01:00
parent a87317b5c3
commit 8a756ba108
2 changed files with 17 additions and 12 deletions

View File

@ -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\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/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)) {

View File

@ -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 <martind2000@gmail.com>",
"license": "ISC"
}