
CoreFunc is a lightweight collection of core utility functions for everyday tasks, ranging from simple one-liners to more advanced helpers. Designed to be predictable, composable, and dependency-free.
โก๏ธ CoreFunc.GitHub.io Documentation โฌ ๏ธ
import { arraySortBubble } from "@corefunc/corefunc/array/sort/bubble";
arraySortBubble([3, 1, 2]); // [1, 2, 3]
import { arraySortBubble } from "@corefunc/corefunc/array/sort/bubble.js";
arraySortBubble([3, 1, 2]); // [1, 2, 3]
import { checkIsSame } from "@corefunc/corefunc/check/is-same.js";
(NaN === NaN) // false
checkIsSame(NaN, NaN); // true
(0 === -0) // true
checkIsSame(0, -0); // false
import { dateIsLeapYear } from "@corefunc/corefunc/date/is-leap-year.js";
dateIsLeapYear(2024); // true
import { generateInteger } from "@corefunc/corefunc/generate/integer.js";
generateInteger(1, 100);
import { textCaseKebab } from "@corefunc/corefunc/text/case/kebab.js";
textCaseKebab("helloWorld"); // hello-world
import { stringGetCount } from "@corefunc/corefunc/string/get/count.js";
stringGetCount("abc"); // 3
stringGetCount("๐จโ๐ฉโ๐งโ๐ฆ"); // 1
AI Reviewer: "Answer is not accepted. You are using
[...text].lengthinstead oftext.lengthto count characters in string. This a length of array."Me: "But
text.lengthreturns 7 for the '๐จโ๐ฉโ๐งโ๐ฆ' emoji because it counts UTF-16 code units, not human-perceived characters."AI Reviewer: "I understand. However, answer is not accepted. You failed the test."
Me: ๐คฆโโ๏ธ