Comparing version 0.5.2 to 0.5.3
@@ -10,3 +10,3 @@ const R = require("./rambda") | ||
const add = new Benchmark.Suite | ||
options.add = true | ||
options.add = false | ||
@@ -33,3 +33,3 @@ if (options.add) { | ||
const adjust = new Benchmark.Suite | ||
options.adjust = true | ||
options.adjust = false | ||
@@ -53,3 +53,3 @@ if (options.adjust) { | ||
const any = new Benchmark.Suite | ||
options.any = true | ||
options.any = false | ||
@@ -76,3 +76,3 @@ if (options.any) { | ||
const append = new Benchmark.Suite | ||
options.append = true | ||
options.append = false | ||
@@ -96,3 +96,3 @@ if (options.append) { | ||
const compose = new Benchmark.Suite | ||
options.compose = true | ||
options.compose = false | ||
@@ -119,3 +119,3 @@ if (options.compose) { | ||
const contains = new Benchmark.Suite | ||
options.contains = true | ||
options.contains = false | ||
@@ -144,3 +144,3 @@ if (options.contains) { | ||
const drop = new Benchmark.Suite | ||
options.drop = true | ||
options.drop = false | ||
@@ -166,3 +166,3 @@ if (options.drop) { | ||
const dropLast = new Benchmark.Suite | ||
options.dropLast = true | ||
options.dropLast = false | ||
@@ -188,3 +188,3 @@ if (options.dropLast) { | ||
const equals = new Benchmark.Suite | ||
options.equals = true | ||
options.equals = false | ||
@@ -211,3 +211,3 @@ if (options.equals) { | ||
const filter = new Benchmark.Suite | ||
options.filter = true | ||
options.filter = false | ||
@@ -234,3 +234,3 @@ if (options.filter) { | ||
const find = new Benchmark.Suite | ||
options.find = true | ||
options.find = false | ||
@@ -257,3 +257,3 @@ if (options.find) { | ||
const findIndex = new Benchmark.Suite | ||
options.findIndex = true | ||
options.findIndex = false | ||
@@ -282,3 +282,3 @@ if (options.findIndex) { | ||
const flatten = new Benchmark.Suite | ||
options.flatten = true | ||
options.flatten = false | ||
@@ -305,3 +305,3 @@ if (options.flatten) { | ||
const head = new Benchmark.Suite | ||
options.head = true | ||
options.head = false | ||
@@ -329,3 +329,3 @@ if (options.head) { | ||
const headString = new Benchmark.Suite | ||
options.headString = true | ||
options.headString = false | ||
@@ -350,3 +350,3 @@ if (options.headString) { | ||
const indexOf = new Benchmark.Suite | ||
options.indexOf = true | ||
options.indexOf = false | ||
@@ -375,3 +375,3 @@ if (options.indexOf) { | ||
const init = new Benchmark.Suite | ||
options.init = true | ||
options.init = false | ||
@@ -399,3 +399,3 @@ if (options.init) { | ||
const initString = new Benchmark.Suite | ||
options.initString = true | ||
options.initString = false | ||
@@ -420,3 +420,3 @@ if (options.initString) { | ||
const last = new Benchmark.Suite | ||
options.last = true | ||
options.last = false | ||
@@ -444,3 +444,3 @@ if (options.last) { | ||
const map = new Benchmark.Suite | ||
options.map = true | ||
options.map = false | ||
@@ -469,3 +469,3 @@ if (options.map) { | ||
const match = new Benchmark.Suite | ||
options.match = true | ||
options.match = false | ||
@@ -493,3 +493,3 @@ if (options.match) { | ||
const merge = new Benchmark.Suite | ||
options.merge = true | ||
options.merge = false | ||
@@ -518,3 +518,3 @@ if (options.merge) { | ||
const omit = new Benchmark.Suite | ||
options.omit = true | ||
options.omit = false | ||
@@ -543,3 +543,3 @@ if (options.omit) { | ||
const path = new Benchmark.Suite | ||
options.path = true | ||
options.path = false | ||
@@ -568,3 +568,3 @@ if (options.path) { | ||
const pick = new Benchmark.Suite | ||
options.pick = true | ||
options.pick = false | ||
@@ -593,3 +593,3 @@ if (options.pick) { | ||
const prop = new Benchmark.Suite | ||
options.prop = true | ||
options.prop = false | ||
@@ -615,3 +615,3 @@ if (options.prop) { | ||
const propEq = new Benchmark.Suite | ||
options.propEq = true | ||
options.propEq = false | ||
@@ -641,3 +641,3 @@ if (options.propEq) { | ||
const range = new Benchmark.Suite | ||
options.range = true | ||
options.range = false | ||
@@ -666,3 +666,3 @@ if (options.range) { | ||
const repeat = new Benchmark.Suite | ||
options.repeat = true | ||
options.repeat = false | ||
@@ -691,3 +691,3 @@ if (options.repeat) { | ||
const replace = new Benchmark.Suite | ||
options.replace = true | ||
options.replace = false | ||
@@ -714,3 +714,3 @@ if (options.replace) { | ||
const sort = new Benchmark.Suite | ||
options.sort = true | ||
options.sort = false | ||
@@ -738,3 +738,3 @@ if (options.sort) { | ||
const sortBy = new Benchmark.Suite | ||
options.sortBy = true | ||
options.sortBy = false | ||
@@ -761,3 +761,3 @@ if (options.sortBy) { | ||
const split = new Benchmark.Suite | ||
options.split = true | ||
options.split = false | ||
@@ -784,3 +784,3 @@ if (options.split) { | ||
const splitEvery = new Benchmark.Suite | ||
options.splitEvery = true | ||
options.splitEvery = false | ||
@@ -804,3 +804,3 @@ if (options.splitEvery) { | ||
const splitEveryString = new Benchmark.Suite | ||
options.splitEveryString = true | ||
options.splitEveryString = false | ||
@@ -824,3 +824,3 @@ if (options.splitEveryString) { | ||
const take = new Benchmark.Suite | ||
options.take = true | ||
options.take = false | ||
@@ -849,3 +849,3 @@ if (options.take) { | ||
const takeString = new Benchmark.Suite | ||
options.takeString = true | ||
options.takeString = false | ||
@@ -871,3 +871,3 @@ if (options.takeString) { | ||
const takeLast = new Benchmark.Suite | ||
options.takeLast = true | ||
options.takeLast = false | ||
@@ -896,3 +896,3 @@ if (options.takeLast) { | ||
const takeLastString = new Benchmark.Suite | ||
options.takeLastString = true | ||
options.takeLastString = false | ||
@@ -918,3 +918,3 @@ if (options.takeLastString) { | ||
const test = new Benchmark.Suite | ||
options.test = true | ||
options.test = false | ||
@@ -938,3 +938,3 @@ if (options.test) { | ||
const toLower = new Benchmark.Suite | ||
options.toLower = true | ||
options.toLower = false | ||
@@ -962,3 +962,3 @@ if (options.toLower) { | ||
const toUpper = new Benchmark.Suite | ||
options.toUpper = true | ||
options.toUpper = false | ||
@@ -986,3 +986,3 @@ if (options.toUpper) { | ||
const trim = new Benchmark.Suite | ||
options.trim = true | ||
options.trim = false | ||
@@ -1010,3 +1010,3 @@ if (options.trim) { | ||
const type = new Benchmark.Suite | ||
options.type = true | ||
options.type = false | ||
@@ -1030,3 +1030,3 @@ if (options.type) { | ||
const update = new Benchmark.Suite | ||
options.update = true | ||
options.update = false | ||
@@ -1050,3 +1050,3 @@ if (options.update) { | ||
const values = new Benchmark.Suite | ||
options.values = true | ||
options.values = false | ||
@@ -1097,3 +1097,3 @@ if (options.values) { | ||
const example = new Benchmark.Suite | ||
options.example = true | ||
options.example = false | ||
@@ -1100,0 +1100,0 @@ if (options.example) { |
{ | ||
"name": "rambda", | ||
"version": "0.5.2", | ||
"version": "0.5.3", | ||
"description": "Lightweight alternative to Ramda", | ||
"main": "index.js", | ||
"main": "rambda.js", | ||
"scripts": { | ||
@@ -7,0 +7,0 @@ "test": "jest", |
@@ -582,2 +582,9 @@ function add(a, b){ | ||
} | ||
const asStr = a.toString() | ||
if(asStr.startsWith("async")){ | ||
return "Async" | ||
}else if(asStr.includes("function")||asStr.includes("=>")){ | ||
return "Function" | ||
} | ||
@@ -584,0 +591,0 @@ return "Object" |
@@ -34,3 +34,3 @@ [![Build Status](https://travis-ci.org/selfrefactor/ils.svg?branch=master)](https://travis-ci.org/selfrefactor/rambda) | ||
``` | ||
https://unpkg.com/rambda@0.5.2/webVersion.js | ||
https://cdnjs.cloudflare.com/ajax/libs/rambda/0.5.2/webVersion.js | ||
``` | ||
@@ -52,2 +52,4 @@ | ||
- Rambda's **map/filter** works only for arrays, while Ramda's **map/filter** accept aslo objects | ||
- | ||
- Rambda's **type** detect async functions. The returned value is `"Async"` | ||
@@ -54,0 +56,0 @@ ## Benchmark |
29
test.js
const Ramda = require("ramda") | ||
const R = require("./rambda") | ||
describe("common cases", () => { | ||
@@ -670,2 +669,30 @@ it("works with Ramda's flip", () => { | ||
it("type", () => { | ||
const fn1 = () =>{} | ||
const fn2 = function(){} | ||
function fn3(){} | ||
[ | ||
()=>{}, | ||
fn1, | ||
fn2, | ||
fn3 | ||
].map(val=>{ | ||
expect( | ||
R.type(val) | ||
).toEqual("Function") | ||
}) | ||
async function fn4(){ | ||
const a = await R.add(1,2) | ||
return a | ||
} | ||
[ | ||
async ()=>{}, | ||
fn4, | ||
].map(val=>{ | ||
expect( | ||
R.type(val) | ||
).toEqual("Async") | ||
}) | ||
expect( | ||
@@ -672,0 +699,0 @@ R.type({}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1092065
2154
648