{"id":27952306,"url":"https://github.com/thiagodroz/oh-my-lib","last_synced_at":"2026-05-05T21:31:44.182Z","repository":{"id":57313817,"uuid":"104430285","full_name":"thiagodroz/oh-my-lib","owner":"thiagodroz","description":"This is a library of Javascript functions created with the purpose of practicing my Javascript skills and putting into practice some less used techniques.","archived":false,"fork":false,"pushed_at":"2018-08-16T03:17:18.000Z","size":129,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-21T21:52:52.885Z","etag":null,"topics":["es6","javascript","library","npm","webpack"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/oh-my-lib","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/thiagodroz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-22T04:08:43.000Z","updated_at":"2023-04-11T15:21:23.000Z","dependencies_parsed_at":"2022-09-20T23:10:32.392Z","dependency_job_id":null,"html_url":"https://github.com/thiagodroz/oh-my-lib","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/thiagodroz/oh-my-lib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagodroz%2Foh-my-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagodroz%2Foh-my-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagodroz%2Foh-my-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagodroz%2Foh-my-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thiagodroz","download_url":"https://codeload.github.com/thiagodroz/oh-my-lib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagodroz%2Foh-my-lib/sbom","scorecard":{"id":880777,"data":{"date":"2025-08-11","repo":{"name":"github.com/thiagodroz/oh-my-lib","commit":"8be68e9895342e126ba5a0bbafd430551b36592a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 1/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T08:06:24.860Z","repository_id":57313817,"created_at":"2025-08-24T08:06:24.861Z","updated_at":"2025-08-24T08:06:24.861Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32669385,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["es6","javascript","library","npm","webpack"],"created_at":"2025-05-07T17:00:18.684Z","updated_at":"2026-05-05T21:31:44.158Z","avatar_url":"https://github.com/thiagodroz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Oh My Lib\n\n[![Build Status](https://travis-ci.org/thiagodroz/oh-my-lib.svg?branch=master)](https://travis-ci.org/thiagodroz/oh-my-lib) [![Maintainability](https://api.codeclimate.com/v1/badges/d39c957238ae67272fd7/maintainability)](https://codeclimate.com/github/thiagodroz/oh-my-lib/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/d39c957238ae67272fd7/test_coverage)](https://codeclimate.com/github/thiagodroz/oh-my-lib/test_coverage) [![npm](https://img.shields.io/npm/dt/oh-my-lib.svg)]() [![npm](https://img.shields.io/npm/l/oh-my-lib.svg)]()\n\n---\n\nThis is a library of Javascript functions created with the purpose of practicing my Javascript skills and putting into practice some less used techniques. Therefore, not all functions are done in a way that has the best possible performance because they may have been done by focusing on a specific approach for study purposes.\n\n---\n\n## Functions categories:\n- [Math](#math-functions)\n- [Array](#array-functions)\n- [Collection](#collection-functions)\n\n---\n\n## Math functions\n\n### max\n\nCalled to biggest between two passed values.\n\n**Input**: (*number/string*, *number/string*)  \n**Output**: *number/string*\n\n```javascript\nconst result = max(5, 2);\n\n//result == 5\n```\n\n### min\n\nCalled to smaller between two passed values.\n\n**Input**: (*number/string*, *number/string*)  \n**Output**: *number/string*\n\n```javascript\nconst result = min(5, 2);\n\n//result == 2\n```\n\n### sumAllInRange\n\nReturns the sum of all integers between the first and the second parameters. If passed a third parameter, the result the result will be the sum of numbers starting from the first parameter but steping the passed value until reach the second parameter.\n\n**Input**: (*integer*, *integer*, *integer=1*)  \n**Output**: *number*\n\n```javascript\nconst result = sumAllInRange(3, 99, 4);\n\n//result == 1275\n```\n\n---\n\n## Array functions\n\n### first\n\nReturn the first element of the array\n\n**Input**: (*array*)  \n**Output**: *number/string*\n\n```javascript\nconst result = first([1,2,3]);\n\n//result == 1\n```\n\n### tail\n\nReturn the the array without the first element\n\n**Input**: (*array*)  \n**Output**: *array*\n\n```javascript\nconst result = tail([1,2,3]);\n\n//result == [2,3]\n```\n\n### last\n\nReturn the last element of the array\n\n**Input**: (*array*)  \n**Output**: *number/string*\n\n```javascript\nconst result = last([1,2,3]);\n\n//result == 3\n```\n\n### init\n\nReturn the the array without the last element\n\n**Input**: (*array*)  \n**Output**: *array*\n\n```javascript\nconst result = init([1,2,3]);\n\n//result == [1,2]\n```\n\n### each\n\nCalled to execute some passed function over all elements of a passed array without return any result.\n\n**Input**: (*array*, *function*)  \n**Output**: *undefined*\n\n```javascript\neach([1,2,3], (value) =\u003e { console.log(value) });\n```\n\n### filter\n\nReturns as result a list with the elements that passed the test defined by the passed function.\n\n**Input**: (*array*, *function*)  \n**Output**: *array*\n\n```javascript\nfilter([1,2,3], (value) =\u003e { return value \u003e 1 });\n\n//result == [2,3]\n```\n\n### maxOfList\n\nCalled to get the biggest value between the values of a passed array.\n\n**Input**: (*array*)  \n**Output**: *number/string*\n\n```javascript\nconst result = lib.maxOfList([5,10,2,9]);\n\n//result == 10\n```\n\n### maxOccurrence\n\nCalled to get the most frequent element of the array. If more than one element have the same frenquency, the first element to reach that frequency will be returned.\n\n**Input**: (*array*)  \n**Output**: *number/string*\n\n```javascript\nconst result = lib.maxOccurrence(['a','a','c','b','c','c']);\n\n//result == 'c'\n```\n\n### trueValues\n\nReturns a copy of the passed array without the falsy values. In Javascript, the falsy values are false, null, 0, \"\", undefined and NaN.\n\n**Input**: (*array*)  \n**Output**: *array*\n\n```javascript\nconst result = lib.trueValues(['c', 0, null, 1]);\n\n//result == ['c', 1]\n```\n\n### except\n\nReturns a copy of the passed array without the passed values.\n\n**Input**: (*array*, *number/string*...)  \n**Output**: *array*\n\n```javascript\nconst result = lib.except(['a','a','c','b','c','c'], 'b', 'c');\n\n//result == ['a', 'a']\n```\n\n---\n\n## Collection functions\n\n### extractProperty\n\nCalled to get the value of a property with the given name of all elements of a passed larrayist.\n\n**Input**: (*array*, *string*)  \n**Output**: *array*\n\n```javascript\nconst list = [\n  { a: 1, b: 2, c: 3 },\n  { a: 4, b: 5, c: 6 },\n  { a: 7, b: 8, c: 9 },\n  { a: 10, b: 11, c: 12 },\n  { a: 13, b: 14, c: 15 }\n];\nconst result = lib.extractProperty(list, 'b');\n\n//result == [2,5,8,11,14]\n```\n\n### maxOfProperty\n\nCalled to get the biggest value of a passed property from a passed array of objects.\n\n**Input**: (*array*, *string*)  \n**Output**: *number/string*\n\n```javascript\nconst result = maxOfProperty([\n  { age: 20 },\n  { age: 25 },\n  { age: 10 },\n  { age: 40 }\n], 'age');\n\n//result == 40\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiagodroz%2Foh-my-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthiagodroz%2Foh-my-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiagodroz%2Foh-my-lib/lists"}