{"id":21712504,"url":"https://github.com/youfoundron/immutable-sorted-map","last_synced_at":"2026-05-08T15:08:37.571Z","repository":{"id":46935530,"uuid":"90889147","full_name":"youfoundron/immutable-sorted-map","owner":"youfoundron","description":"SortedMap implemented for Immutable.js","archived":false,"fork":false,"pushed_at":"2022-12-06T20:18:21.000Z","size":547,"stargazers_count":1,"open_issues_count":13,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-22T04:34:48.781Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/youfoundron.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-10T17:09:56.000Z","updated_at":"2017-06-25T23:19:49.000Z","dependencies_parsed_at":"2023-01-23T15:00:58.426Z","dependency_job_id":null,"html_url":"https://github.com/youfoundron/immutable-sorted-map","commit_stats":null,"previous_names":["rongierlach/immutable-trees","rongierlach/immutable-sorted-map"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youfoundron%2Fimmutable-sorted-map","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youfoundron%2Fimmutable-sorted-map/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youfoundron%2Fimmutable-sorted-map/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youfoundron%2Fimmutable-sorted-map/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/youfoundron","download_url":"https://codeload.github.com/youfoundron/immutable-sorted-map/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244667699,"owners_count":20490480,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-25T23:39:27.921Z","updated_at":"2026-05-08T15:08:32.545Z","avatar_url":"https://github.com/youfoundron.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Immutable Sorted Map\n[![Build Status](https://travis-ci.org/rongierlach/immutable-sorted-map.svg?branch=master)](https://travis-ci.org/rongierlach/immutable-sorted-map) [![Coverage Status](https://coveralls.io/repos/github/rongierlach/immutable-sorted-map/badge.svg?branch=master)](https://coveralls.io/github/rongierlach/immutable-sorted-map?branch=master) [![Dependency Status](https://david-dm.org/rongierlach/range-life.svg)](https://david-dm.org/rongierlach/immutable-sorted-map) [![devDependency Status](https://david-dm.org/rongierlach/immutable-sorted-map/dev-status.svg)](https://david-dm.org/rongierlach/immutable-sorted-map#info=devDependencies) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)  \n\nEver wish Immutable.js Maps would insert new items sorted by key?  \nIssue [#88](https://github.com/facebook/immutable-js/issues/88) inspired me to extend Immutable's Map to do just this.\n\n## Installation\nUsing npm:  \n`$ npm install immutable-sorted-map`  \nUsing yarn:  \n`$ yarn install immutable-sorted-map`\n\n## Usage\n```javaScript\nimport SortedMap from 'immutable-sorted-map'\n\nconst myData = {\n  '0.01': 'hundredth',\n  '0.001': 'thousandth',\n  '0.1': 'tenth'\n}\n\nconst compareKeys = (currKey, nextKey) =\u003e {\n  const currNum = Number(currKey)\n  const nextNum = Number(nextKey)\n  if (currNum \u003c nextNum) return -1\n  if (currNum \u003e nextNum) return 1\n  return 0\n}\n\nconst myImmutableData = new SortedMap(myData, compareKeys)\n\nmyImmutableData.toJS()\n/* {\n  '0.001': 'thousandth',\n  '0.01': 'hundredth',\n  '0.1': 'tenth'\n} */\n```\n\n## Api\nSee the documentation for [Immutable's Map](https://facebook.github.io/immutable-js/docs/#/Map)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoufoundron%2Fimmutable-sorted-map","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyoufoundron%2Fimmutable-sorted-map","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoufoundron%2Fimmutable-sorted-map/lists"}