-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanualTest.js
57 lines (39 loc) · 2.69 KB
/
manualTest.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
const arrayUtils = require('./lib/arrayUtils');
let resultDiff = arrayUtils.differenceBetweenTwoArrays(['1','2','3'],['2','3'])
// let resultDiff = array.differenceBetweenTwoArrays(['1','2','3'],'5')
// console.log('result differenceBetweenTwoArrays', resultDiff)
let resultCount = arrayUtils.countofElements(['Lemon', 'Orange', 'Strawberry', 'Strawberry', 'Orange', 'Banana', 'Strawberry','Banana']);
// let resultCount = array.countofElements('5');
//console.log('result countofElements ', resultCount)
let resultMax = arrayUtils.getMaxElementInArray([2, 3, 4.1, 4.2 , 7, 123.456, 'test1', 'test2', false]);
//console.log('result getMaxElementInArray ', resultMax);
let resultMin = arrayUtils.getMinElementInArray([2, 3, 4.1, 4.2 , 7, 123, 'test1', 'test2', false]);
//console.log('result getMinElementInArray ', resultMin);
let resultSum = arrayUtils.sumOfElementsInArray([1,2,3,'test']);
// console.log('result sumOfElementsInArray',resultSum);
let resultSelect = arrayUtils.selectRandomFromArray(['test',2,true,[123]]);
// console.log('result selectRandomFromArray ',resultSelect);
//------------------------------------------------------
const stringUtils = require('./lib/stringUtils');
let resultRevertString = stringUtils.revertString('abcd');
//console.log('result revertString ', resultRevertString);
let resultExcerpt = stringUtils.excerpt('lorem ipsum dolor sit amet', 3);
//console.log('result resultExcerpt ', resultExcerpt);
// let resultHightligtText = stringUtils.highlightText('My lorem ipsum text', ['My', 'lorem'],'p');
let resultHightligtText = stringUtils.highlightText('lorem ipsum dolor sit amet', ['ipsum','sit'],'p');
// console.log('result resultHightligtText ', resultHightligtText);
// let resultHightligtText = stringUtils.highlightText('My lorem ipsum text', ['My', 'lorem'],'p');
let resultUnHightligtText = stringUtils.unHighlightText('<p class="highlight">lorem</p> ipsum dolor sit amet', 'p');
// console.log('result resultUnHightligtText ', resultUnHightligtText);
let resultCamelize = stringUtils.camelize('Lorem ipsum dolor sit amet');
// console.log('result resultCamelize ', resultCamelize);
//---------------------------------------------------------
const dateUtils = require('./lib/dateUtils');
let resultIsValidDate = dateUtils.isValidDate('31-11-2015','dd-mm-yy');
// let resultIsValidDate = dateUtils.isValidDate('05-11-2015','dd-mm-yy');
// console.log('result resultIsValidDate ' , resultIsValidDate);
//---------------------------------------------------------
const numberUtils = require('./lib/numberUtils');
let resultAddComas = numberUtils.addComas(1222.23,',');
console.log('result resultAddComas ' , resultAddComas);
//---------------------------------------------------------