Skip to content
This repository was archived by the owner on Jan 14, 2022. It is now read-only.

Commit 3a56918

Browse files
author
Lucas Rojas
committed
Clean comments in utils.js
1 parent a4af4f3 commit 3a56918

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

lib/utils.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ function parseJSON (data) {
1414
}
1515
}
1616

17-
// Extracted from: http://stackoverflow.com/questions/5999998/how-can-i-check-if-a-javascript-variable-is-function-type
1817
function isFunction (data) {
1918
var getType = {};
2019
return data && getType.toString.call(data) === '[object Function]';
@@ -39,30 +38,18 @@ function newGuid () {
3938
s4() + '-' + s4() + s4() + s4();
4039
}
4140

42-
// This function sanitizes the name to only allow the following: ([A-Za-z][A-Za-z0-9]*)(\.[A-Za-z][A-Za-z0-9]*)*
4341
function sanitizeName (name) {
4442
var sanitizedName = name;
4543

46-
// Remove all invalid characters
4744
sanitizedName = sanitizedName.replace(/[^A-Za-z0-9\.]/g, '');
4845

4946
var currentLength;
5047
do {
5148
currentLength = sanitizedName.length;
52-
53-
// If the name starts with a number, remove the number
5449
sanitizedName = sanitizedName.replace(/^[0-9]/, '');
55-
56-
// If the name starts with a dot, remove the dot
5750
sanitizedName = sanitizedName.replace(/^\./, '');
58-
59-
// If there is a number right after a dot, remove the number
6051
sanitizedName = sanitizedName.replace(/\.[0-9]/g, '.');
61-
62-
// If there are two consecutive dots, remove one dot
6352
sanitizedName = sanitizedName.replace(/\.\./g, '.');
64-
65-
// if the name ends with a dot, remove the dot
6653
sanitizedName = sanitizedName.replace(/\.$/, '');
6754
}
6855
while (currentLength > sanitizedName.length);
@@ -74,7 +61,6 @@ function sanitizeName (name) {
7461
return sanitizedName;
7562
}
7663

77-
// Function to remove duplicates from any array
7864
function removeDupesInPlace (arr, comparator) {
7965
for (var i = 0; i < arr.length; i++) {
8066
for (var j = arr.length - 1; j > i; j--) {

0 commit comments

Comments
 (0)