-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
120 lines (118 loc) · 3.8 KB
/
index.html
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<script src="lib/js/tinytest.js"></script>
<script src="./rademe.js"></script>
<title>Testing</title>
</head>
<body>
<textarea
name=""
id="text"
cols="30"
rows="10"
onkeyup="rademe.countAndLimitCharacters(this, 20)"
></textarea>
<div id="time"></div>
<span id="count"></span>
<script>
console.log(rademe);
rademe.html.loadAssets("lib/css", "style.css");
</script>
<script>
let my_id = rademe.html.id("text");
tests({
"Count words": function () {
eq(6, rademe.countWord("carlos is very humble and intelligent"));
},
"Check if it is an array": function () {
eq(true, rademe.isArray([1, 3, 4, 5]));
eq(false, rademe.isArray({}));
},
"check if it is an object": function () {
eq(true, rademe.isObject({}));
},
"loop through data types ": function () {
// eq('humble tr' ,Jsrademes.loop({tr: "humble"}, function(d, k) {
// console.log(d, k)
// }));
eq(
"humble",
rademe.loop(["humble"], function (element) {
console.log(element);
})
);
},
"Loop through a string": function () {
eq(3, rademe.countWord("Car los nah"));
},
"Check if a string has space": function () {
eq(true, rademe.stringHasSpace("Carlosnah "));
},
"Factorial for 7": function () {
eq("5040", rademe.math.fn(7));
eq("120", rademe.math.fn(5));
},
"Permutation of pn(52, 5)": function () {
eq("311875200", rademe.math.pn(52, 5));
},
"Check if two arrays are equal": function () {
tests({
"check for mismatch": function () {
eq(false, rademe.isArrayEqual([1, 2, 3, 4], [1, 2, 5, 4]));
eq(true, rademe.isArrayEqual([1, 2, 3, 4], [1, 2, 3, 4]));
},
});
tests({
"check if it handles empty arrays": function () {
eq(true, rademe.isArrayEqual([], []));
eq(true, rademe.isArrayEqual([""], [""]));
},
});
},
// "Check length of an object": function() {
// eq(4, rademe.getObjLength({name: "john", last: "miller", digit: 3, room: 345}));
// },
// "Check if an object is equal": function() {
// eq(true, rademe.isObjectEqual({name: ["peter", "john"], last: "miller", digit: 3, room: 345}, {name: ["john", "peter"], last: "miller", digit: 3, room: 345}));
// }
});
rademe.math.lcm([2, 3, 8, 6]);
console.log(
"Array is Equal: ",
rademe.isArrayEqual([{ name: "John" }], [{ name: "John" }])
);
rademe.form.element(3, {
name: {
placeholder: "Enter fullname",
label: "Fullname",
type: "text",
},
email: {
placeholder: "Enter email",
type: "email",
label: "Email",
},
phone: {
placeholder: "Enter Phone number",
label: "Phone number",
type: "tel",
},
submit: {
type: "submit",
value: "Submit"
}
});
let me = "jlsj ;ls ;lk f kl;";
console.log("Jump: ", rademe.password.clean(me));
console.log("me: ", rademe.password.check_pass(rademe.password.gen(8)));
//console.log(rademe.date.clock())
// const dateDiv = rademe.html.id("time");
// const h1 = rademe.html.elt("h1");
// rademe.date.clock(dateDiv);
</script>
</body>
</html>