{"id":19785450,"url":"https://github.com/andersontr15/ramda-lite","last_synced_at":"2025-02-28T07:24:42.901Z","repository":{"id":128550416,"uuid":"83479630","full_name":"andersontr15/ramda-lite","owner":"andersontr15","description":"ramdaLite - Minimalist version of Ramda.js ","archived":false,"fork":false,"pushed_at":"2021-01-01T19:23:57.000Z","size":38,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-11T03:20:39.236Z","etag":null,"topics":["functional","functional-js","functional-programming","ramda","ramda-lite","ramdajs","ramdalite"],"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/andersontr15.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-28T21:12:17.000Z","updated_at":"2021-01-01T19:23:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"d29e5d63-ed4b-4338-8306-a8c3421f363a","html_url":"https://github.com/andersontr15/ramda-lite","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/andersontr15%2Framda-lite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andersontr15%2Framda-lite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andersontr15%2Framda-lite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andersontr15%2Framda-lite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andersontr15","download_url":"https://codeload.github.com/andersontr15/ramda-lite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241117837,"owners_count":19912622,"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":["functional","functional-js","functional-programming","ramda","ramda-lite","ramdajs","ramdalite"],"created_at":"2024-11-12T06:14:42.115Z","updated_at":"2025-02-28T07:24:42.888Z","avatar_url":"https://github.com/andersontr15.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ramdaLite \n\n### Minimalist version of Ramda.js under 10kb\n\n#### To include in project: \n\n```javascript\nvar ramdaLite = require(\"./src/ramdaLite\");\nvar multiplyByTwo = function (v) {\n  return v * 2;\n};\nvar addTwo = function (v) {\n  return v + 2;\n};\nvar addThree = function (v) {\n  return v + 3;\n};\nvar composition = ramdaLite.compose(multiplyByTwo, addTwo, addThree);\n\ncomposition(2)-- \u003e 9;\n```\n\n## API \n1. [addTwo](#add-two)\n2. [adjust](#adjust)\n3. [all](#all)\n4. [always](#always)\n5. [and](#and)\n6. [ap](#ap)\n7. [apply](#apply)\n8. [both](#both)\n9. [binary](#binary)\n10. [bind](#bind)\n11. [complement](#complement)\n12. [compose](#compose)\n13. [contains](#contains)\n14. [defaultTo](#defaultTo)\n15. [divide](#divide)\n16. [either](#either)\n17. [empty](#empty)\n18. [false](#false)\n19. [filter](#filter)\n20. [flip](#flip)\n21. [forEach](#forEach)\n22. [gt](#gt)\n23. [gte](#gte)\n24. [has](#has)\n25. [hasIn](#hasIn)\n26. [inc](#inc)\n27. [it](#it)\n28. [juxt](#juxt)\n29. [keys](#keys)\n30. [length](#length)\n31. [last](#last)\n32. [lte](#lte)\n33. [Maybe](#Maybe)\n34. [map](#map)\n\n### add-two \nadd two numbers together\n```javascript\nvar x = 5;\nvar y = 10;\nramdaLite.addTwo(x, y)-- \u003e 15;\n```\n\n### adjust \napply a function to a specific index in a list\n```javascript\nvar numbers = [4, 5, 6];\nramdaLite.adjust(5, 1, numbers)-- \u003e [4, 10, 6];\n```\n\n### all \na function that will return true if predicate is true for all values\n```javascript\nvar numbers = [4, 5, 6];\nvar isEven = function (val) {\n  return val % 2 === 0;\n};\nramdaLite.all(isEven, list)-- \u003e false;\n\n```\n### always \na function that always returns true\n```javascript\nramdaLite.always()-- \u003e true;\n```\n### and \na function that returns true if both arguments are true\n```javascript\nramdaLite.and(true, false) --\u003e false\n```\n### ap \na function that applies multiple methods to a list\n```javascript\nvar multiply = function (x) {\n  return x * 2;\n};\nvar add = function (x) {\n  return x + 2;\n};\nramdaLite.ap(multiply, add, [1, 2, 3]);\n\n```\n### apply \na function that applies a given context to a function to be invoked\n```javascript\nramdaLite.apply(console.log, 5) -\u003e 5 \n```\n### both \na function that returns true if both functions passed to it with the argument are truthy\n```javascript\nvar isEven = function (value) {\n  return value % 2 === 0;\n};\nvar greaterThanTwenty = function (value) {\n  return value \u003e 20;\n};\nramdaLite.both(isEven, greaterThanTwenty, 21);\n\n```\n### binary \na function that returns a function which only utilizes two arguments\n```javascript\nvar threeArgs = function (a, b, c) {\n  return [a, b, c];\n};\nvar binaryArgsOnly = ramdaLite.binary(threeArgs);\nbinaryArgsOnly(1, 2, 3)-- \u003e [1, 2, undefined];\n```\n### bind \na function that binds the ```this``` context with the specified function and returns a bound function \n```javascript\nvar greet = function () {\n  return \"hello \" + this.name;\n};\nvar obj = {\n  name: \"theo\",\n};\nvar bound = ramdaLite.bind(greet, obj);\nbound();\n```\n### complement \na function that returns a function which returns true if argument is identical to first function\n```javascript\nvar complement = ramdaLite.complement(null);\ncomplement(null) -\u003e true\ncomplement(undefined) -\u003e false \n```\n### compose \na function that can take an infinite amount of functions and call them sequentially on a value\n```javascript\nvar addTwo = function (v) {\n  return v + 2;\n};\nvar multiplyByTwo = function (v) {\n  return v * 2;\n};\nvar composition = ramdaLite.compose(addTwo, multiplyByTwo);\ncomposition(2);\n```\n### contains \na function that returns true if value is in the supplied list\n```javascript\nvar numbers = [1,2,3,4];\nvar hasFour = ramdaLite.contains(4, numbers);\nhasFour --\u003e true \n```\n### defaultTo \n\n### divide \na function that divides two numbers\n```javascript\nvar x = 10;\nvar y = 5;\nvar quotient = ramdaLite.divide(x,y);\nquotient --\u003e 2\n```\n\n### either \na function that returns true if value is truthy for one of two predicate functions \n```javascript\n\tvar value = 2;\n\tvar isOdd = function(v) {\n\t\treturn v % 3 === 0\n\t}\n\tvar isEven = function(v) {\n\t\treturn v % 2 === 0\n\t}\n\tvar either = ramdaLite.either(isEven, isOdd, value);\n\teither --\u003e true \n```\n\n### empty \na function that returns the JavaScript class representation of the supplied type as an empty type\n```javascript\nvar numbers = [1,2,3,4];\nvar value = ramdaLite.empty(numbers);\nvalue --\u003e []\n```\n\n### false \na function that always returns false \n```javascript\nvar f = ramdaLite.false();\nf --\u003e false; \n```\n\n### filter \na function that filters a list based of the the predicate function \n```javascript \n\tvar numbers = [1,2,3,4];\n\tvar filtered = ramdaLite.filter(numbers, function(v) {\n\t\treturn v % 2 === 0\n\t});\n\tfiltered --\u003e [2,4]\n```\n\n### flip \na function that reverses argument order of functions \n```javascript\n\tvar multiply = function(x) {\n\t\treturn x * 2\n\t}\n\tvar add = function(x) {\n\t\treturn x + 2\n\t}\n\tvar flipped = ramdaLite.flipped(multiply, add);\n\tflipped(4) --\u003e add --\u003e multiply --\u003e 12 \n```\n\n### forEach \na function that will iterate through a list and call a function on each value in the list \n```javascript \n\tvar list = [1,2,3,4];\n\tvar log = function(v) {\n\t\tconsole.log('value is ' + v)\n\t}\n\tramdaLite.forEach(log, list) -\u003e 'The value is 1', 'The value is 2', 'The value is 3', 'The value is 4'\n```\n\n### gt \na function that returns true if the first argument is greater than the second argument \n```javascript \n\tvar x = 5;\n\tvar y = 10;\n\tvar result = ramdaLite.gt(x,y);\n\tresult --\u003e false;\n```\n\n### gte\na function that returns true if the first argument is greater than or equal to the second argument \n```javascript \n\tvar x = 10;\n\tvar y = 10;\n\tvar result = ramdaLite.gte(x,y);\n\tresult --\u003e true \n```\n\n### identity\na function that takes in a value and return the value as its self. \n```javascript \n\tvar value = 10;\n\tvar result = ramdaLite.identity(10);\n\tresult --\u003e 10;\n```\n\n### ifElse \n\n\n### inc \na function that will take in a value and increment it by 1 \n```javascript \n  var result = ramdaLite.inc(5);\n  result --\u003e 6 \n```\n\n### is \na function that will return true if first argument is an instance of the second argumet (its constructor)\n```javascript \n\tvar obj = {\n\t\tname: 'theo'\n\t};\n\tvar result = ramdaLite.is(obj, {}) --\u003e true \n\tvar falsy = ramdaLite.is(obj, []) --\u003e false \n```\n\n### it \na function that returns true if the first argument is less than the second argument \n```javascript \n\tvar x = 5;\n\tvar y = 10;\n\tramdaLite.it(x,y) --\u003e true\n```\n\n### isEmpty\na function that will return true if the value is empty \n```javascript \n\tvar value = [1,2,3];\n\tvar value2 = [];\n\tramdaLite.isEmpty(value) -\u003e false;\n\tramdaLite.isEmpty(value2) -\u003e true;\n```\n### juxt \na function which is invokes multiple functions on a list of values \n```javascript \n\tvar double = function(x) {\n\t\treturn x * x \n\t}\n\tvar addThree  = function(x) {\n\t\treturn x + 3\n\t}\n\tvar list = [1,2,3,4];\n\tvar result = ramdaLite.juxt(double,triple,list);\n\tresult --\u003e [4,7,12,19]\n```\n\n### keys \na function that creates a new array from an ```Object``` with just the keys \n```javascript \n\tvar obj = {\n\t\tname: 'theo',\n\t\theight: 69,\n\t\tage: 23\n\t};\n\tramdaLite.keys(obj) -\u003e ['name', 'height', 'age']\n```\n\n### length \na function that returns the length of a list \n```javascript \n\tvar numbers = [1,2,3,4];\n\tramdaLite.length(numbers) --\u003e 4\n```\n\n### last \na function that returns the last element in an ```Array```\n```javascript \n\tvar numbers = [1,2,3,4];\n\tramdaLite.last(numbers) --\u003e 4;\n```\n\n### lte \na function that returns true if the first argument is less than or equal to the second argument \n```javascript \n\tvar x = 5;\n\tvar y = 10;\n\tramdaLite.lte(5,10) --\u003e true;\n```\n\n### Maybe \na function that takes a value and wraps it an an ```Array``` container with either an error or the value \n```javascript\n\tvar good = 5;\n\tvar bad = null;\n\tramdaLite.Maybe(good) --\u003e [5]\n\tramdaLite.Maybe(bad) --\u003e ['error']\n```\n\n### map \na function that takes a list and a function to apply to each value in the list. returns a new ```Array```\n```javascript \n\tvar numbers = [1,2,3,4];\n\tvar double = function(v) {\n\t\treturn v * 2\n\t}\n\tramdaLite.map(numbers, double) --\u003e [2,4,6,8];\n```\n\n### max \na function that takes a list and returns the maximum value\n```javascript \n\tvar numbers = [2,34,100,9];\n\tramdaLite.max(numbers) --\u003e 100\n```\n\n### memoize \na function that returns a cached value of the passed in function if it has already been stored \n```javascript \n\tvar multiplyByTwo = function(v) {\n\t\treturn v * 2 \n\t}\n\tvar memoize = ramdaLite.memoize(multiplyByTwo);\n\tmemoize(multiplyByTwo(2)) -\u003e returns function from cache \n\tmemoize(console.log(2)) -\u003e adds method to cache and returns console.log(2)\n```\n\n### min \na function that takes a list and returns the minimum value \n```javascript \n\tvar numbers = [1,2,3,4];\n\tramdaLite.min(numbers) --\u003e 1 \n```\n\n### multiply \n\n### negate \n\n### none \n\n### nth\n\n### nthArg\n\n### of \n\n### or \n\n### pair \n\n### prepend \n\n### product \n\n### range \n\n### reduce \n\n### reject \n\n### reverse \n\n### subtract \n\n### tail \n\n### take \n\n### takeLast \n\n### times \n\n### toUpper\n\n### toLower \n\n### toPairs\n\n### tryCatch\n\n### true \n\n### unique \n\n### values \n\n### without \n\n### zip \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandersontr15%2Framda-lite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandersontr15%2Framda-lite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandersontr15%2Framda-lite/lists"}