{"id":16718680,"url":"https://github.com/planeshifter/plusarrays.js","last_synced_at":"2025-04-10T08:54:08.416Z","repository":{"id":57326222,"uuid":"21466538","full_name":"Planeshifter/plusArrays.js","owner":"Planeshifter","description":"Extensions of the Array.prototype object","archived":false,"fork":false,"pushed_at":"2015-03-23T22:27:39.000Z","size":256,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-09T16:48:36.634Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Planeshifter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-03T14:59:52.000Z","updated_at":"2022-01-15T23:56:24.000Z","dependencies_parsed_at":"2022-09-21T01:52:49.600Z","dependency_job_id":null,"html_url":"https://github.com/Planeshifter/plusArrays.js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Planeshifter%2FplusArrays.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Planeshifter%2FplusArrays.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Planeshifter%2FplusArrays.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Planeshifter%2FplusArrays.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Planeshifter","download_url":"https://codeload.github.com/Planeshifter/plusArrays.js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248190407,"owners_count":21062277,"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-10-12T21:38:05.280Z","updated_at":"2025-04-10T08:54:08.394Z","avatar_url":"https://github.com/Planeshifter.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM version][npm-image]][npm-url]\n[![Build Status][travis-image]][travis-url]\n[![Coverage Status][coveralls-image]][coveralls-url]\n[![Dependencies][dependencies-image]][dependencies-url]\n\nJS-Arrays-Sugar\n===============\n\n\u003e Extensions of the Array.prototype object\n\n# Introduction\n\nThe package can be easily installed via npm:\n\n```\nnpm install plus_arrays\n```\n\nTo register the custon methods to the 'Array.prototype' object, we simply require the package\n\n```\nrequire(plusArrays)\n```\n\n# API\n\n### .compare(arr)\n\nChecks whether the array contains the same elements as `arr`. If this is the case, `true` will be returned, otherwise `false`.\n\n### .sum()\ncalculates the sum of the elements in the array\n\n### .mean()\ncalculates the arithmetic mean of the elements in the array\n\n### .max()\nreturns the maximum element array\n\n### .min()\nreturns the minimum  element array\n\n### .clean(elem)\nremoves all elments in the `array` which are equal to `elem`.\n\n### .contains(elem)\nReturns `true` if the array contains `elem`, `false` otherwise.\n\n### .pickRandom()\nReturns a random element of the array.\n\n### .pickRandomElements(no)\nReturns a new array of length `no` by sampling without replacement from the original array.\n\n### .containsAll(arr)\nReturns `true` if the array contains *all* elements of Array `arr`, `false` otherwise.\n\n### .containsAny(arr)\nReturns `true` if the array contains at least one of the elements of Array `arr`, `false` otherwise.\n\n### .removeItemAt(index)\nRemoves the element at position `index` such that the array ends up with one element less than before.\n\n### .remix()\nReturns a new array in which the elements of the original array are randomly re-arranged.\n\n### .unique()\nReturns a new array in which any duplicates are removed.\n\n### .concatUnique(arr)\nConcatenates array `arr` to the original array, after removing all elements present in the original array.\n\n### .orderIndices(fun)\nReturns an array of indices giving the position of the element in a sorted array. The `fun` parameter expects a custom comparator function. If none is supplied,\nelements are sorted in increasing order.\n\n## Unit Tests\n\nRun tests via the command `npm test`\n\n---\n## License\n\n[MIT license](http://opensource.org/licenses/MIT).\n\n[npm-image]: https://badge.fury.io/js/plus_arrays.svg\n[npm-url]: http://badge.fury.io/js/plus_arrays\n\n[travis-image]: https://travis-ci.org/Planeshifter/plusArrays.js.svg\n[travis-url]: https://travis-ci.org/Planeshifter/plusArrays.js\n\n[coveralls-image]: https://img.shields.io/coveralls/Planeshifter/plusArrays.js/master.svg\n[coveralls-url]: https://coveralls.io/r/Planeshifter/plusArrays.js?branch=master\n\n[dependencies-image]: http://img.shields.io/david/Planeshifter/plusArrays.js.svg\n[dependencies-url]: https://david-dm.org/Planeshifter/plusArrays.js\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplaneshifter%2Fplusarrays.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplaneshifter%2Fplusarrays.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplaneshifter%2Fplusarrays.js/lists"}