@bikiran/utils 2.2.7 → 2.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -15,6 +15,8 @@ export { default as InformationTooltip } from "./components/information-tooltip/
15
15
  export { default as CopyWrapper } from "./components/copy-wrapper/CopyWrapper";
16
16
  export { GetDate, GetTime, timeAgo, timeRemaining, getTimestamp, } from "./lib/utils/date";
17
17
  export { default as capitalizeFirstLetter } from "./lib/utils/capitalizeFirstLetter";
18
+ export { default as capitalizeSentence } from "./lib/utils/capitalizeSentence";
19
+ export { default as scrollToSection } from "./lib/utils/scrollToSection";
18
20
  export { cn } from "./lib/utils/cn";
19
21
  export { default as Copy } from "./lib/utils/Copy";
20
22
  export { default as Cookie } from "./lib/utils/Cookie";
package/dist/index.js CHANGED
@@ -15,6 +15,8 @@ export { default as InformationTooltip } from "./components/information-tooltip/
15
15
  export { default as CopyWrapper } from "./components/copy-wrapper/CopyWrapper";
16
16
  export { GetDate, GetTime, timeAgo, timeRemaining, getTimestamp, } from "./lib/utils/date";
17
17
  export { default as capitalizeFirstLetter } from "./lib/utils/capitalizeFirstLetter";
18
+ export { default as capitalizeSentence } from "./lib/utils/capitalizeSentence";
19
+ export { default as scrollToSection } from "./lib/utils/scrollToSection";
18
20
  export { cn } from "./lib/utils/cn";
19
21
  export { default as Copy } from "./lib/utils/Copy";
20
22
  export { default as Cookie } from "./lib/utils/Cookie";
package/dist/index.ts CHANGED
@@ -21,6 +21,8 @@ export {
21
21
  getTimestamp,
22
22
  } from "./lib/utils/date";
23
23
  export { default as capitalizeFirstLetter } from "./lib/utils/capitalizeFirstLetter";
24
+ export { default as capitalizeSentence } from "./lib/utils/capitalizeSentence";
25
+ export { default as scrollToSection } from "./lib/utils/scrollToSection";
24
26
  export { cn } from "./lib/utils/cn";
25
27
  export { default as Copy } from "./lib/utils/Copy";
26
28
  export { default as Cookie } from "./lib/utils/Cookie";
@@ -0,0 +1,2 @@
1
+ declare const capitalizeSentence: (sentence: string | null | undefined) => string;
2
+ export default capitalizeSentence;
@@ -0,0 +1,7 @@
1
+ const capitalizeSentence = (sentence) => {
2
+ return (sentence || "")
3
+ .split(" ")
4
+ .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
5
+ .join(" ");
6
+ };
7
+ export default capitalizeSentence;
@@ -0,0 +1,11 @@
1
+ const capitalizeSentence = (sentence: string | null | undefined): string => {
2
+ return (sentence || "")
3
+ .split(" ")
4
+ .map(
5
+ (word: string) =>
6
+ word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()
7
+ )
8
+ .join(" ");
9
+ };
10
+
11
+ export default capitalizeSentence;
@@ -0,0 +1,2 @@
1
+ declare const scrollToSection: (id: string) => void;
2
+ export default scrollToSection;
@@ -0,0 +1,11 @@
1
+ const scrollToSection = (id) => {
2
+ const element = document.getElementById(id);
3
+ if (element) {
4
+ element.scrollIntoView({
5
+ block: "start",
6
+ behavior: "smooth",
7
+ });
8
+ window.location.hash = `#${id}`;
9
+ }
10
+ };
11
+ export default scrollToSection;
@@ -0,0 +1,12 @@
1
+ const scrollToSection = (id: string) => {
2
+ const element = document.getElementById(id);
3
+ if (element) {
4
+ element.scrollIntoView({
5
+ block: "start",
6
+ behavior: "smooth",
7
+ });
8
+ window.location.hash = `#${id}`;
9
+ }
10
+ };
11
+
12
+ export default scrollToSection;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikiran/utils",
3
- "version": "2.2.7",
3
+ "version": "2.2.8",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [