Created
December 18, 2017 12:29
-
-
Save gladimdim/d014d71f28453c84ac239cf78e1a0ed3 to your computer and use it in GitHub Desktop.
Compiled to JS reason records
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generated by BUCKLESCRIPT VERSION 2.1.0, PLEASE EDIT WITH CARE | |
'use strict'; | |
var Block = require("bs-platform/lib/js/block.js"); | |
var Json_decode = require("bs-json/src/Json_decode.js"); | |
function createCountWithLabel(label) { | |
return /* record */[ | |
/* type_ */"COUNT", | |
/* label */label | |
]; | |
} | |
function transformToCount20(oldJson) { | |
var label = Json_decode.optional((function (param) { | |
return Json_decode.field("label", Json_decode.string, param); | |
}), oldJson); | |
if (label) { | |
return /* MetricWithLabel */Block.__(1, [/* record */[ | |
/* type_ */"COUNT", | |
/* label */label[0] | |
]]); | |
} else { | |
return /* MetricCount */Block.__(0, [/* record */[/* type_ */"COUNT"]]); | |
} | |
} | |
exports.createCountWithLabel = createCountWithLabel; | |
exports.transformToCount20 = transformToCount20; | |
/* No side effect */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment