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
| var complexPredicate = function (a, b, c) { | |
| ... | |
| }; | |
| //a, b, c are available in aVal, bVal, cVal | |
| var precalculatedPredicate = _constant( | |
| complexPredicate( | |
| aVal, | |
| bVal, | |
| cVal |
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
| var myJLayoutWrapper = _createJLayoutWrapper( | |
| trivialHandlePosition, | |
| precalcuatedPredicate, | |
| _.noop //not interessted in putting in a valid size | |
| ); |
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
| { | |
| a: ["1","2"], | |
| b: "3" | |
| } |
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
| var UrlSearch = require("./url-search"); | |
| describe("objectizeUrlSearch", function () { | |
| it("should convert search string to search object", function() { | |
| var | |
| urlSearch = "a=1&a=2&b=3", | |
| searchObject = { | |
| "a": ["1","2"], | |
| "b": "3" | |
| }; | |
| expect(UrlSearch.objectizeUrlSearch(urlSearch)) |
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
| ['a=1','a=2', 'b=3'] |
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
| [['a', '1'], ['a', '2'], ['b', '3']] |
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
| function objectizeUrlSearch (paramString) { | |
| var | |
| pairStrings = paramString.split('&'), | |
| pairs = [], | |
| result = {}, | |
| i; | |
| for (i = 0; i < pairStrings.length; i++) { | |
| pairs.push(pairStrings[i].split('=')); | |
| } |
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
| var R = require('ramda'); | |
| var | |
| //[[key, value]] -> {key: [[key, value]]} | |
| groupByKey = R.groupBy(R.head), | |
| //{'':a, 'b':b} -> {'b':b} | |
| rejectEmptyKeys = R.pickBy(function(value, key) {return key !== '';}), | |
| //[[key, value]] -> [value | undefined] |
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
| "a=1&a=2&b=3" |
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
| { | |
| a: [ | |
| ['a', '1'], | |
| ['a', '2'] | |
| ], | |
| b: [ | |
| ['b', '3'] | |
| ] | |
| } |