made with esnextbin
Created
February 17, 2016 18:16
-
-
Save bfitch/6353574361776965ec2e to your computer and use it in GitHub Desktop.
esnextbin sketch
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>ESNextbin Sketch</title> | |
<!-- put additional styles and scripts here --> | |
</head> | |
<body> | |
<div id="app"></div> | |
</body> | |
</html> |
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 _ from 'lodash'; | |
function toCerebralPath(query) { | |
return _.reject( | |
query.split(/\[|\]|'/g), | |
path => _.isEmpty(path) || path === ',') | |
} | |
console.log(toCerebralPath("userLoggedIn['credits_balance','usd_balance']")) |
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
{ | |
"name": "esnextbin-sketch", | |
"version": "0.0.0", | |
"dependencies": { | |
"lodash": "4.0.0" | |
} | |
} |
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 _lodash = require('lodash'); | |
var _lodash2 = _interopRequireDefault(_lodash); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function toCerebralPath(query) { | |
return _lodash2.default.reject(query.split(/\[|\]|'/g), function (path) { | |
return _lodash2.default.isEmpty(path) || path === ','; | |
}); | |
} | |
console.log(toCerebralPath("userLoggedIn['credits_balance','usd_balance']")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment