@corefunc/corefunc
    Preparing search index...

    @corefunc/corefunc

    CoreFunc

    CoreFunc

    NPM Version NPM Downloads CodeFactor


    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 โฌ…๏ธ

    • ๐Ÿ” Iterate, check, sort, and search through primitives, arrays, and objects
    • ๐Ÿงฉ Manipulate, convert, and generate data with simple, predictable utilities
    • ๐Ÿชถ 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
    • โœ‚๏ธ Loosely coupled functions - copy what you need, skip the rest
    • ๐ŸŒณ Tree-shaking by default - no dead-code hunting or bundler tricks

    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].length instead of text.length to count characters in string. This a length of array."

    Me: "But text.length returns 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: ๐Ÿคฆโ€โ™‚๏ธ