Last active
April 2, 2019 09:58
-
-
Save krainboltgreene/27153756923d014e0cb0acd2f95cc265 to your computer and use it in GitHub Desktop.
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
Show hidden characters
{ | |
"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" | |
] | |
} | |
} | |
} |
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
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]; | |
}; | |
} |
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
babel --delete-dir-on-start --source-type module --source-maps true --out-dir './transpiled/' './index.js' |
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
"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 |
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
{"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