{"id":24211876,"url":"https://github.com/heimdallrj/js-prototype","last_synced_at":"2025-03-03T16:22:35.227Z","repository":{"id":57283486,"uuid":"129854794","full_name":"heimdallrj/js-prototype","owner":"heimdallrj","description":"Modified prototype methods for JS","archived":false,"fork":false,"pushed_at":"2018-04-26T17:51:35.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-14T02:37:16.708Z","etag":null,"topics":["javascript","js","js-prototype"],"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/heimdallrj.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":"2018-04-17T06:09:26.000Z","updated_at":"2023-04-11T15:22:55.000Z","dependencies_parsed_at":"2022-09-04T18:52:22.097Z","dependency_job_id":null,"html_url":"https://github.com/heimdallrj/js-prototype","commit_stats":null,"previous_names":["thinkholic/js-prototype"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimdallrj%2Fjs-prototype","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimdallrj%2Fjs-prototype/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimdallrj%2Fjs-prototype/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimdallrj%2Fjs-prototype/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heimdallrj","download_url":"https://codeload.github.com/heimdallrj/js-prototype/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241696530,"owners_count":20004840,"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":["javascript","js","js-prototype"],"created_at":"2025-01-14T02:37:24.703Z","updated_at":"2025-03-03T16:22:35.206Z","avatar_url":"https://github.com/heimdallrj.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# js-prototype\r\n\r\n[![npm](https://img.shields.io/npm/v/js-prototype.svg)](https://www.npmjs.com/package/js-prototype)\r\n[![license](https://img.shields.io/github/license/thinkholic/js-prototype.svg)](https://github.com/thinkholic/js-prototype/blob/master/LICENSE)\r\n\r\nModified prototype methods for JS\r\n\r\n## Installation\r\n\r\n```\r\nnpm i -S js-prototype\r\n```\r\n\r\n## Usage\r\n\r\n### String\r\n\r\n#### String.allReplace()\r\n\r\n```js\r\nrequire 'js-prototype'; // or require 'js-prototype/string';\r\n\r\nvar str = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';\r\n\r\nvar list = {\r\n    'ipsum': 'REPLACED-ipsum',\r\n    'amet': 'REPLACED-amet'\r\n};\r\nvar newStr = str.allReplace(list);\r\nconsole.log(newStr); // Lorem REPLACED-ipsum dolor sit REPLACED-amet, consectetur adipiscing elit.\r\n```\r\n\r\n#### String.toTitleCase()\r\n\r\n```js\r\nrequire 'js-prototype'; // or require 'js-prototype/string';\r\n\r\nvar str = 'Lorem ipsum dolor';\r\nvar result = str.toTitleCase();\r\nconsole.log(result); // Lorem Ipsum Dolor\r\n\r\n```\r\n\r\n### Object\r\n\r\n#### Object.isEmpty()\r\n\r\n```js\r\nrequire 'js-prototype'; // or require 'js-prototype/object';\r\n\r\nconst a = {};\r\nconst b = {a: 1, b:3};\r\nconsole.log(a.isEmpty()); // true\r\nconsole.log(b.isEmpty()); // false\r\n```\r\n\r\n### Array\r\n\r\n#### Array.drop()\r\n\r\n```js\r\nrequire 'js-prototype'; // or require 'js-prototype/array';\r\n\r\n// By Value\r\nconst arr = [1, 2, 3, 4, 5, 6];\r\narr.drop(2);\r\nconsole.log(arr); // [1, 3, 4, 5, 6]\r\n\r\n// By Index\r\narr.drop(null, 0);\r\nconsole.log(arr); // [3, 4, 5, 6]\r\n```\r\n\r\n## License\r\n\r\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheimdallrj%2Fjs-prototype","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheimdallrj%2Fjs-prototype","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheimdallrj%2Fjs-prototype/lists"}