Skip to content

js-utils-kit@5.0.0

Choose a tag to compare

@github-actions github-actions released this 02 May 00:19
· 71 commits to main since this release
2727c8a

Major Changes

  • #167 42bed98 Thanks @teneplaysofficial! - Enforce stricter case validation rules via shared regex package

    Changes

    • CAMEL_CASE_REGEX now requires at least one uppercase transition
      • Previously valid: "hello"
      • Now invalid: "hello"
      • Still valid: "helloWorld"
    • PASCAL_CASE_REGEX now requires at least two segments
      • Previously valid: "Hello"
      • Now invalid: "Hello"
      • Still valid: "HelloWorld"
    • Migrated to @js-utils-kit/regex for all regex patterns
    • Enforced stricter rules for:
      • camelCase
      • PascalCase
      • snake_case
      • kebab-case

    Affected exports

    • CAMEL_CASE_REGEX
    • PASCAL_CASE_REGEX
    • isCamelCase
    • isPascalCase

    Impact

    • These changes modify validation behavior and will cause some previously valid inputs to fail.
    • Downstream consumers must audit usages of:
      • isCamelCase
      • isPascalCase
      • direct usage of the regex constants
  • #174 004efdb Thanks @teneplaysofficial! - Improve and Relocate CommonJS Detection

    The previous hasCommonJSFilename utility has been removed from @js-utils-kit/fs and replaced with a more robust isCommonJS helper in @js-utils-kit/env. Unlike the old implementation, which only checked for __filename, the new version uses multiple runtime signals (module.exports, require, exports, __filename, and __dirname) to provide a more reliable indication of a CommonJS environment. Update your imports to use isCommonJS from @js-utils-kit/env.

    - import { hasCommonJSFilename } from '@js-utils-kit/fs';
    + import { isCommonJS } from '@js-utils-kit/env';
    
    - if (hasCommonJSFilename) {
    + if (isCommonJS) {
       console.log('Running in CommonJS environment');
     } else {
       console.log('Running in ESM environment');
     }
  • #174 004efdb Thanks @teneplaysofficial! - Remove deprecated mergeObj function and replace it with deepMerge.

Minor Changes

Patch Changes

  • #177 d6af860 Thanks @teneplaysofficial! - Refactor detectPM to use name != null for consistent null/undefined handling in conditional spreading.

  • #174 004efdb Thanks @teneplaysofficial! - Simplify Email Validation Using Centralized Regex

    • Replaces manual email parsing and validation logic with a single regex-based approach using EMAIL_REGEX. This reduces complexity and improves maintainability by delegating validation responsibility to a centralized regex.
    • Updates Typedoc to reflect the new behavior:
      • Removes explicit local and domain length enforcement from the function
      • Clarifies that validation is fully handled by the regex
      • Adds support and documentation for custom regex overrides
    • No breaking changes, but validation behavior may differ slightly due to removal of manual checks.
  • Updated dependencies [42bed98, 004efdb, d6af860, 004efdb, 004efdb, 42bed98]:

    • @js-utils-kit/core@5.0.0