@corefunc/corefunc
v1.0.0
Published
Collection of utilities
Maintainers
Readme

CoreFunc
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 ⬅️
🎯 Purpose
- 🔍 Iterate, check, sort, and search through primitives, arrays, and objects
- 🧩 Manipulate, convert, and generate data with simple, predictable utilities
📦 What
- 🪶 A small, dependency-free utility library for everyday data work
- ⚡ Built for ECMAScript Modules (ESM) with first-class TypeScript support
- 📄 .js and .ts files included - use whatever fits your workflow
- 🛡️ No prototype extensions - zero risk of prototype pollution
- 🚫 No dependencies
💡 Why
- ✂️ Loosely coupled functions - copy what you need, skip the rest
- 🌳 Tree-shaking by default - no dead-code hunting or bundler tricks
TypeScript
import { arraySortBubble } from "@corefunc/corefunc/array/sort/bubble";
arraySortBubble([3, 1, 2]); // [1, 2, 3]ECMAScript Module
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); // falseimport { dateIsLeapYear } from "@corefunc/corefunc/date/is-leap-year.js";
dateIsLeapYear(2024); // trueimport { generateInteger } from "@corefunc/corefunc/generate/integer.js";
generateInteger(1, 100);import { textCaseKebab } from "@corefunc/corefunc/text/case/kebab.js";
textCaseKebab("helloWorld"); // hello-worldimport { stringGetCount } from "@corefunc/corefunc/string/get/count.js";
stringGetCount("abc"); // 3
stringGetCount("👨👩👧👦"); // 1AI Reviewer: "Answer is not accepted. You are using
[...text].lengthinstead oftext.lengthto count characters in a string. This is the length of an 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, the answer is not accepted. You failed the test."
Me: 🤦♂️
