New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

algoliasearch-helper

Package Overview
Dependencies
Maintainers
6
Versions
154
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

algoliasearch-helper - npm Package Compare versions

Comparing version

to
2.8.0

2

bower.json
{
"name": "algoliasearch-helper",
"version": "2.7.0",
"version": "2.8.0",
"homepage": "https://github.com/algolia/algoliasearch-helper-js",

@@ -5,0 +5,0 @@ "authors": [

{
"name": "algoliasearch-helper",
"version": "2.7.0",
"version": "2.8.0",
"description": "Helper for implementing advanced search features with algolia",

@@ -52,4 +52,4 @@ "main": "index.js",

"algoliasearch": "latest",
"browserify": "^11.2.0",
"browzers": "^1.0.0",
"browserify": "^12.0.1",
"browzers": "^1.3.0",
"bulk-require": "^0.2.1",

@@ -67,3 +67,3 @@ "bulkify": "^1.1.1",

"mversion": "^1.10.1",
"npm-shrinkwrap": "^5.4.1",
"npm-shrinkwrap": "^200.4.0",
"onchange": "^2.0.0",

@@ -77,4 +77,4 @@ "opn-cli": "^1.0.0",

"uglify-js": "^2.5.0",
"watchify": "^3.5.0",
"zuul": "^3.7.1",
"watchify": "^3.6.1",
"zuul": "^3.8.0",
"zuul-ngrok": "3.0.0"

@@ -81,0 +81,0 @@ },

@@ -32,24 +32,25 @@ *Coming from V1 (or js client v2)?* Read the [migration guide](https://github.com/algolia/algoliasearch-helper-js/wiki/Migration-guide-:-V1-to-V2) to the new version of the Helper.

- [Features](#features)
- [Example](#example)
- [Helper cheatsheet](#helper-cheatsheet)
- [Add the helper in your project](#add-the-helper-in-your-project)
- [Regular `<script>` tag](#regular-script-tag)
- [With NPM](#with-npm)
- [With bower](#with-bower)
- [Init the helper](#init-the-helper)
- [Helper lifecycle](#helper-lifecycle)
- [Objects](#objects)
- [Search](#search)
- [Events](#events)
- [Query](#query)
- [Filtering results](#filtering-results)
- [Facet utilities](#facet-utilities)
- [Tags](#tags)
- [Pagination](#pagination)
- [Index](#index)
- [One time query](#one-time-query)
- [URL Helpers](#url-helpers)
- [Query parameters](#query-parameters)
- [Results format](#results-format)
- [Features](#features)
- [Example](#example)
- [Helper cheatsheet](#helper-cheatsheet)
- [Add the helper in your project](#add-the-helper-in-your-project)
- [Regular `<script>` tag](#regular-script-tag)
- [With NPM](#with-npm)
- [With bower](#with-bower)
- [Init the helper](#init-the-helper)
- [Helper lifecycle](#helper-lifecycle)
- [Objects](#objects)
- [Search](#search)
- [Events](#events)
- [Query](#query)
- [Filtering results](#filtering-results)
- [Facet utilities](#facet-utilities)
- [Tags](#tags)
- [Pagination](#pagination)
- [Index](#index)
- [One time query](#one-time-query)
- [URL Helpers](#url-helpers)
- [Query parameters](#query-parameters)
- [Results format](#results-format)
- [Browser support](#browser-support)

@@ -1302,1 +1303,13 @@ <!-- END doctoc generated TOC please keep comment here to allow auto update -->

```
# Browser support
This project works fine on any [ES5](https://en.wikipedia.org/wiki/ECMAScript#5th_Edition) browser, basically >= IE9+.
To get IE8 support you will have to include this:
<!--[if lte IE 8]>
<script src="//cdn.jsdelivr.net/core-js/2/shim.min.js"></script>
<![endif]-->
Which will simulate most of the ES5 features in IE8.

@@ -55,3 +55,3 @@ 'use strict';

* @example <caption>SearchParameters of the first query in
* <a href="http://demos.algolia.com/instant-search-demo">the instant search demo</a></caption>
* <a href="http://demos.algolia.com/instant-search-demo/">the instant search demo</a></caption>
{

@@ -162,3 +162,19 @@ "query": "",

/**
* Contains the optional tag filters in the raw format of the Algolia API.
* @private
* @see https://www.algolia.com/doc/rest#param-tagFilters
* @member {string}
*/
this.optionalTagFilters = params.optionalTagFilters;
/**
* Contains the optional facet filters in the raw format of the Algolia API.
* @private
* @see https://www.algolia.com/doc/rest#param-tagFilters
* @member {string}
*/
this.optionalFacetFilters = params.optionalFacetFilters;
// Misc. parameters

@@ -165,0 +181,0 @@ /**

@@ -53,3 +53,5 @@ 'use strict';

tagRefinements: 'tR',
typoTolerance: 'tT'
typoTolerance: 'tT',
optionalTagFilters: 'oTF',
optionalFacetFilters: 'oFF'
};

@@ -56,0 +58,0 @@

@@ -77,2 +77,3 @@ 'use strict';

/*eslint-disable */
/**

@@ -85,3 +86,4 @@ * Constructor for SearchResults

* @param {object} algoliaResponse the response from algolia client
* @example <caption>SearchResults of the first query in <a href="http://demos.algolia.com/instant-search-demo">the instant search demo</a></caption>
* @example <caption>SearchResults of the first query in
* <a href="http://demos.algolia.com/instant-search-demo">the instant search demo</a></caption>
{

@@ -208,2 +210,3 @@ "hitsPerPage": 10,

**/
/*eslint-enable */
function SearchResults(state, algoliaResponse) {

@@ -218,2 +221,7 @@ var mainSubResponse = algoliaResponse.results[0];

/**
* The query as parsed by the engine given all the rules.
* @member {string}
*/
this.parsedQuery = mainSubResponse.parsedQuery;
/**
* all the records that match the search parameters. It also contains _highlightResult,

@@ -255,2 +263,31 @@ * which describe which and how the attributes are matched.

/**
* The position if the position was guessed by IP.
* @member {string}
* @example "48.8637,2.3615",
*/
this.aroundLatLng = mainSubResponse.aroundLatLng;
/**
* The radius computed by Algolia.
* @member {string}
* @example "126792922",
*/
this.automaticRadius = mainSubResponse.automaticRadius;
/**
* String identifying the server used to serve this request.
* @member {string}
* @example "c7-use-2.algolia.net",
*/
this.serverUsed = mainSubResponse.serverUsed;
/**
* Boolean that indicates if the computation of the counts did time out.
* @member {boolean}
*/
this.timeoutCounts = mainSubResponse.timeoutCounts;
/**
* Boolean that indicates if the computation of the hits did time out.
* @member {boolean}
*/
this.timeoutHits = mainSubResponse.timeoutHits;
/**
* disjunctive facets results

@@ -282,10 +319,16 @@ * @member {SearchResults.Facet[]}

forEach(mainSubResponse.facets, function(facetValueObject, facetKey) {
var hierarchicalFacet = findMatchingHierarchicalFacetFromAttributeName(state.hierarchicalFacets, facetKey);
var hierarchicalFacet = findMatchingHierarchicalFacetFromAttributeName(
state.hierarchicalFacets,
facetKey
);
if (hierarchicalFacet) {
this.hierarchicalFacets[findIndex(state.hierarchicalFacets, {name: hierarchicalFacet.name})].push({
// Place the hierarchicalFacet data at the correct index depending on the attributes order that was defined at the
// helper initialization
var facetIndex = hierarchicalFacet.attributes.indexOf(facetKey);
this.hierarchicalFacets[findIndex(state.hierarchicalFacets, {name: hierarchicalFacet.name})][facetIndex] = {
attribute: facetKey,
data: facetValueObject,
exhaustive: mainSubResponse.exhaustiveFacetsCount
});
};
} else {

@@ -317,2 +360,5 @@ var isFacetDisjunctive = indexOf(state.disjunctiveFacets, facetKey) !== -1;

// Make sure we do not keep wholes within the hierarchical facets
this.hierarchicalFacets = compact(this.hierarchicalFacets);
// aggregate the refined disjunctive facets

@@ -336,3 +382,7 @@ forEach(disjunctiveFacets, function(disjunctiveFacet) {

this.hierarchicalFacets[position][attributeIndex].data = merge({}, this.hierarchicalFacets[position][attributeIndex].data, facetResults);
this.hierarchicalFacets[position][attributeIndex].data = merge(
{},
this.hierarchicalFacets[position][attributeIndex].data,
facetResults
);
} else {

@@ -367,2 +417,3 @@ position = disjunctiveFacetsIndices[dfacet];

var hierarchicalFacet = state.getHierarchicalFacetByName(refinedFacet);
var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet);

@@ -372,3 +423,3 @@ var currentRefinement = state.getHierarchicalRefinement(refinedFacet);

// root level values request
if (currentRefinement.length === 0 || currentRefinement[0].split(state._getHierarchicalFacetSeparator(hierarchicalFacet)).length < 2) {
if (currentRefinement.length === 0 || currentRefinement[0].split(separator).length < 2) {
return;

@@ -399,7 +450,11 @@ }

if (currentRefinement.length > 0) {
var root = currentRefinement[0].split(state._getHierarchicalFacetSeparator(hierarchicalFacet))[0];
var root = currentRefinement[0].split(separator)[0];
defaultData[root] = this.hierarchicalFacets[position][attributeIndex].data[root];
}
this.hierarchicalFacets[position][attributeIndex].data = defaults(defaultData, facetResults, this.hierarchicalFacets[position][attributeIndex].data);
this.hierarchicalFacets[position][attributeIndex].data = defaults(
defaultData,
facetResults,
this.hierarchicalFacets[position][attributeIndex].data
);
}, this);

@@ -406,0 +461,0 @@

'use strict';
module.exports = '2.7.0';
module.exports = '2.8.0';

@@ -10,4 +10,4 @@ 'use strict';

}],
html: './test/ie8-polyfill.html',
scripts: [
// browser integration tests will use the dist file, so that we test the

@@ -14,0 +14,0 @@ // build process also

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet