Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@algolia/recommend-core

Package Overview
Dependencies
Maintainers
65
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@algolia/recommend-core - npm Package Compare versions

Comparing version 1.0.0-experimental.6 to 1.0.0

2

dist/esm/version.d.ts

@@ -1,1 +0,1 @@

export declare const version = "1.0.0-experimental.2";
export declare const version = "1.0.0";

@@ -1,1 +0,1 @@

export var version = '1.0.0-experimental.2';
export var version = '1.0.0';

@@ -1,3 +0,3 @@

/*! @algolia/recommend-core 1.0.0-experimental.6 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/ui-components */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/recommend-core"]={})}(this,(function(e){"use strict";function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function o(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e){var t,r,n=e.response,c=e.maxRecommendations;return function(e,t){var r=o(t);return r.sort(e),r}((function(e,t){return(e._score||0)>(t._score||0)?-1:1}),(t="objectID",r=n.results.map((function(e){return e.hits})).flat(),o(new Map(r.map((function(e){return[e[t],e]}))).values()))).slice(0,c&&c>0?c:void 0)}var i="1.0.0-experimental.2",u=["objectIDs","recommendClient","transformItems"];function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?a(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var f=["objectIDs","recommendClient","transformItems"];function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?m(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var p=["objectIDs","recommendClient","transformItems"];function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?b(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}e.getFrequentlyBoughtTogether=function(e){var t=e.objectIDs,n=e.recommendClient,o=e.transformItems,a=void 0===o?function(e){return e}:o,f=r(e,u),m=t.map((function(e){return s(s({},f),{},{objectID:e})}));return n.addAlgoliaAgent("recommend-core",i),n.getFrequentlyBoughtTogether(m).then((function(e){return c({response:e,maxRecommendations:f.maxRecommendations})})).then((function(e){return{recommendations:a(e)}}))},e.getRecommendations=function(e){var t=e.objectIDs,n=e.recommendClient,o=e.transformItems,u=void 0===o?function(e){return e}:o,a=r(e,f),s=t.map((function(e){return l(l({},a),{},{objectID:e})}));return n.addAlgoliaAgent("recommend-core",i),n.getRecommendations(s).then((function(e){return c({response:e,maxRecommendations:a.maxRecommendations})})).then((function(e){return{recommendations:u(e)}}))},e.getRelatedProducts=function(e){var t=e.objectIDs,n=e.recommendClient,o=e.transformItems,u=void 0===o?function(e){return e}:o,a=r(e,p),s=t.map((function(e){return d(d({},a),{},{objectID:e})}));return n.addAlgoliaAgent("recommend-core",i),n.getRelatedProducts(s).then((function(e){return c({response:e,maxRecommendations:a.maxRecommendations})})).then((function(e){return{recommendations:u(e)}}))},Object.defineProperty(e,"__esModule",{value:!0})}));
/*! @algolia/recommend-core 1.0.0 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/ui-components */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/recommend-core"]={})}(this,(function(e){"use strict";function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function o(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e){var t,r,n=e.response,c=e.maxRecommendations;return function(e,t){var r=o(t);return r.sort(e),r}((function(e,t){return(e._score||0)>(t._score||0)?-1:1}),(t="objectID",r=n.results.map((function(e){return e.hits})).flat(),o(new Map(r.map((function(e){return[e[t],e]}))).values()))).slice(0,c&&c>0?c:void 0)}var i="1.0.0",u=["objectIDs","recommendClient","transformItems"];function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?a(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var f=["objectIDs","recommendClient","transformItems"];function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?m(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var p=["objectIDs","recommendClient","transformItems"];function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?b(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}e.getFrequentlyBoughtTogether=function(e){var t=e.objectIDs,n=e.recommendClient,o=e.transformItems,a=void 0===o?function(e){return e}:o,f=r(e,u),m=t.map((function(e){return s(s({},f),{},{objectID:e})}));return n.addAlgoliaAgent("recommend-core",i),n.getFrequentlyBoughtTogether(m).then((function(e){return c({response:e,maxRecommendations:f.maxRecommendations})})).then((function(e){return{recommendations:a(e)}}))},e.getRecommendations=function(e){var t=e.objectIDs,n=e.recommendClient,o=e.transformItems,u=void 0===o?function(e){return e}:o,a=r(e,f),s=t.map((function(e){return l(l({},a),{},{objectID:e})}));return n.addAlgoliaAgent("recommend-core",i),n.getRecommendations(s).then((function(e){return c({response:e,maxRecommendations:a.maxRecommendations})})).then((function(e){return{recommendations:u(e)}}))},e.getRelatedProducts=function(e){var t=e.objectIDs,n=e.recommendClient,o=e.transformItems,u=void 0===o?function(e){return e}:o,a=r(e,p),s=t.map((function(e){return d(d({},a),{},{objectID:e})}));return n.addAlgoliaAgent("recommend-core",i),n.getRelatedProducts(s).then((function(e){return c({response:e,maxRecommendations:a.maxRecommendations})})).then((function(e){return{recommendations:u(e)}}))},Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=index.js.map
{
"name": "@algolia/recommend-core",
"version": "1.0.0-experimental.6",
"version": "1.0.0",
"license": "MIT",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/algolia/ui-components",

@@ -8,5 +8,5 @@ # `@algolia/recommend-core`

```sh
yarn add @algolia/recommend-core@experimental
yarn add @algolia/recommend-core
# or
npm install @algolia/recommend-core@experimental
npm install @algolia/recommend-core
```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc