Skip to content

Instantly share code, notes, and snippets.

@krainboltgreene krainboltgreene/.babelrc
Last active Apr 2, 2019

Embed
What would you like to do?
{
"presets": [
"@babel/preset-typescript",
"@babel/env",
"minify"
],
"plugins": [
["module-resolver", {"alias": {"^@types/(.+)$": "./types/\\1"}}],
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-proposal-object-rest-spread"
],
"env": {
"test": {
"plugins": [
"istanbul",
"annotate-console-log"
]
}
}
}
import isNil from "@unction/isnil";
export default function get (name) {
return function getProperty (keyedFunctor) {
if (isNil(keyedFunctor)) {
return keyedFunctor;
}
if (keyedFunctor.get) {
return keyedFunctor.get(name);
}
return keyedFunctor[name];
};
}
babel --delete-dir-on-start --source-type module --source-maps true --out-dir './transpiled/' './index.js'
"use strict";var _isnil=_interopRequireDefault(require("@unction/isnil"));Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=get;function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function get(a){return function(b){return(0,_isnil.default)(b)?b:b.get?b.get(a):b[a]}}
//# sourceMappingURL=index.js.map
{"version":3,"sources":["../index.js"],"names":["get","name","keyedFunctor"],"mappings":"aAAA,6D,mJACe,QAASA,CAAAA,GAAT,CAAaC,CAAb,CAAmB,CAChC,MAAO,UAAqBC,CAArB,CAAmC,OACpC,mBAAMA,CAAN,CADoC,CAE/BA,CAF+B,CAKpCA,CAAY,CAACF,GALuB,CAM/BE,CAAY,CAACF,GAAb,CAAiBC,CAAjB,CAN+B,CASjCC,CAAY,CAACD,CAAD,CACpB,CACF","sourcesContent":["import isNil from \"@unction/isnil\";\nexport default function get(name) {\n return function getProperty(keyedFunctor) {\n if (isNil(keyedFunctor)) {\n return keyedFunctor;\n }\n\n if (keyedFunctor.get) {\n return keyedFunctor.get(name);\n }\n\n return keyedFunctor[name];\n };\n}\n"],"file":"index.js"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.