-
omit
- called on searchState
- likely can use the babel version or spread instead
-
isEqual
- only three usages
- deep equal on props
-
used in maps too
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
file | lodash function | done | PR | |
---|---|---|---|---|
src/SearchResults/index.js | compact | x | https://github.com/algolia/algoliasearch-helper-js/pull/689 | |
src/SearchResults/index.js | findIndex | x | https://github.com/algolia/algoliasearch-helper-js/pull/687 | |
src/SearchResults/index.js | sumBy | x | https://github.com/algolia/algoliasearch-helper-js/pull/688 | |
src/SearchResults/index.js | find | x | https://github.com/algolia/algoliasearch-helper-js/pull/687 | |
src/SearchResults/index.js | orderBy | x | https://github.com/algolia/algoliasearch-helper-js/pull/698 | |
src/SearchResults/index.js | defaults | x | https://github.com/algolia/algoliasearch-helper-js/pull/692 | |
src/SearchResults/index.js | merge | x | https://github.com/algolia/algoliasearch-helper-js/pull/694 | |
src/SearchResults/index.js | isFunction | x | https://github.com/algolia/algoliasearch-helper-js/pull/656 | |
src/SearchResults/index.js | partial | x | https://github.com/algolia/algoliasearch-helper-js/pull/693 |
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(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.algoliasearchHelper = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | |
'use strict'; | |
var AlgoliaSearchHelper = require('./src/algoliasearch.helper'); | |
var SearchParameters = require('./src/SearchParameters'); | |
var SearchResults = requi |
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 'reset.scss'; | |
// Colors | |
$algolia-blue: darken(rgb(0, 174, 255), 7%); | |
$ghost: rgb(196, 200, 216); | |
$east-bay: rgb(73, 85, 136); | |
$koromiko: rgb(255, 193, 104); | |
$port-gore: rgb(58, 69, 112); |
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 connectReal from '../somewhere'; | |
jest.mock( | |
'../../internal/used-in-somewhere', | |
() => (connector: ConnectorDescription) => connector | |
); | |
// would like this to be ConnectorDescription, since the mock made it that | |
const connect: any = connectReal; |
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'; | |
module.exports = mitt; | |
/** | |
* Remove an element from an array, if it occurs | |
* | |
* @param {Array<T>} array list to modify | |
* @param {T} element element to find and remove from the array | |
*/ |
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 getHierarchicalRefinement(state, attributeName, name, resultsFacets) { | |
var facet = find(resultsFacets, {name: attributeName}); | |
var facetDeclaration = state.getHierarchicalFacetByName(attributeName); | |
var splitted = name.split(facetDeclaration.separator); | |
var configuredName = splitted[splitted.length - 1]; | |
for (var i = 0; facet !== undefined && i < splitted.length; ++i) { | |
facet = find(facet.data, {name: splitted[i]}); | |
} |
There's been another mention of InstantSearch.js being "unsafe" (it uses new Function
) instantsearch.js#3524 and instantsearch.js#2868, so I looked around to alternatives for Hogan (the templating engine).
I found these templating engines. So far I'm not sold on a single one, but here are all of them, grouped per type.
These are all returning either DOM nodes that can be used with appendChild
, or render directly into a node. Here we need to check to make sure they are (or need to be) Node-compatible (most are).
- https://yarn.pm/nanohtml (aka bel)
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 jsonToBabel(value, t) { | |
if (Array.isArray(value)) { | |
return t.arrayExpression(value.map(_value => jsonToBabel(_value, t))); | |
} | |
if (value === null) { | |
return t.identifier('null'); | |
} | |
switch (typeof value) { | |
case 'object': { | |
return t.objectExpression( |
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
solution | |
!solution/README.md |