Back to Explore

es-shims/Array.prototype.flat

GitHub
2 watchersOpen source

Last release:

This is an ES2019 spec-compliant `Array.prototype.flat` shim or polyfill for flattening nested arrays, implemented to work in environments as old as ES3. It provides a main export that takes the target array as the first argument and can also supply a `shim()` that replaces or matches `Array.prototype.flat` behavior when needed.

Project status

  • The source appears maintained, with the most recent tagged update v1.3.3 dated 2024-12-15, and an additional upstream push on 2025-12-30, though detailed release notes are not provided for recent updates.
  • Update cadence is sporadic rather than continuous, spanning years between earlier updates (for example, v1.2.x in 2020-2021, v1.3.2 in 2023, v1.3.3 in late 2024), with no evidence of frequent ongoing updates.

AI summary generated

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

Recent updates

  • v1.3.3

    Release v1.3.3 contains CI workflow adjustments for Node version ranges, plus dependency and implementation-library bumps. There are no release notes provided by the publisher, so the changelog and code diff are the only signals for what actually changed.

  • v1.3.2

    Release v1.3.2 does not include any publisher-provided release notes. The code changes are limited to dependency updates and switching the internal `es-abstract` implementation year from 2022 to 2023 for core helper functions used by `flat`.

  • v1.3.1

    This release is version v1.3.1, published on 2022-11-03. No release notes were provided by the publisher, so the specific code changes, potential API impact, and fixes are not documented here.

  • v1.3.0

    The v1.3.0 release notes provided in the prompt are missing (none were supplied). The code changes indicate this version primarily updates the Array.prototype.flat polyfill shim to also register `flat` in `Symbol.unscopables`, and it updates various tooling and CI workflow configuration.

    Features
  • v1.2.5

    This release (v1.2.5) did not include any publisher-provided release notes, but the code diff shows a mix of dependency updates, test/tooling workflow changes, and a substantive internal change to how the flat depth argument is converted. The runtime public API (array.prototype.flat export/signature) appears unchanged, but behavior may differ for certain depth values due to the switch in abstract operation helpers.

  • v1.2.4

    This release (v1.2.4) has no provided release notes, but the code diff shows multiple internal dependency and implementation updates. The most notable runtime-facing changes are a switch of the callBind helper source and an upgrade of es-abstract to newer “2020” helper modules.

  • v1.2.3

    v1.2.3 is primarily an internal refactor that switches from the monolithic `es-abstract/es2019` bundle to split-up `es-abstract` 2019 modules, and updates `es-abstract` to a newer (next) version. It also updates some dev tooling and CI configuration files. No publisher release notes were provided for this version.

  • v1.2.2

    v1.2.2 updates the package dependencies and modernizes parts of the test/lint infrastructure. The actual runtime implementation of Array.prototype.flat was changed to delegate flattening logic to es-abstract (ES2019), replacing the previous in-file FlattenIntoArray algorithm.

  • v1.2.1-rename

    This release is effectively a rename of the library and the polyfilled method from Array.prototype.flatten to Array.prototype.flat. The code and package metadata were updated to export and shim Array.prototype.flat instead of Array.prototype.flatten.

    Breaking
  • v1.2.1

    Release v1.2.1 was published on 2018-02-24, but no release notes or change details were provided by the publisher. As a result, it is not possible to identify new features, bug fixes, security updates, or potential breaking changes from the release notes alone.