PHPackages                             chubbyphp/chubbyphp-typescript - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. chubbyphp/chubbyphp-typescript

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

chubbyphp/chubbyphp-typescript
==============================

PHP port of JavaScript's Array and Map APIs with TypeScript-style generics

20PHPCI passing

Since Jul 5Pushed 2w agoCompare

[ Source](https://github.com/chubbyphp/chubbyphp-typescript)[ Packagist](https://packagist.org/packages/chubbyphp/chubbyphp-typescript)[ RSS](/packages/chubbyphp-chubbyphp-typescript/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

chubbyphp-typescript
====================

[](#chubbyphp-typescript)

[![CI](https://github.com/chubbyphp/chubbyphp-typescript/actions/workflows/ci.yml/badge.svg)](https://github.com/chubbyphp/chubbyphp-typescript/actions/workflows/ci.yml)[![Coverage Status](https://camo.githubusercontent.com/e292d52ce8468f3ec98c6b07380ab2d3cc43b5577e2ff2c95b5d352c33a5f23f/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6368756262797068702f6368756262797068702d747970657363726970742f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/chubbyphp/chubbyphp-typescript?branch=master)[![Mutation testing badge](https://camo.githubusercontent.com/b3981dce7acb3c18ee84e201f9fb720913fea83c8f6feb286f0a8e332b96a2b8/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d2532466368756262797068702532466368756262797068702d747970657363726970742532466d6173746572)](https://dashboard.stryker-mutator.io/reports/github.com/chubbyphp/chubbyphp-typescript/master)[![Latest Stable Version](https://camo.githubusercontent.com/975a9c9ae0efbfb425abbd004cb45927fa3bd1cca1fea976d92cdde83862c6a0/68747470733a2f2f706f7365722e707567782e6f72672f6368756262797068702f6368756262797068702d747970657363726970742f76)](https://packagist.org/packages/chubbyphp/chubbyphp-typescript)[![Total Downloads](https://camo.githubusercontent.com/4454e56d550e4efc27cc9bd5d3a28e534d678e6c340d06576cf0be9b7f0c8ce6/68747470733a2f2f706f7365722e707567782e6f72672f6368756262797068702f6368756262797068702d747970657363726970742f646f776e6c6f616473)](https://packagist.org/packages/chubbyphp/chubbyphp-typescript)[![Monthly Downloads](https://camo.githubusercontent.com/66ce0bd4478de9da21915eaa8c5fbcad1046e8c74de117c8644114c328b69102/68747470733a2f2f706f7365722e707567782e6f72672f6368756262797068702f6368756262797068702d747970657363726970742f642f6d6f6e74686c79)](https://packagist.org/packages/chubbyphp/chubbyphp-typescript)

[![bugs](https://camo.githubusercontent.com/334a9f52fee96409f4797f6c0ae55004a6fbb32ce9cd8fed53fa3a3c0e12231c/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d74797065736372697074266d65747269633d62756773)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-typescript)[![code_smells](https://camo.githubusercontent.com/407dc0a3fe47ff890eaf97fb7db062f9030512920c47a14a25dbfbc1b485bdd1/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d74797065736372697074266d65747269633d636f64655f736d656c6c73)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-typescript)[![coverage](https://camo.githubusercontent.com/4712afbbefd97c50a0dd2ea621e7154ed27b1ee948a334c3aac86515c0e76db2/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d74797065736372697074266d65747269633d636f766572616765)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-typescript)[![duplicated_lines_density](https://camo.githubusercontent.com/57cde82dbb48c1499456365e4b982fbd4d318153af4eb60beb69dd994235f706/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d74797065736372697074266d65747269633d6475706c6963617465645f6c696e65735f64656e73697479)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-typescript)[![ncloc](https://camo.githubusercontent.com/2e4c0a27ff50495ca9f60c8d6ca96f93d3d2b095536f931c9c63b056dd920b61/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d74797065736372697074266d65747269633d6e636c6f63)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-typescript)[![sqale_rating](https://camo.githubusercontent.com/fcfe444d8227c4793d0608b3072976a139922f5cf861c323454bda66144b6731/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d74797065736372697074266d65747269633d7371616c655f726174696e67)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-typescript)[![alert_status](https://camo.githubusercontent.com/ccb54a8a035bfb4da1dde39168e5d9f58249fdb80b6210886b7e16d32c866746/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d74797065736372697074266d65747269633d616c6572745f737461747573)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-typescript)[![reliability_rating](https://camo.githubusercontent.com/72867609998503635a8ca9bbb95dc9b001ed263f69bc29d02c9d377aef519be4/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d74797065736372697074266d65747269633d72656c696162696c6974795f726174696e67)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-typescript)[![security_rating](https://camo.githubusercontent.com/a4fd99c7e0ad72acf7590234c1f1d00aaa81acaf4cb072dc4bd179bb0e4f606d/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d74797065736372697074266d65747269633d73656375726974795f726174696e67)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-typescript)[![sqale_index](https://camo.githubusercontent.com/ee20f2aac4c0ed51777ddb3bc8da80065d47ff48892506b29301ab5ea72fa0af/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d74797065736372697074266d65747269633d7371616c655f696e646578)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-typescript)[![vulnerabilities](https://camo.githubusercontent.com/6b46743e80a8c348eb7ff69ab92f9eb23cc5d0d57da55c0cdbc884335904702c/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d74797065736372697074266d65747269633d76756c6e65726162696c6974696573)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-typescript)

Description
-----------

[](#description)

A PHP implementation of JavaScript's `Array` and `Map` APIs with TypeScript-style generics and Test262-inspired coverage.

Requirements
------------

[](#requirements)

- php: ^8.3

Installation
------------

[](#installation)

Through [Composer](http://getcomposer.org) as [chubbyphp/chubbyphp-typescript](https://packagist.org/packages/chubbyphp/chubbyphp-typescript).

```
composer require chubbyphp/chubbyphp-typescript "^1.0"
```

Usage
-----

[](#usage)

### Arr (Array)

[](#arr-array)

A PHP implementation of the JavaScript `Array` class, including sparse-array semantics and chainable methods. The entire `Array` API is ported except `Array.fromAsync`, which is deliberately omitted (it is built on promises and async iteration, which have no PHP equivalent). See the [full documentation](doc/Arr.md) for API reference and examples.

```
use Chubbyphp\Typescript\Arr;

$arr = new Arr(1, 2, 3, 4, 5);
$arr->shift();
$arr->pop();
$arr = $arr->map(static fn (int $v): int => $v * 2);
$arr->push(10);
// iterator_to_array($arr->values()) => [4, 6, 8, 10]

$arr = Arr::from([1, 2, 3, 4, 5], static fn (int $v): int => $v * 2);
// iterator_to_array($arr->values()) => [2, 4, 6, 8, 10]
```

### Map

[](#map)

A PHP implementation of the JavaScript `Map` class with `SameValueZero` key equality and insertion-order iteration. See the [full documentation](doc/Map.md) for API reference and examples.

```
use Chubbyphp\Typescript\Map;

$map = new Map([
    ['a', 1],
    ['b', 2],
]);
$map->set('c', 3);
$map->delete('b');
// $map->toArray() => [['a', 1], ['c', 3]]

$map->forEach(static fn (int $v, string $k) => print($k.':'.$v));
```

Copyright
---------

[](#copyright)

2026 Dominik Zogg

###  Health Score

21

—

LowBetter than 17% of packages

Maintenance63

Regular maintenance activity

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/55048de83ca5e5d8c67164a19c78edcaad413b0c1a4ae10d92edf8d77bedd90f?d=identicon)[dominikzogg](/maintainers/dominikzogg)

---

Top Contributors

[![dominikzogg](https://avatars.githubusercontent.com/u/1011217?v=4)](https://github.com/dominikzogg "dominikzogg (83 commits)")

---

Tags

arraychubbyphpjavascriptsparse-arraytc39test262typescript

### Embed Badge

![Health badge](/badges/chubbyphp-chubbyphp-typescript/health.svg)

```
[![Health](https://phpackages.com/badges/chubbyphp-chubbyphp-typescript/health.svg)](https://phpackages.com/packages/chubbyphp-chubbyphp-typescript)
```

###  Alternatives

[pratiksh/nepalidate

Laravel package to convert AD to BS that can work with carbon.

276.7k1](/packages/pratiksh-nepalidate)[piszczek/magento2-inputmask

Add inputMask parameter to abstract input. Based on IMask.

1022.4k3](/packages/piszczek-magento2-inputmask)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
