Skip to content

Commit 5971974

Browse files
committed
adding npm keywords and copy (beta) function
1 parent bcb27eb commit 5971974

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+188
-90
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@ ehthumbs_vista.db
1818
*.msi
1919
*.msix
2020
*.msm
21-
*.msp
21+
*.msp
22+
23+
# Small Unimportant files
24+
futureFunctions.txt

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
MIT License
22

33
Copyright (c) 2022 Functionalty.js
4-
Copyright (c) 2022 Ali-Eldeba
4+
Copyright (c) 2022 alieldeba
55

66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal

dist/index.html

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8">
5-
<title>Title</title>
6-
<script type="module" crossorigin src="/functionality.min.js"></script>
7-
</head>
8-
<body>
9-
10-
11-
12-
</body>
13-
</html>
3+
<head>
4+
<meta charset="UTF-8" />
5+
<title>functionality.js</title>
6+
</head>
7+
<body>
8+
</body>
9+
<script type="module" src="/functionality.min.js"></script>
10+
</html>

futureFunctions.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
- Arrays
2-
- zip
3-
- Strings
4-
- Numbers
5-
- Numbers
6-
- randoms
1+
- zip

lib/main.d.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import randomNumber from "./randoms/randomNumber";
1616
import removeDuplicate from "./arrays/removeDuplicate";
1717
import reverseString from "./strings/reverseString";
1818
import reverseNumber from "./numbers/reverseNumber";
19+
import addCommas from "./numbers/addCommas";
1920
import shuffle from "./arrays/shuffle";
2021
import randomString from "./randoms/randomString";
2122
import randomColor from "./randoms/randomColor";
@@ -34,6 +35,8 @@ import getDays from "./user/getDays";
3435
import getHours from "./user/getHours";
3536
import getMinutes from "./user/getMinutes";
3637
import getSeconds from "./user/getSeconds";
38+
import getBirthday from "./user/getBirthday";
39+
import copy from "./user/copy";
3740
import select from "./dom/select";
3841
declare const functionality: {
3942
sumOfArray: typeof sumOfArray;
@@ -51,6 +54,7 @@ declare const functionality: {
5154
randomElementFrom: typeof randomElementFrom;
5255
randomHex: typeof randomHex;
5356
randomNumber: typeof randomNumber;
57+
addCommas: typeof addCommas;
5458
removeDuplicate: typeof removeDuplicate;
5559
reverseString: typeof reverseString;
5660
reverseNumber: typeof reverseNumber;
@@ -70,8 +74,10 @@ declare const functionality: {
7074
getWeeks: typeof getWeeks;
7175
getDays: typeof getDays;
7276
getHours: typeof getHours;
73-
getSeconds: typeof getSeconds;
7477
getMinutes: typeof getMinutes;
78+
getSeconds: typeof getSeconds;
79+
getBirthday: typeof getBirthday;
80+
copy: typeof copy;
7581
select: typeof select;
7682
};
7783
declare global {

lib/main.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import randomNumber from "./randoms/randomNumber";
1616
import removeDuplicate from "./arrays/removeDuplicate";
1717
import reverseString from "./strings/reverseString";
1818
import reverseNumber from "./numbers/reverseNumber";
19+
import addCommas from "./numbers/addCommas";
1920
import shuffle from "./arrays/shuffle";
2021
import randomString from "./randoms/randomString";
2122
import randomColor from "./randoms/randomColor";
@@ -36,6 +37,8 @@ import getDays from "./user/getDays";
3637
import getHours from "./user/getHours";
3738
import getMinutes from "./user/getMinutes";
3839
import getSeconds from "./user/getSeconds";
40+
import getBirthday from "./user/getBirthday";
41+
import copy from "./user/copy";
3942
import select from "./dom/select";
4043
const functionality = {
4144
sumOfArray,
@@ -53,6 +56,7 @@ const functionality = {
5356
randomElementFrom,
5457
randomHex,
5558
randomNumber,
59+
addCommas,
5660
removeDuplicate,
5761
reverseString,
5862
reverseNumber,
@@ -72,8 +76,10 @@ const functionality = {
7276
getWeeks,
7377
getDays,
7478
getHours,
75-
getSeconds,
7679
getMinutes,
80+
getSeconds,
81+
getBirthday,
82+
copy,
7783
select,
7884
};
7985
window.functionality = functionality;

lib/user/copy.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default function copy(text: string): void;

lib/user/copy.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default function copy(text) {
2+
navigator.clipboard.writeText(text).then(function () {
3+
console.log("Async: Copying to clipboard was successful!");
4+
}, function (err) {
5+
console.error("Async: Could not copy text: ", err);
6+
});
7+
}

lib/user/getBirthDay.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
* @param {number} year
55
* @returns {number}
66
*/
7-
export default function getBirthDay(year: number): number;
7+
export default function getBirthday(year: number): number;

lib/user/getBirthDay.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @param {number} year
55
* @returns {number}
66
*/
7-
export default function getBirthDay(year) {
7+
export default function getBirthday(year) {
88
var currentDate = new Date();
99
var currentYear = currentDate.getFullYear();
1010
return currentYear - year;

0 commit comments

Comments
 (0)