Back to Explore

wooorm/collapse-white-space

GitHub
1 watchersOpen source

Last release: 10/27/2021

This small JavaScript and HTML-oriented package collapses multiple whitespace characters in a string into a single character (defaulting to a space). It can optionally trim leading and trailing whitespace, and it can preserve line endings when collapsing. Useful for normalizing whitespace in HTML or JavaScript text.

Project status

  • The repo shows an upstream push most recently on 2022-11-16, but the last documented code-version update in the provided history is 2.1.0 (2021-10-27), which suggests low active development at the moment.
  • Update cadence appears sporadic, with major changes in 2.0.0 (2021-03-08) and 2.1.0 (2021-10-27), then no further versioned updates shown after 2.1.0.

AI summary generated Today

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • 2.1.0

    10/27/2021

    Version 2.1.0 extends collapse-white-space with new behaviors for trimming, preserving line endings, and supporting an HTML-specific whitespace mode. The release notes mention these additions, but the code also changes the public function signature to accept a new second parameter that can be an options object or a style string.

    Features
  • 2.0.0

    3/8/2021

    Release 2.0.0 documents a move to ESM and addition of JSDoc based types. The code diff, however, shows a larger public API change: the package is now ESM-only and the main export function name and export style have changed. It also replaces the build pipeline with a TypeScript declaration-only generation step.

    BreakingFeatures
  • 1.0.6

    1/23/2020

    Release 1.0.6 primarily updates repository metadata and developer-facing documentation. The code diff does not show any runtime implementation changes to the collapse-white-space functionality.

  • 1.0.5

    5/6/2019

    Release 1.0.5 primarily updates documentation and metadata, adding additional badges to the README, renaming LICENSE to license, and switching exposed URLs from HTTP to HTTPS. However, the code diff also changes the build and toolchain setup (devDependencies, bundling/minification scripts, and CI/developer config) beyond what the release notes mention.

  • 1.0.4

    4/14/2018

    Release 1.0.4 is described as a README refactor and a general code-style refactor. The runtime implementation of the exported `collapse` function appears unchanged, but the release includes notable tooling and CI/build changes in `package.json` and `.travis.yml`.

  • 1.0.0

    6/25/2017

    Release 1.0.0 was published on 2017-06-25, but the provided release notes contain no actionable information beyond a generic emoji. There are no described new features, bug fixes, security updates, or migration steps, so developers should review the corresponding code changes and API surface themselves before upgrading.

  • 1.0.3

    6/25/2017

    Release 1.0.3 is presented as documentation cleanup, including README refactoring and removal of inline documentation and history.md. The runtime implementation in index.js appears unchanged (still collapses whitespace by replacing \s+ with a single space), but the diff also shows build, lint/test tooling, and CI configuration changes not mentioned in the release notes.

  • 1.0.2

    7/23/2016

    Release 1.0.2 only updates project metadata and documentation. The release notes state it fixes readme.md, and the diff shows only version/changelog adjustments plus a documentation section removal.

  • 1.0.1

    7/23/2016

    Release 1.0.1 is described only as a module rewrite, and the diff shows a broad project-tooling modernization plus some documentation churn. The only runtime code change is within `index.js`, where the `collapse(value)` implementation is simplified while keeping the same exported function.