@venncity/clou-utils
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -6,2 +6,10 @@ # Change Log | ||
## [2.0.1](https://github.com/venn-city/graphql-clou/compare/@venncity/clou-utils@2.0.0...@venncity/clou-utils@2.0.1) (2020-05-11) | ||
**Note:** Version bump only for package @venncity/clou-utils | ||
# [2.0.0](https://github.com/venn-city/graphql-clou/compare/@venncity/clou-utils@1.2.1...@venncity/clou-utils@2.0.0) (2020-01-01) | ||
@@ -8,0 +16,0 @@ |
{ | ||
"name": "@venncity/clou-utils", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"author": "Venn Engineering", | ||
@@ -45,3 +45,3 @@ "main": "src/index.js", | ||
}, | ||
"gitHead": "ad34bf71961e80cc7b7610c51a8895bdf8a960c8" | ||
"gitHead": "ac73820a929100023a12c8bb55dd83e7f2653de9" | ||
} |
@@ -20,2 +20,3 @@ /* eslint-disable no-unused-vars */ | ||
function transformer({ | ||
transformers = [], | ||
transformKey = (v, k) => k, | ||
@@ -27,2 +28,8 @@ transformValue = (v, k) => v, | ||
function transform(value, key) { | ||
const tranformer = transformers.find(({ cond }) => { | ||
return cond(value); | ||
}); | ||
if (tranformer) { | ||
return tranformer.func(value, key, transform); | ||
} | ||
if (Array.isArray(value)) { | ||
@@ -29,0 +36,0 @@ return transformArray(value, key, transform); |
13646
305