@appbaseio/reactivecore
Advanced tools
Comparing version 8.2.19 to 9.0.0
@@ -1,1 +0,1 @@ | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.setQuery=setQuery;exports.updateQueryOptions=updateQueryOptions;exports.logQuery=logQuery;exports.logCombinedQuery=logCombinedQuery;exports.setStreaming=setStreaming;exports.setHeaders=setHeaders;exports.setPromotedResults=setPromotedResults;exports.executeQuery=executeQuery;exports.setQueryOptions=setQueryOptions;exports.updateQuery=updateQuery;exports.loadMore=loadMore;exports.setQueryListener=setQueryListener;var _constants=require('../constants');var _value=require('./value');var _hits=require('./hits');var _helper=require('../utils/helper');var _analytics=require('../utils/analytics');var _analytics2=_interopRequireDefault(_analytics);var _maps=require('./maps');var _graphQL=require('../utils/graphQL');var _graphQL2=_interopRequireDefault(_graphQL);var _constants2=require('../../lib/utils/constants');function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++){arr2[i]=arr[i];}return arr2;}else{return Array.from(arr);}}function setQuery(component,query){return{type:_constants.SET_QUERY,component:component,query:query};}function updateQueryOptions(component,options){return{type:_constants.SET_QUERY_OPTIONS,component:component,options:options};}function logQuery(component,query){return{type:_constants.LOG_QUERY,component:component,query:query};}function logCombinedQuery(component,query){return{type:_constants.LOG_COMBINED_QUERY,component:component,query:query};}function setLoading(component,isLoading){return{type:_constants.SET_LOADING,component:component,isLoading:isLoading};}function setError(component,error){return{type:_constants.SET_ERROR,component:component,error:error};}function setTimestamp(component,timestamp){return{type:_constants.SET_TIMESTAMP,component:component,timestamp:timestamp};}function setStreaming(component){var status=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var ref=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;return{type:_constants.SET_STREAMING,component:component,status:status,ref:ref};}function setHeaders(headers){return{type:_constants.SET_HEADERS,headers:headers};}function setPromotedResults(){var results=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];return{type:_constants.SET_PROMOTED_RESULTS,results:results};}function setSearchId(){var searchId=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;return{type:_constants.SET_SEARCH_ID,searchId:searchId};}function setSuggestionsSearchId(){var searchId=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;return{type:_constants.SET_SUGGESTIONS_SEARCH_ID,searchId:searchId};}function msearch(query,orderOfQueries){var appendToHits=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var isInternalComponent=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var appendToAggs=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;var componentType=arguments[5];return function(dispatch,getState){var _getState=getState(),appbaseRef=_getState.appbaseRef,config=_getState.config,headers=_getState.headers,queryListener=_getState.queryListener,analytics=_getState.analytics,selectedValues=_getState.selectedValues;var searchHeaders={};var suggestionsComponents=[_constants2.componentTypes.dataSearch,_constants2.componentTypes.categorySearch];var isSuggestionsQuery=isInternalComponent&&suggestionsComponents.indexOf(componentType)!==-1;if(config.analytics){if(config.analyticsConfig.suggestionAnalytics&&isSuggestionsQuery){var suggestionsSearchValue=analytics.suggestionsSearchValue;var shouldIncludeQuery=!!(config.analyticsConfig.emptyQuery||suggestionsSearchValue);if(shouldIncludeQuery){searchHeaders={'X-Search-Query':suggestionsSearchValue||''};}}else{var searchValue=analytics.searchValue,searchId=analytics.searchId;var filterString=(0,_analytics2.default)(selectedValues);if(searchId){searchHeaders=_extends({'X-Search-Id':searchId,'X-Search-Query':searchValue},filterString&&{'X-Search-Filters':filterString});}else{var _shouldIncludeQuery=!!(config.analyticsConfig.emptyQuery||searchValue);searchHeaders=_extends(_shouldIncludeQuery&&{'X-Search-Query':searchValue||''},filterString&&{'X-Search-Filters':filterString});}}if(config.analyticsConfig.searchStateHeader){var searchState=(0,_helper.getSearchState)(getState(),true);if(searchState&&Object.keys(searchState).length){searchHeaders['X-Search-State']=JSON.stringify(searchState);}}if(config.analyticsConfig.userId){searchHeaders['X-User-Id']=config.analyticsConfig.userId;}if(config.analyticsConfig.customEvents){searchHeaders['X-Search-CustomEvent']=(0,_analytics.parseCustomEvents)(config.analyticsConfig.customEvents);}}orderOfQueries.forEach(function(component){dispatch(setLoading(component,true));});var handleTransformResponse=function handleTransformResponse(res,component){if(config.transformResponse&&typeof config.transformResponse==='function'){return config.transformResponse(res,component);}return new Promise(function(resolve){return resolve(res);});};var handleError=function handleError(error){console.error(error);orderOfQueries.forEach(function(component){if(queryListener[component]&&queryListener[component].onError){queryListener[component].onError(error);}dispatch(setError(component,error));dispatch(setLoading(component,false));});};var handleResponse=function handleResponse(res){var searchId=res._headers?res._headers.get('X-Search-Id'):null;if(searchId){if(isSuggestionsQuery){dispatch(setSuggestionsSearchId(searchId));}else{dispatch(setSearchId(searchId));}}orderOfQueries.forEach(function(component,index){handleTransformResponse(res.responses[index],component).then(function(response){var _getState2=getState(),timestamp=_getState2.timestamp;if(timestamp[component]===undefined||timestamp[component]<res._timestamp){var promotedResults=response.promoted||res.promoted;if(promotedResults){dispatch(setPromotedResults(promotedResults));}else{dispatch(setPromotedResults());}if(response.hits){dispatch(setTimestamp(component,res._timestamp));dispatch((0,_hits.updateHits)(component,response.hits,response.took,appendToHits));dispatch(setLoading(component,false));}if(response.aggregations){dispatch((0,_hits.updateAggs)(component,response.aggregations,appendToAggs));dispatch((0,_hits.updateCompositeAggs)(component,response.aggregations,appendToAggs));}}}).catch(function(err){handleError(err);});});};if(config.graphQLUrl){(0,_graphQL2.default)(config.graphQLUrl,config.url,config.credentials,config.app,query).then(function(res){handleResponse(res);}).catch(function(err){handleError(err);});}else{appbaseRef.setHeaders(_extends({},headers,searchHeaders));appbaseRef.msearch({type:config.type==='*'?'':config.type,body:query}).then(function(res){handleResponse(res);}).catch(function(err){handleError(err);});}};}function executeQueryListener(listener,oldQuery,newQuery){if(listener&&listener.onQueryChange){listener.onQueryChange(oldQuery,newQuery);}}function executeQuery(componentId){var executeWatchList=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var mustExecuteMapQuery=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var componentType=arguments[3];return function(dispatch,getState){var _getState3=getState(),queryLog=_getState3.queryLog,stream=_getState3.stream,appbaseRef=_getState3.appbaseRef,config=_getState3.config,mapData=_getState3.mapData,watchMan=_getState3.watchMan,dependencyTree=_getState3.dependencyTree,queryList=_getState3.queryList,queryOptions=_getState3.queryOptions,queryListener=_getState3.queryListener;var orderOfQueries=[];var finalQuery=[];var matchAllQuery={match_all:{}};var componentList=[componentId];if(executeWatchList){var watchList=watchMan[componentId]||[];componentList=[].concat(_toConsumableArray(componentList),_toConsumableArray(watchList));}componentList.forEach(function(component){var _buildQuery=(0,_helper.buildQuery)(component,dependencyTree,queryList,queryOptions),queryObj=_buildQuery.queryObj,options=_buildQuery.options;var validOptions=['aggs','from','sort'];if(queryObj&&!!Object.keys(queryObj).length||options&&Object.keys(options).some(function(item){return validOptions.includes(item);})){if(!queryObj||queryObj&&!Object.keys(queryObj).length){queryObj=_extends({},matchAllQuery);}var currentQuery=_extends({query:_extends({},queryObj)},options,queryOptions[component]);var queryToLog=_extends({query:_extends({},queryObj)},options,queryOptions[component]);var oldQuery=queryLog[component];if(mustExecuteMapQuery||!(0,_helper.isEqual)(currentQuery,oldQuery)){orderOfQueries=[].concat(_toConsumableArray(orderOfQueries),[component]);dispatch(logQuery(component,queryToLog));var isMapComponent=Object.keys(mapData).includes(component);if(isMapComponent&&mapData[component].query){var existingQuery=currentQuery.query;currentQuery.query={bool:{must:[existingQuery,mapData[component].query]}};if(!mapData[component].persistMapQuery){dispatch((0,_maps.updateMapData)(componentId,null,false));}var _getState4=getState(),combinedLog=_getState4.combinedLog;if((0,_helper.isEqual)(combinedLog[component],currentQuery))return;dispatch(logCombinedQuery(component,currentQuery));}executeQueryListener(queryListener[component],oldQuery,currentQuery);if(stream[component]&&stream[component].status){if(stream[component].ref){stream[component].ref.stop();}var ref=appbaseRef.searchStream({type:config.type==='*'?'':config.type,body:currentQuery},function(response){if(response._id){dispatch((0,_hits.pushToStreamHits)(component,response));}},function(error){if(queryListener[component]&&queryListener[component].onError){queryListener[component].onError(error);}console.warn(error);dispatch(setError(component,error));dispatch(setLoading(component,false));});dispatch(setStreaming(component,true,ref));}finalQuery=[].concat(_toConsumableArray(finalQuery),[{preference:component},currentQuery]);}}});if(finalQuery.length){dispatch(msearch(finalQuery,orderOfQueries,false,componentId.endsWith('__internal'),undefined,componentType));}};}function setQueryOptions(component,queryOptions){var execute=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;return function(dispatch){dispatch(updateQueryOptions(component,queryOptions));if(execute){dispatch(executeQuery(component,true));}};}function updateQuery(_ref){var componentId=_ref.componentId,query=_ref.query,value=_ref.value,_ref$label=_ref.label,label=_ref$label===undefined?null:_ref$label,_ref$showFilter=_ref.showFilter,showFilter=_ref$showFilter===undefined?true:_ref$showFilter,_ref$URLParams=_ref.URLParams,URLParams=_ref$URLParams===undefined?false:_ref$URLParams,_ref$componentType=_ref.componentType,componentType=_ref$componentType===undefined?null:_ref$componentType,_ref$category=_ref.category,category=_ref$category===undefined?null:_ref$category;var execute=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;return function(dispatch){var queryToDispatch=query;if(query&&query.query){queryToDispatch=query.query;}if(!componentId.endsWith('__internal')){dispatch((0,_value.setValue)(componentId,value,label,showFilter,URLParams,componentType,category));}dispatch(setQuery(componentId,queryToDispatch));if(execute)dispatch(executeQuery(componentId,true,false,componentType));};}function loadMore(component,newOptions){var appendToHits=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;var appendToAggs=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;return function(dispatch,getState){var store=getState();var _buildQuery2=(0,_helper.buildQuery)(component,store.dependencyTree,store.queryList,store.queryOptions),queryObj=_buildQuery2.queryObj,options=_buildQuery2.options;var queryLog=store.queryLog;if(!options)options={};options=_extends({},options,newOptions);if(!queryObj||queryObj&&!Object.keys(queryObj).length){queryObj={match_all:{}};}var currentQuery=_extends({query:_extends({},queryObj)},options);if((0,_helper.isEqual)(queryLog[component],currentQuery))return;dispatch(logQuery(component,currentQuery));var finalQuery=[{preference:component},currentQuery];dispatch(msearch(finalQuery,[component],appendToHits,false,appendToAggs));};}function setQueryListener(component,onQueryChange,onError){return{type:_constants.SET_QUERY_LISTENER,component:component,onQueryChange:onQueryChange,onError:onError};} | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.setQuery=setQuery;exports.updateQueryOptions=updateQueryOptions;exports.logQuery=logQuery;exports.logCombinedQuery=logCombinedQuery;exports.setStreaming=setStreaming;exports.setHeaders=setHeaders;exports.setPromotedResults=setPromotedResults;exports.executeQuery=executeQuery;exports.setQueryOptions=setQueryOptions;exports.updateQuery=updateQuery;exports.loadMore=loadMore;exports.setQueryListener=setQueryListener;var _constants=require('../constants');var _value=require('./value');var _hits=require('./hits');var _helper=require('../utils/helper');var _analytics=require('../utils/analytics');var _analytics2=_interopRequireDefault(_analytics);var _maps=require('./maps');var _graphQL=require('../utils/graphQL');var _graphQL2=_interopRequireDefault(_graphQL);var _constants2=require('../../lib/utils/constants');function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++){arr2[i]=arr[i];}return arr2;}else{return Array.from(arr);}}function setQuery(component,query){return{type:_constants.SET_QUERY,component:component,query:query};}function updateQueryOptions(component,options){return{type:_constants.SET_QUERY_OPTIONS,component:component,options:options};}function logQuery(component,query){return{type:_constants.LOG_QUERY,component:component,query:query};}function logCombinedQuery(component,query){return{type:_constants.LOG_COMBINED_QUERY,component:component,query:query};}function setLoading(component,isLoading){return{type:_constants.SET_LOADING,component:component,isLoading:isLoading};}function setError(component,error){return{type:_constants.SET_ERROR,component:component,error:error};}function setTimestamp(component,timestamp){return{type:_constants.SET_TIMESTAMP,component:component,timestamp:timestamp};}function setStreaming(component){var status=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var ref=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;return{type:_constants.SET_STREAMING,component:component,status:status,ref:ref};}function setHeaders(headers){return{type:_constants.SET_HEADERS,headers:headers};}function setPromotedResults(){var results=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var component=arguments[1];return{type:_constants.SET_PROMOTED_RESULTS,results:results,component:component};}function setSearchId(){var searchId=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;return{type:_constants.SET_SEARCH_ID,searchId:searchId};}function setSuggestionsSearchId(){var searchId=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;return{type:_constants.SET_SUGGESTIONS_SEARCH_ID,searchId:searchId};}function msearch(query,orderOfQueries){var appendToHits=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var isInternalComponent=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var appendToAggs=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;var componentType=arguments[5];return function(dispatch,getState){var _getState=getState(),appbaseRef=_getState.appbaseRef,config=_getState.config,headers=_getState.headers,queryListener=_getState.queryListener,analytics=_getState.analytics,selectedValues=_getState.selectedValues;var searchHeaders={};var suggestionsComponents=[_constants2.componentTypes.dataSearch,_constants2.componentTypes.categorySearch];var isSuggestionsQuery=isInternalComponent&&suggestionsComponents.indexOf(componentType)!==-1;if(config.analytics){if(config.analyticsConfig.suggestionAnalytics&&isSuggestionsQuery){var suggestionsSearchValue=analytics.suggestionsSearchValue;var shouldIncludeQuery=!!(config.analyticsConfig.emptyQuery||suggestionsSearchValue);if(shouldIncludeQuery){searchHeaders={'X-Search-Query':suggestionsSearchValue||''};}}else{var searchValue=analytics.searchValue,searchId=analytics.searchId;var filterString=(0,_analytics2.default)(selectedValues);if(searchId){searchHeaders=_extends({'X-Search-Id':searchId,'X-Search-Query':searchValue},filterString&&{'X-Search-Filters':filterString});}else{var _shouldIncludeQuery=!!(config.analyticsConfig.emptyQuery||searchValue);searchHeaders=_extends(_shouldIncludeQuery&&{'X-Search-Query':searchValue||''},filterString&&{'X-Search-Filters':filterString});}}if(config.analyticsConfig.searchStateHeader){var searchState=(0,_helper.getSearchState)(getState(),true);if(searchState&&Object.keys(searchState).length){searchHeaders['X-Search-State']=JSON.stringify(searchState);}}if(config.analyticsConfig.userId){searchHeaders['X-User-Id']=config.analyticsConfig.userId;}if(config.analyticsConfig.customEvents){searchHeaders['X-Search-CustomEvent']=(0,_analytics.parseCustomEvents)(config.analyticsConfig.customEvents);}}orderOfQueries.forEach(function(component){dispatch(setLoading(component,true));});var handleTransformResponse=function handleTransformResponse(res,component){if(config.transformResponse&&typeof config.transformResponse==='function'){return config.transformResponse(res,component);}return new Promise(function(resolve){return resolve(res);});};var handleError=function handleError(error){console.error(error);orderOfQueries.forEach(function(component){if(queryListener[component]&&queryListener[component].onError){queryListener[component].onError(error);}dispatch(setError(component,error));dispatch(setLoading(component,false));});};var handleResponse=function handleResponse(res){var searchId=res._headers?res._headers.get('X-Search-Id'):null;if(searchId){if(isSuggestionsQuery){dispatch(setSuggestionsSearchId(searchId));}else{dispatch(setSearchId(searchId));}}orderOfQueries.forEach(function(component,index){handleTransformResponse(res.responses[index],component).then(function(response){var _getState2=getState(),timestamp=_getState2.timestamp;if(timestamp[component]===undefined||timestamp[component]<res._timestamp){var promotedResults=response.promoted||res.promoted;if(promotedResults){dispatch(setPromotedResults(promotedResults,component));}else{dispatch(setPromotedResults([],component));}if(response.hits){dispatch(setTimestamp(component,res._timestamp));dispatch((0,_hits.updateHits)(component,response.hits,response.took,appendToHits));dispatch(setLoading(component,false));}if(response.aggregations){dispatch((0,_hits.updateAggs)(component,response.aggregations,appendToAggs));dispatch((0,_hits.updateCompositeAggs)(component,response.aggregations,appendToAggs));}}}).catch(function(err){handleError(err);});});};if(config.graphQLUrl){(0,_graphQL2.default)(config.graphQLUrl,config.url,config.credentials,config.app,query).then(function(res){handleResponse(res);}).catch(function(err){handleError(err);});}else{appbaseRef.setHeaders(_extends({},headers,searchHeaders));appbaseRef.msearch({type:config.type==='*'?'':config.type,body:query}).then(function(res){handleResponse(res);}).catch(function(err){handleError(err);});}};}function executeQueryListener(listener,oldQuery,newQuery){if(listener&&listener.onQueryChange){listener.onQueryChange(oldQuery,newQuery);}}function executeQuery(componentId){var executeWatchList=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var mustExecuteMapQuery=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var componentType=arguments[3];return function(dispatch,getState){var _getState3=getState(),queryLog=_getState3.queryLog,stream=_getState3.stream,appbaseRef=_getState3.appbaseRef,config=_getState3.config,mapData=_getState3.mapData,watchMan=_getState3.watchMan,dependencyTree=_getState3.dependencyTree,queryList=_getState3.queryList,queryOptions=_getState3.queryOptions,queryListener=_getState3.queryListener;var orderOfQueries=[];var finalQuery=[];var matchAllQuery={match_all:{}};var componentList=[componentId];if(executeWatchList){var watchList=watchMan[componentId]||[];componentList=[].concat(_toConsumableArray(componentList),_toConsumableArray(watchList));}componentList.forEach(function(component){var _buildQuery=(0,_helper.buildQuery)(component,dependencyTree,queryList,queryOptions),queryObj=_buildQuery.queryObj,options=_buildQuery.options;var validOptions=['aggs','from','sort'];if(queryObj&&!!Object.keys(queryObj).length||options&&Object.keys(options).some(function(item){return validOptions.includes(item);})){if(!queryObj||queryObj&&!Object.keys(queryObj).length){queryObj=_extends({},matchAllQuery);}var currentQuery=_extends({query:_extends({},queryObj)},options,queryOptions[component]);var queryToLog=_extends({query:_extends({},queryObj)},options,queryOptions[component]);var oldQuery=queryLog[component];if(mustExecuteMapQuery||!(0,_helper.isEqual)(currentQuery,oldQuery)){orderOfQueries=[].concat(_toConsumableArray(orderOfQueries),[component]);dispatch(logQuery(component,queryToLog));var isMapComponent=Object.keys(mapData).includes(component);if(isMapComponent&&mapData[component].query){var existingQuery=currentQuery.query;currentQuery.query={bool:{must:[existingQuery,mapData[component].query]}};if(!mapData[component].persistMapQuery){dispatch((0,_maps.updateMapData)(componentId,null,false));}var _getState4=getState(),combinedLog=_getState4.combinedLog;if((0,_helper.isEqual)(combinedLog[component],currentQuery))return;dispatch(logCombinedQuery(component,currentQuery));}executeQueryListener(queryListener[component],oldQuery,currentQuery);if(stream[component]&&stream[component].status){if(stream[component].ref){stream[component].ref.stop();}var ref=appbaseRef.searchStream({type:config.type==='*'?'':config.type,body:currentQuery},function(response){if(response._id){dispatch((0,_hits.pushToStreamHits)(component,response));}},function(error){if(queryListener[component]&&queryListener[component].onError){queryListener[component].onError(error);}console.warn(error);dispatch(setError(component,error));dispatch(setLoading(component,false));});dispatch(setStreaming(component,true,ref));}finalQuery=[].concat(_toConsumableArray(finalQuery),[{preference:component},currentQuery]);}}});if(finalQuery.length){dispatch(msearch(finalQuery,orderOfQueries,false,componentId.endsWith('__internal'),undefined,componentType));}};}function setQueryOptions(component,queryOptions){var execute=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;return function(dispatch){dispatch(updateQueryOptions(component,queryOptions));if(execute){dispatch(executeQuery(component,true));}};}function updateQuery(_ref){var componentId=_ref.componentId,query=_ref.query,value=_ref.value,_ref$label=_ref.label,label=_ref$label===undefined?null:_ref$label,_ref$showFilter=_ref.showFilter,showFilter=_ref$showFilter===undefined?true:_ref$showFilter,_ref$URLParams=_ref.URLParams,URLParams=_ref$URLParams===undefined?false:_ref$URLParams,_ref$componentType=_ref.componentType,componentType=_ref$componentType===undefined?null:_ref$componentType,_ref$category=_ref.category,category=_ref$category===undefined?null:_ref$category;var execute=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;return function(dispatch){var queryToDispatch=query;if(query&&query.query){queryToDispatch=query.query;}if(!componentId.endsWith('__internal')){dispatch((0,_value.setValue)(componentId,value,label,showFilter,URLParams,componentType,category));}dispatch(setQuery(componentId,queryToDispatch));if(execute)dispatch(executeQuery(componentId,true,false,componentType));};}function loadMore(component,newOptions){var appendToHits=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;var appendToAggs=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;return function(dispatch,getState){var store=getState();var _buildQuery2=(0,_helper.buildQuery)(component,store.dependencyTree,store.queryList,store.queryOptions),queryObj=_buildQuery2.queryObj,options=_buildQuery2.options;var queryLog=store.queryLog;if(!options)options={};options=_extends({},options,newOptions);if(!queryObj||queryObj&&!Object.keys(queryObj).length){queryObj={match_all:{}};}var currentQuery=_extends({query:_extends({},queryObj)},options);if((0,_helper.isEqual)(queryLog[component],currentQuery))return;dispatch(logQuery(component,currentQuery));var finalQuery=[{preference:component},currentQuery];dispatch(msearch(finalQuery,[component],appendToHits,false,appendToAggs));};}function setQueryListener(component,onQueryChange,onError){return{type:_constants.SET_QUERY_LISTENER,component:component,onQueryChange:onQueryChange,onError:onError};} |
@@ -1,1 +0,1 @@ | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=promotedResultsReducer;var _constants=require('../constants');function promotedResultsReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var action=arguments[1];if(action.type===_constants.SET_PROMOTED_RESULTS){var results=action.results.map(function(item){return _extends({},item,{_promoted:true});});return results;}return state;} | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.default=promotedResultsReducer;var _constants=require('../constants');function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function promotedResultsReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments[1];if(action.type===_constants.SET_PROMOTED_RESULTS){return _extends({},state,_defineProperty({},action.component,action.results.map(function(item){return _extends({},item,{_promoted:true});})));}return state;} |
@@ -1,1 +0,1 @@ | ||
Object.defineProperty(exports,"__esModule",{value:true});exports.withClickIds=exports.getCompositeAggsQuery=exports.getAggsQuery=exports.extractQueryFromDefaultQuery=exports.updateInternalQuery=exports.getSearchState=exports.getOptionsFromQuery=exports.parseHits=exports.handleA11yAction=exports.getInnerKey=exports.getClassName=exports.checkSomePropChange=exports.checkPropChange=undefined;var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.isEqual=isEqual;exports.debounce=debounce;exports.getQueryOptions=getQueryOptions;exports.buildQuery=buildQuery;exports.pushToAndClause=pushToAndClause;exports.checkValueChange=checkValueChange;exports.getAggsOrder=getAggsOrder;exports.formatDate=formatDate;var _dateFormats=require('./dateFormats');var _dateFormats2=_interopRequireDefault(_dateFormats);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++){arr2[i]=arr[i];}return arr2;}else{return Array.from(arr);}}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function isEqual(x,y){if(x===y)return true;if(!(x instanceof Object)||!(y instanceof Object))return false;if(x.constructor!==y.constructor)return false;for(var p in x){if(!x.hasOwnProperty(p))continue;if(!y.hasOwnProperty(p))return false;if(x[p]===y[p])continue;if(typeof x[p]!=='object')return false;if(!isEqual(x[p],y[p]))return false;}for(var _p in y){if(y.hasOwnProperty(_p)&&!x.hasOwnProperty(_p))return false;}return true;}function debounce(callback,wait){var context=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this;var timeout=null;var callbackArgs=null;var later=function later(){return callback.apply(context,callbackArgs);};return function debouncedFunction(){callbackArgs=arguments;clearTimeout(timeout);timeout=setTimeout(later,wait);};}function getQueryOptions(props){var options={};if(props.size!==undefined){options.size=props.size;}if(props.includeFields||props.excludeFields){var source={};if(props.includeFields){source.includes=props.includeFields;}if(props.excludeFields){source.excludes=props.excludeFields;}options._source=source;}return options;}function getOperation(conjunction){if(conjunction==='and'){return'must';}if(conjunction==='or'){return'should';}return'must_not';}function createBoolQuery(operation,query){var resultQuery=null;if(Array.isArray(query)&&query.length||!Array.isArray(query)&&query){resultQuery={bool:_defineProperty({},operation,query)};}if(operation==='should'&&resultQuery){resultQuery={bool:_extends({},resultQuery.bool,{minimum_should_match:1})};}return resultQuery;}function getQuery(react,queryList){var query=[];Object.keys(react).forEach(function(conjunction){if(Array.isArray(react[conjunction])){var operation=getOperation(conjunction);var queryArr=react[conjunction].map(function(comp){if(typeof comp!=='string'){return getQuery(comp,queryList);}else if(comp in queryList){return queryList[comp];}return null;}).filter(function(item){return!!item;});var boolQuery=createBoolQuery(operation,queryArr);if(boolQuery){query=[].concat(_toConsumableArray(query),[boolQuery]);}}else if(typeof react[conjunction]==='string'){var _operation=getOperation(conjunction);var _boolQuery=createBoolQuery(_operation,queryList[react[conjunction]]);if(_boolQuery){query=[].concat(_toConsumableArray(query),[_boolQuery]);}}else if(typeof react[conjunction]==='object'&&react[conjunction]!==null){var _boolQuery2=getQuery(react[conjunction],queryList);if(_boolQuery2){query=[].concat(_toConsumableArray(query),[_boolQuery2]);}}});if(Array.isArray(query)&&query.length){return{bool:{must:query}};}if(query&&Object.keys(query).length){return query;}return null;}function getExternalQueryOptions(react,options,component){var queryOptions={};Object.keys(react).forEach(function(conjunction){if(Array.isArray(react[conjunction])){react[conjunction].forEach(function(comp){if(options[comp]){queryOptions=_extends({},queryOptions,options[comp]);}});}else if(typeof react[conjunction]==='string'){if(options[react[conjunction]]){queryOptions=_extends({},queryOptions,options[react[conjunction]]);}}else if(typeof react[conjunction]==='object'&&react[conjunction]!==null&&!Array.isArray(react[conjunction])){queryOptions=_extends({},queryOptions,getExternalQueryOptions(react[conjunction],options));}});if(options[component]){queryOptions=_extends({},queryOptions,options[component]);}return queryOptions;}function buildQuery(component,dependencyTree,queryList,queryOptions){var queryObj=null;var options=null;if(component in dependencyTree){queryObj=getQuery(dependencyTree[component],queryList);options=getExternalQueryOptions(dependencyTree[component],queryOptions,component);}return{queryObj:queryObj,options:options};}function pushToAndClause(reactProp,component){var react=_extends({},reactProp);if(react.and){if(Array.isArray(react.and)){react.and=[].concat(_toConsumableArray(react.and),[component]);return react;}else if(typeof react.and==='string'){react.and=[react.and,component];return react;}react.and=pushToAndClause(react.and,component);return react;}return _extends({},react,{and:component});}function checkValueChange(componentId,value,beforeValueChange,performUpdate){var selectedValue=value;if(Array.isArray(value)&&!value.length){selectedValue=null;}if(beforeValueChange){beforeValueChange(selectedValue).then(performUpdate).catch(function(e){console.warn(componentId+' - beforeValueChange rejected the promise with ',e);});}else{performUpdate();}}function getAggsOrder(sortBy){if(sortBy==='count'){return{_count:'desc'};}return{_term:sortBy};}var checkPropChange=exports.checkPropChange=function checkPropChange(prevProp,nextProp,callback){if(!isEqual(prevProp,nextProp)){callback();return true;}return false;};var checkSomePropChange=exports.checkSomePropChange=function checkSomePropChange(prevProps,nextProps,propsList,callback){propsList.some(function(prop){return checkPropChange(prevProps[prop],nextProps[prop],callback);});};var getClassName=exports.getClassName=function getClassName(classMap,component){return classMap&&classMap[component]||'';};var getInnerKey=exports.getInnerKey=function getInnerKey(obj,key){return obj&&obj[key]||{};};var handleA11yAction=exports.handleA11yAction=function handleA11yAction(e,callback){if(e.key==='Enter'||e.key===' '){e.preventDefault();callback();}};var highlightResults=function highlightResults(result){var data=_extends({},result);if(data.highlight){Object.keys(data.highlight).forEach(function(highlightItem){var highlightValue=data.highlight[highlightItem][0];data._source=_extends({},data._source,_defineProperty({},highlightItem,highlightValue));});}return data;};var parseHits=exports.parseHits=function parseHits(hits){var results=null;if(hits){results=[].concat(_toConsumableArray(hits)).map(function(item){var streamProps={};if(item._updated){streamProps._updated=item._updated;}else if(item._deleted){streamProps._deleted=item._deleted;}var data=highlightResults(item);var result=Object.keys(data).filter(function(key){return key!=='_source';}).reduce(function(obj,key){obj[key]=data[key];return obj;},_extends({highlight:data.highlight||{}},data._source,streamProps));return result;});}return results;};function formatDate(date,props){if(props.parseDate){return props.parseDate(date,props);}switch(props.queryFormat){case'epoch_millis':return date.getTime();case'epoch_seconds':return Math.floor(date.getTime()/1000);default:{if(_dateFormats2.default[props.queryFormat]){return date.toString(_dateFormats2.default[props.queryFormat]);}return date.getTime();}}}var getOptionsFromQuery=function getOptionsFromQuery(){var customQuery=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};if(customQuery){var query=customQuery.query,rest=_objectWithoutProperties(customQuery,['query']);return Object.keys(rest).length?rest:null;}return null;};exports.getOptionsFromQuery=getOptionsFromQuery;var getSearchState=exports.getSearchState=function getSearchState(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var forHeaders=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var selectedValues=state.selectedValues,queryLog=state.queryLog,dependencyTree=state.dependencyTree,props=state.props,hits=state.hits,aggregations=state.aggregations,isLoading=state.isLoading,error=state.error;var searchState={};var populateState=function populateState(){var obj=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var key=arguments[1];return Object.keys(obj).forEach(function(componentId){searchState[componentId]=_extends({},searchState[componentId],key?_defineProperty({},key,obj[componentId]):obj[componentId]);});};populateState(props);Object.keys(selectedValues).forEach(function(componentId){var componentState=searchState[componentId];var selectedValue=selectedValues[componentId];if(selectedValue){searchState[componentId]=_extends({},componentState,_extends({title:selectedValue.label,componentType:selectedValue.componentType,value:selectedValue.value},selectedValue.category&&{category:selectedValue.category},{URLParams:selectedValue.URLParams}));}});if(!forHeaders){populateState(queryLog);populateState(hits,'hits');populateState(aggregations,'aggregations');populateState(isLoading,'isLoading');populateState(error,'error');}populateState(dependencyTree,'react');return searchState;};var updateInternalQuery=exports.updateInternalQuery=function updateInternalQuery(componentId,queryOptions,value,props,defaultQueryToExecute,queryParams){var defaultQuery=props.defaultQuery;var defaultQueryOptions=void 0;var query=void 0;if(defaultQuery){var queryTobeSet=defaultQuery(value,props);var _ref2=queryTobeSet||{};query=_ref2.query;defaultQueryOptions=getOptionsFromQuery(queryTobeSet);}props.setQueryOptions(componentId,_extends({},defaultQueryOptions,queryOptions||defaultQueryToExecute));if(query){props.updateQuery(_extends({componentId:componentId,query:query},queryParams));}};var extractQueryFromDefaultQuery=function extractQueryFromDefaultQuery(defaultQuery){var queryToBeReturned={};if(defaultQuery){var evaluateQuery=defaultQuery();if(evaluateQuery){var query=evaluateQuery.query,options=_objectWithoutProperties(evaluateQuery,['query']);if(options){queryToBeReturned=options;}}}return queryToBeReturned;};exports.extractQueryFromDefaultQuery=extractQueryFromDefaultQuery;var getAggsQuery=exports.getAggsQuery=function getAggsQuery(query,props){var clonedQuery=query;var dataField=props.dataField,size=props.size,sortBy=props.sortBy,showMissing=props.showMissing,missingLabel=props.missingLabel;clonedQuery.size=0;clonedQuery.aggs=_defineProperty({},dataField,{terms:_extends({field:dataField,size:size,order:getAggsOrder(sortBy||'count')},showMissing?{missing:missingLabel}:{})});if(props.nestedField){clonedQuery.aggs={reactivesearch_nested:{nested:{path:props.nestedField},aggs:clonedQuery.aggs}};}return _extends({},clonedQuery,extractQueryFromDefaultQuery(props.defaultQuery));};var getCompositeAggsQuery=exports.getCompositeAggsQuery=function getCompositeAggsQuery(query,props,after){var showTopHits=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var clonedQuery=query;var dataField=props.dataField,size=props.size,sortBy=props.sortBy,showMissing=props.showMissing,aggregationField=props.aggregationField;var finalField=aggregationField||dataField;var order=sortBy==='count'?{}:{order:sortBy};clonedQuery.aggs=_defineProperty({},finalField,_extends({composite:_extends({sources:[_defineProperty({},finalField,{terms:_extends({field:finalField},order,showMissing?{missing_bucket:true}:{})})],size:size},after)},showTopHits?{aggs:_defineProperty({},finalField,{top_hits:{size:1}})}:{}));clonedQuery.size=0;if(props.nestedField){clonedQuery.aggs={reactivesearch_nested:{nested:{path:props.nestedField},aggs:clonedQuery.aggs}};}return _extends({},clonedQuery,extractQueryFromDefaultQuery(props.defaultQuery));};var withClickIds=exports.withClickIds=function withClickIds(){var results=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];return results.map(function(result,index){return _extends({},result,{_click_id:index});});}; | ||
Object.defineProperty(exports,"__esModule",{value:true});exports.withClickIds=exports.getCompositeAggsQuery=exports.getAggsQuery=exports.extractQueryFromDefaultQuery=exports.updateInternalQuery=exports.getSearchState=exports.getOptionsFromQuery=exports.parseHits=exports.handleA11yAction=exports.getInnerKey=exports.getClassName=exports.checkSomePropChange=exports.checkPropChange=undefined;var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};exports.isEqual=isEqual;exports.debounce=debounce;exports.getQueryOptions=getQueryOptions;exports.buildQuery=buildQuery;exports.pushToAndClause=pushToAndClause;exports.checkValueChange=checkValueChange;exports.getAggsOrder=getAggsOrder;exports.formatDate=formatDate;exports.getResultStats=getResultStats;exports.handleOnSuggestions=handleOnSuggestions;var _dateFormats=require('./dateFormats');var _dateFormats2=_interopRequireDefault(_dateFormats);var _suggestions=require('./suggestions');var _suggestions2=_interopRequireDefault(_suggestions);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++){arr2[i]=arr[i];}return arr2;}else{return Array.from(arr);}}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function isEqual(x,y){if(x===y)return true;if(!(x instanceof Object)||!(y instanceof Object))return false;if(x.constructor!==y.constructor)return false;for(var p in x){if(!x.hasOwnProperty(p))continue;if(!y.hasOwnProperty(p))return false;if(x[p]===y[p])continue;if(typeof x[p]!=='object')return false;if(!isEqual(x[p],y[p]))return false;}for(var _p in y){if(y.hasOwnProperty(_p)&&!x.hasOwnProperty(_p))return false;}return true;}function debounce(callback,wait){var context=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this;var timeout=null;var callbackArgs=null;var later=function later(){return callback.apply(context,callbackArgs);};return function debouncedFunction(){callbackArgs=arguments;clearTimeout(timeout);timeout=setTimeout(later,wait);};}function getQueryOptions(props){var options={};if(props.size!==undefined){options.size=props.size;}if(props.includeFields||props.excludeFields){var source={};if(props.includeFields){source.includes=props.includeFields;}if(props.excludeFields){source.excludes=props.excludeFields;}options._source=source;}return options;}function getOperation(conjunction){if(conjunction==='and'){return'must';}if(conjunction==='or'){return'should';}return'must_not';}function createBoolQuery(operation,query){var resultQuery=null;if(Array.isArray(query)&&query.length||!Array.isArray(query)&&query){resultQuery={bool:_defineProperty({},operation,query)};}if(operation==='should'&&resultQuery){resultQuery={bool:_extends({},resultQuery.bool,{minimum_should_match:1})};}return resultQuery;}function getQuery(react,queryList){var query=[];Object.keys(react).forEach(function(conjunction){if(Array.isArray(react[conjunction])){var operation=getOperation(conjunction);var queryArr=react[conjunction].map(function(comp){if(typeof comp!=='string'){return getQuery(comp,queryList);}else if(comp in queryList){return queryList[comp];}return null;}).filter(function(item){return!!item;});var boolQuery=createBoolQuery(operation,queryArr);if(boolQuery){query=[].concat(_toConsumableArray(query),[boolQuery]);}}else if(typeof react[conjunction]==='string'){var _operation=getOperation(conjunction);var _boolQuery=createBoolQuery(_operation,queryList[react[conjunction]]);if(_boolQuery){query=[].concat(_toConsumableArray(query),[_boolQuery]);}}else if(typeof react[conjunction]==='object'&&react[conjunction]!==null){var _boolQuery2=getQuery(react[conjunction],queryList);if(_boolQuery2){query=[].concat(_toConsumableArray(query),[_boolQuery2]);}}});if(Array.isArray(query)&&query.length){return{bool:{must:query}};}if(query&&Object.keys(query).length){return query;}return null;}function getExternalQueryOptions(react,options,component){var queryOptions={};Object.keys(react).forEach(function(conjunction){if(Array.isArray(react[conjunction])){react[conjunction].forEach(function(comp){if(options[comp]){queryOptions=_extends({},queryOptions,options[comp]);}});}else if(typeof react[conjunction]==='string'){if(options[react[conjunction]]){queryOptions=_extends({},queryOptions,options[react[conjunction]]);}}else if(typeof react[conjunction]==='object'&&react[conjunction]!==null&&!Array.isArray(react[conjunction])){queryOptions=_extends({},queryOptions,getExternalQueryOptions(react[conjunction],options));}});if(options[component]){queryOptions=_extends({},queryOptions,options[component]);}return queryOptions;}function buildQuery(component,dependencyTree,queryList,queryOptions){var queryObj=null;var options=null;if(component in dependencyTree){queryObj=getQuery(dependencyTree[component],queryList);options=getExternalQueryOptions(dependencyTree[component],queryOptions,component);}return{queryObj:queryObj,options:options};}function pushToAndClause(reactProp,component){var react=_extends({},reactProp);if(react.and){if(Array.isArray(react.and)){react.and=[].concat(_toConsumableArray(react.and),[component]);return react;}else if(typeof react.and==='string'){react.and=[react.and,component];return react;}react.and=pushToAndClause(react.and,component);return react;}return _extends({},react,{and:component});}function checkValueChange(componentId,value,beforeValueChange,performUpdate){var selectedValue=value;if(Array.isArray(value)&&!value.length){selectedValue=null;}if(beforeValueChange){beforeValueChange(selectedValue).then(performUpdate).catch(function(e){console.warn(componentId+' - beforeValueChange rejected the promise with ',e);});}else{performUpdate();}}function getAggsOrder(sortBy){if(sortBy==='count'){return{_count:'desc'};}return{_term:sortBy};}var checkPropChange=exports.checkPropChange=function checkPropChange(prevProp,nextProp,callback){if(!isEqual(prevProp,nextProp)){callback();return true;}return false;};var checkSomePropChange=exports.checkSomePropChange=function checkSomePropChange(prevProps,nextProps,propsList,callback){propsList.some(function(prop){return checkPropChange(prevProps[prop],nextProps[prop],callback);});};var getClassName=exports.getClassName=function getClassName(classMap,component){return classMap&&classMap[component]||'';};var getInnerKey=exports.getInnerKey=function getInnerKey(obj,key){return obj&&obj[key]||{};};var handleA11yAction=exports.handleA11yAction=function handleA11yAction(e,callback){if(e.key==='Enter'||e.key===' '){e.preventDefault();callback();}};var highlightResults=function highlightResults(result){var data=_extends({},result);if(data.highlight){Object.keys(data.highlight).forEach(function(highlightItem){var highlightValue=data.highlight[highlightItem][0];data._source=_extends({},data._source,_defineProperty({},highlightItem,highlightValue));});}return data;};var parseHits=exports.parseHits=function parseHits(hits){var results=null;if(hits){results=[].concat(_toConsumableArray(hits)).map(function(item){var streamProps={};if(item._updated){streamProps._updated=item._updated;}else if(item._deleted){streamProps._deleted=item._deleted;}var data=highlightResults(item);var result=Object.keys(data).filter(function(key){return key!=='_source';}).reduce(function(obj,key){obj[key]=data[key];return obj;},_extends({highlight:data.highlight||{}},data._source,streamProps));return result;});}return results;};function formatDate(date,props){if(props.parseDate){return props.parseDate(date,props);}switch(props.queryFormat){case'epoch_millis':return date.getTime();case'epoch_seconds':return Math.floor(date.getTime()/1000);default:{if(_dateFormats2.default[props.queryFormat]){return date.toString(_dateFormats2.default[props.queryFormat]);}return date.getTime();}}}var getOptionsFromQuery=function getOptionsFromQuery(){var customQuery=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};if(customQuery){var query=customQuery.query,rest=_objectWithoutProperties(customQuery,['query']);return Object.keys(rest).length?rest:null;}return null;};exports.getOptionsFromQuery=getOptionsFromQuery;function computeResultStats(hits,searchState,promotedResults){Object.keys(hits).forEach(function(componentId){var _hits$componentId=hits[componentId],hidden=_hits$componentId.hidden,total=_hits$componentId.total,time=_hits$componentId.time;searchState[componentId]=_extends({},searchState[componentId],{resultStats:_extends({},searchState[componentId].resultStats,{numberOfResults:total,time:time,promoted:promotedResults[componentId]&&promotedResults[componentId].length,hidden:hidden})});});}var getSearchState=exports.getSearchState=function getSearchState(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var forHeaders=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var selectedValues=state.selectedValues,queryLog=state.queryLog,dependencyTree=state.dependencyTree,props=state.props,hits=state.hits,aggregations=state.aggregations,isLoading=state.isLoading,error=state.error,promotedResults=state.promotedResults;var searchState={};var populateState=function populateState(){var obj=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var key=arguments[1];return Object.keys(obj).forEach(function(componentId){searchState[componentId]=_extends({},searchState[componentId],key?_defineProperty({},key,obj[componentId]):obj[componentId]);});};populateState(props);Object.keys(selectedValues).forEach(function(componentId){var componentState=searchState[componentId];var selectedValue=selectedValues[componentId];if(selectedValue){searchState[componentId]=_extends({},componentState,_extends({title:selectedValue.label,componentType:selectedValue.componentType,value:selectedValue.value},selectedValue.category&&{category:selectedValue.category},{URLParams:selectedValue.URLParams}));}});if(!forHeaders){populateState(queryLog);populateState(hits,'hits');populateState(aggregations,'aggregations');populateState(isLoading,'isLoading');populateState(error,'error');populateState(promotedResults,'promotedData');computeResultStats(hits,searchState,promotedResults);}populateState(dependencyTree,'react');return searchState;};var updateInternalQuery=exports.updateInternalQuery=function updateInternalQuery(componentId,queryOptions,value,props,defaultQueryToExecute,queryParams){var defaultQuery=props.defaultQuery;var defaultQueryOptions=void 0;var query=void 0;if(defaultQuery){var queryTobeSet=defaultQuery(value,props);var _ref2=queryTobeSet||{};query=_ref2.query;defaultQueryOptions=getOptionsFromQuery(queryTobeSet);}props.setQueryOptions(componentId,_extends({},defaultQueryOptions,queryOptions||defaultQueryToExecute));if(query){props.updateQuery(_extends({componentId:componentId,query:query},queryParams));}};var extractQueryFromDefaultQuery=function extractQueryFromDefaultQuery(defaultQuery){var queryToBeReturned={};if(defaultQuery){var evaluateQuery=defaultQuery();if(evaluateQuery){var query=evaluateQuery.query,options=_objectWithoutProperties(evaluateQuery,['query']);if(options){queryToBeReturned=options;}}}return queryToBeReturned;};exports.extractQueryFromDefaultQuery=extractQueryFromDefaultQuery;var getAggsQuery=exports.getAggsQuery=function getAggsQuery(query,props){var clonedQuery=query;var dataField=props.dataField,size=props.size,sortBy=props.sortBy,showMissing=props.showMissing,missingLabel=props.missingLabel;clonedQuery.size=0;clonedQuery.aggs=_defineProperty({},dataField,{terms:_extends({field:dataField,size:size,order:getAggsOrder(sortBy||'count')},showMissing?{missing:missingLabel}:{})});if(props.nestedField){clonedQuery.aggs={reactivesearch_nested:{nested:{path:props.nestedField},aggs:clonedQuery.aggs}};}return _extends({},clonedQuery,extractQueryFromDefaultQuery(props.defaultQuery));};var getCompositeAggsQuery=exports.getCompositeAggsQuery=function getCompositeAggsQuery(query,props,after){var showTopHits=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var clonedQuery=query;var dataField=props.dataField,size=props.size,sortBy=props.sortBy,showMissing=props.showMissing,aggregationField=props.aggregationField;var finalField=aggregationField||dataField;var order=sortBy==='count'?{}:{order:sortBy};clonedQuery.aggs=_defineProperty({},finalField,_extends({composite:_extends({sources:[_defineProperty({},finalField,{terms:_extends({field:finalField},order,showMissing?{missing_bucket:true}:{})})],size:size},after)},showTopHits?{aggs:_defineProperty({},finalField,{top_hits:{size:1}})}:{}));clonedQuery.size=0;if(props.nestedField){clonedQuery.aggs={reactivesearch_nested:{nested:{path:props.nestedField},aggs:clonedQuery.aggs}};}return _extends({},clonedQuery,extractQueryFromDefaultQuery(props.defaultQuery));};var withClickIds=exports.withClickIds=function withClickIds(){var results=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];return results.map(function(result,index){return _extends({},result,{_click_id:index});});};function getResultStats(props){var total=props.total,size=props.size,time=props.time,hidden=props.hidden,promotedResults=props.promotedResults;return _extends({numberOfResults:total},size>0?{numberOfPages:Math.ceil(total/size)}:null,{time:time,hidden:hidden,promoted:promotedResults&&promotedResults.length});}function handleOnSuggestions(results,currentValue,props){var parseSuggestion=props.parseSuggestion,promotedResults=props.promotedResults;var fields=Array.isArray(props.dataField)?props.dataField:[props.dataField];var newResults=parseHits(results);if(promotedResults.length){var ids=promotedResults.map(function(item){return item._id;}).filter(Boolean);if(ids){newResults=newResults.filter(function(item){return!ids.includes(item._id);});}newResults=[].concat(_toConsumableArray(promotedResults),_toConsumableArray(newResults));}var parsedSuggestions=(0,_suggestions2.default)(fields,newResults,currentValue.toLowerCase());if(parseSuggestion){return parsedSuggestions.map(function(suggestion){return parseSuggestion(suggestion);});}return parsedSuggestions;} |
@@ -1,1 +0,1 @@ | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++){arr2[i]=arr[i];}return arr2;}else{return Array.from(arr);}}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}var flatten=function flatten(arr){return arr.reduce(function(flat,toFlatten){return flat.concat(Array.isArray(toFlatten)?flatten(toFlatten):toFlatten);},[]);};var extractSuggestion=function extractSuggestion(val){switch(typeof val){case'string':return val;case'object':if(Array.isArray(val)){return flatten(val);}return null;default:return val;}};function replaceDiacritics(s){var str=s;var diacritics=[/[\300-\306]/g,/[\340-\346]/g,/[\310-\313]/g,/[\350-\353]/g,/[\314-\317]/g,/[\354-\357]/g,/[\322-\330]/g,/[\362-\370]/g,/[\331-\334]/g,/[\371-\374]/g,/[\321]/g,/[\361]/g,/[\307]/g,/[\347]/g];var chars=['A','a','E','e','I','i','O','o','U','u','N','n','C','c'];for(var i=0;i<diacritics.length;i+=1){str=str.replace(diacritics[i],chars[i]);}return str;}var getSuggestions=function getSuggestions(fields,suggestions,currentValue){var suggestionProperties=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[];var suggestionsList=[];var labelsList=[];var populateSuggestionsList=function populateSuggestionsList(val,parsedSource,source){var isWordMatch=currentValue.trim().split(' ').some(function(term){return String(replaceDiacritics(val)).toLowerCase().includes(replaceDiacritics(term));});if(isWordMatch&&!labelsList.includes(val)){var defaultOption={label:val,value:val,source:source};var additionalKeys={};if(Array.isArray(suggestionProperties)&&suggestionProperties.length>0){suggestionProperties.forEach(function(prop){if(parsedSource.hasOwnProperty(prop)){additionalKeys=_extends({},additionalKeys,_defineProperty({},prop,parsedSource[prop]));}});}var option=_extends({},defaultOption,additionalKeys);labelsList=[].concat(_toConsumableArray(labelsList),[val]);suggestionsList=[].concat(_toConsumableArray(suggestionsList),[option]);}};var parseField=function parseField(parsedSource,field){var source=arguments.length>2&&arguments[2]!==undefined?arguments[2]:parsedSource;if(typeof parsedSource==='object'){var fieldNodes=field.split('.');var label=parsedSource[fieldNodes[0]];if(label){if(fieldNodes.length>1){var children=field.substring(fieldNodes[0].length+1);if(Array.isArray(label)){label.forEach(function(arrayItem){parseField(arrayItem,children,source);});}else{parseField(label,children,source);}}else{var val=extractSuggestion(label);if(val){if(Array.isArray(val)){val.forEach(function(suggestion){return populateSuggestionsList(suggestion,parsedSource,source);});}else{populateSuggestionsList(val,parsedSource,source);}}}}}};suggestions.forEach(function(item){var _score=item._score,_index=item._index,_type=item._type,_id=item._id;var source=_extends({},item._source,{_id:_id,_index:_index,_score:_score,_type:_type});fields.forEach(function(field){parseField(source,field);});});return suggestionsList;};exports.default=getSuggestions; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++){arr2[i]=arr[i];}return arr2;}else{return Array.from(arr);}}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}var flatten=function flatten(arr){return arr.reduce(function(flat,toFlatten){return flat.concat(Array.isArray(toFlatten)?flatten(toFlatten):toFlatten);},[]);};var extractSuggestion=function extractSuggestion(val){switch(typeof val){case'string':return val;case'object':if(Array.isArray(val)){return flatten(val);}return null;default:return val;}};function replaceDiacritics(s){var str=s;var diacritics=[/[\300-\306]/g,/[\340-\346]/g,/[\310-\313]/g,/[\350-\353]/g,/[\314-\317]/g,/[\354-\357]/g,/[\322-\330]/g,/[\362-\370]/g,/[\331-\334]/g,/[\371-\374]/g,/[\321]/g,/[\361]/g,/[\307]/g,/[\347]/g];var chars=['A','a','E','e','I','i','O','o','U','u','N','n','C','c'];for(var i=0;i<diacritics.length;i+=1){str=str.replace(diacritics[i],chars[i]);}return str;}var getSuggestions=function getSuggestions(fields,suggestions,currentValue){var suggestionProperties=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[];var suggestionsList=[];var labelsList=[];var populateSuggestionsList=function populateSuggestionsList(val,parsedSource,source){var isWordMatch=currentValue.trim().split(' ').some(function(term){return String(replaceDiacritics(val)).toLowerCase().includes(replaceDiacritics(term));});if(isWordMatch&&!labelsList.includes(val)||source._promoted){var defaultOption={label:val,value:val,source:source};var additionalKeys={};if(Array.isArray(suggestionProperties)&&suggestionProperties.length>0){suggestionProperties.forEach(function(prop){if(parsedSource.hasOwnProperty(prop)){additionalKeys=_extends({},additionalKeys,_defineProperty({},prop,parsedSource[prop]));}});}var option=_extends({},defaultOption,additionalKeys);labelsList=[].concat(_toConsumableArray(labelsList),[val]);suggestionsList=[].concat(_toConsumableArray(suggestionsList),[option]);}};var parseField=function parseField(parsedSource,field){var source=arguments.length>2&&arguments[2]!==undefined?arguments[2]:parsedSource;if(typeof parsedSource==='object'){var fieldNodes=field.split('.');var label=parsedSource[fieldNodes[0]];if(label){if(fieldNodes.length>1){var children=field.substring(fieldNodes[0].length+1);if(Array.isArray(label)){label.forEach(function(arrayItem){parseField(arrayItem,children,source);});}else{parseField(label,children,source);}}else{var val=extractSuggestion(label);if(val){if(Array.isArray(val)){val.forEach(function(suggestion){return populateSuggestionsList(suggestion,parsedSource,source);});}else{populateSuggestionsList(val,parsedSource,source);}}}}}};suggestions.forEach(function(item){fields.forEach(function(field){parseField(item,field);});});return suggestionsList;};exports.default=getSuggestions; |
@@ -1,1 +0,1 @@ | ||
Object.defineProperty(exports,"__esModule",{value:true});var _propTypes=require('prop-types');var _dateFormats=require('./dateFormats');var _dateFormats2=_interopRequireDefault(_dateFormats);var _constants=require('./constants');function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}var reactKeyType=(0,_propTypes.oneOfType)([_propTypes.string,(0,_propTypes.arrayOf)(_propTypes.string),_propTypes.object,(0,_propTypes.arrayOf)(_propTypes.object)]);function validateLocation(props,propName){if(isNaN(props[propName])){return new Error(propName+' value must be a number');}if(propName==='lat'&&(props[propName]<-90||props[propName]>90)){return new Error(propName+' value should be between -90 and 90.');}else if(propName==='lng'&&(props[propName]<-180||props[propName]>180)){return new Error(propName+' value should be between -180 and 180.');}return null;}var types={any:_propTypes.any,analyticsConfig:(0,_propTypes.shape)({searchStateHeader:_propTypes.bool,emptyQuery:_propTypes.bool,suggestionAnalytics:_propTypes.bool,userId:_propTypes.string,customEvents:_propTypes.object}),bool:_propTypes.bool,boolRequired:_propTypes.bool.isRequired,components:(0,_propTypes.arrayOf)(_propTypes.string),children:_propTypes.any,data:(0,_propTypes.arrayOf)(_propTypes.object),dataFieldArray:(0,_propTypes.oneOfType)([_propTypes.string,(0,_propTypes.arrayOf)(_propTypes.string)]).isRequired,dataNumberBox:(0,_propTypes.shape)({label:_propTypes.string,start:_propTypes.number.isRequired,end:_propTypes.number.isRequired}).isRequired,date:(0,_propTypes.oneOfType)([_propTypes.string,(0,_propTypes.arrayOf)(_propTypes.string)]),dateObject:_propTypes.object,excludeFields:(0,_propTypes.arrayOf)(_propTypes.string),fieldWeights:(0,_propTypes.arrayOf)(_propTypes.number),filterLabel:_propTypes.string,func:_propTypes.func,funcRequired:_propTypes.func.isRequired,fuzziness:(0,_propTypes.oneOf)([0,1,2,'AUTO']),headers:_propTypes.object,hits:(0,_propTypes.arrayOf)(_propTypes.object),iconPosition:(0,_propTypes.oneOf)(['left','right']),includeFields:(0,_propTypes.arrayOf)(_propTypes.string),labelPosition:(0,_propTypes.oneOf)(['left','right','top','bottom']),number:_propTypes.number,options:(0,_propTypes.oneOfType)([(0,_propTypes.arrayOf)(_propTypes.object),_propTypes.object]),paginationAt:(0,_propTypes.oneOf)(['top','bottom','both']),range:(0,_propTypes.shape)({start:_propTypes.number.isRequired,end:_propTypes.number.isRequired}),rangeLabels:(0,_propTypes.shape)({start:_propTypes.string.isRequired,end:_propTypes.string.isRequired}),react:(0,_propTypes.shape)({and:reactKeyType,or:reactKeyType,not:reactKeyType}),categorySearchValue:(0,_propTypes.shape)({term:_propTypes.string,category:_propTypes.string}),selectedValues:_propTypes.object,selectedValue:(0,_propTypes.oneOfType)([_propTypes.string,(0,_propTypes.arrayOf)(_propTypes.string),(0,_propTypes.arrayOf)(_propTypes.object),_propTypes.object,_propTypes.number,(0,_propTypes.arrayOf)(_propTypes.number)]),suggestions:(0,_propTypes.arrayOf)(_propTypes.object),supportedOrientations:(0,_propTypes.oneOf)(['portrait','portrait-upside-down','landscape','landscape-left','landscape-right']),tooltipTrigger:(0,_propTypes.oneOf)(['hover','none','focus','always']),sortBy:(0,_propTypes.oneOf)(['asc','desc']),sortOptions:(0,_propTypes.arrayOf)((0,_propTypes.shape)({label:_propTypes.string,dataField:_propTypes.string,sortBy:_propTypes.string})),sortByWithCount:(0,_propTypes.oneOf)(['asc','desc','count']),stats:(0,_propTypes.arrayOf)(_propTypes.object),string:_propTypes.string,stringArray:(0,_propTypes.arrayOf)(_propTypes.string),stringOrArray:(0,_propTypes.oneOfType)([_propTypes.string,(0,_propTypes.arrayOf)(_propTypes.string)]),stringRequired:_propTypes.string.isRequired,style:_propTypes.object,themePreset:(0,_propTypes.oneOf)(['light','dark']),queryFormatDate:(0,_propTypes.oneOf)(Object.keys(_dateFormats2.default)),queryFormatSearch:(0,_propTypes.oneOf)(['and','or']),queryFormatNumberBox:(0,_propTypes.oneOf)(['exact','lte','gte']),params:_propTypes.object.isRequired,props:_propTypes.object,rangeLabelsAlign:(0,_propTypes.oneOf)(['left','right']),title:(0,_propTypes.oneOfType)([_propTypes.string,_propTypes.any]),location:(0,_propTypes.shape)({lat:validateLocation,lng:validateLocation}),unit:(0,_propTypes.oneOf)(['mi','miles','yd','yards','ft','feet','in','inch','km','kilometers','m','meters','cm','centimeters','mm','millimeters','NM','nmi','nauticalmiles']),aggregationData:_propTypes.array,showClearAll:(0,_propTypes.oneOf)([_constants.CLEAR_ALL.NEVER,_constants.CLEAR_ALL.ALWAYS,_constants.CLEAR_ALL.DEFAULT,true,false])};exports.default=types; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _propTypes=require('prop-types');var _dateFormats=require('./dateFormats');var _dateFormats2=_interopRequireDefault(_dateFormats);var _constants=require('./constants');function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}var reactKeyType=(0,_propTypes.oneOfType)([_propTypes.string,(0,_propTypes.arrayOf)(_propTypes.string),_propTypes.object,(0,_propTypes.arrayOf)(_propTypes.object)]);function validateLocation(props,propName){if(isNaN(props[propName])){return new Error(propName+' value must be a number');}if(propName==='lat'&&(props[propName]<-90||props[propName]>90)){return new Error(propName+' value should be between -90 and 90.');}else if(propName==='lng'&&(props[propName]<-180||props[propName]>180)){return new Error(propName+' value should be between -180 and 180.');}return null;}var types={any:_propTypes.any,analyticsConfig:(0,_propTypes.shape)({searchStateHeader:_propTypes.bool,emptyQuery:_propTypes.bool,suggestionAnalytics:_propTypes.bool,userId:_propTypes.string,customEvents:_propTypes.object}),bool:_propTypes.bool,boolRequired:_propTypes.bool.isRequired,components:(0,_propTypes.arrayOf)(_propTypes.string),children:_propTypes.any,data:(0,_propTypes.arrayOf)(_propTypes.object),dataFieldArray:(0,_propTypes.oneOfType)([_propTypes.string,(0,_propTypes.arrayOf)(_propTypes.string)]).isRequired,dataNumberBox:(0,_propTypes.shape)({label:_propTypes.string,start:_propTypes.number.isRequired,end:_propTypes.number.isRequired}).isRequired,date:(0,_propTypes.oneOfType)([_propTypes.string,(0,_propTypes.arrayOf)(_propTypes.string)]),dateObject:_propTypes.object,excludeFields:(0,_propTypes.arrayOf)(_propTypes.string),fieldWeights:(0,_propTypes.arrayOf)(_propTypes.number),filterLabel:_propTypes.string,func:_propTypes.func,funcRequired:_propTypes.func.isRequired,fuzziness:(0,_propTypes.oneOf)([0,1,2,'AUTO']),headers:_propTypes.object,hits:(0,_propTypes.arrayOf)(_propTypes.object),iconPosition:(0,_propTypes.oneOf)(['left','right']),includeFields:(0,_propTypes.arrayOf)(_propTypes.string),labelPosition:(0,_propTypes.oneOf)(['left','right','top','bottom']),number:_propTypes.number,options:(0,_propTypes.oneOfType)([(0,_propTypes.arrayOf)(_propTypes.object),_propTypes.object]),paginationAt:(0,_propTypes.oneOf)(['top','bottom','both']),range:(0,_propTypes.shape)({start:_propTypes.number.isRequired,end:_propTypes.number.isRequired}),rangeLabels:(0,_propTypes.shape)({start:_propTypes.string.isRequired,end:_propTypes.string.isRequired}),react:(0,_propTypes.shape)({and:reactKeyType,or:reactKeyType,not:reactKeyType}),categorySearchValue:(0,_propTypes.shape)({term:_propTypes.string,category:_propTypes.string}),selectedValues:_propTypes.object,selectedValue:(0,_propTypes.oneOfType)([_propTypes.string,(0,_propTypes.arrayOf)(_propTypes.string),(0,_propTypes.arrayOf)(_propTypes.object),_propTypes.object,_propTypes.number,(0,_propTypes.arrayOf)(_propTypes.number)]),suggestions:(0,_propTypes.arrayOf)(_propTypes.object),supportedOrientations:(0,_propTypes.oneOf)(['portrait','portrait-upside-down','landscape','landscape-left','landscape-right']),tooltipTrigger:(0,_propTypes.oneOf)(['hover','none','focus','always']),sortBy:(0,_propTypes.oneOf)(['asc','desc']),sortOptions:(0,_propTypes.arrayOf)((0,_propTypes.shape)({label:_propTypes.string,dataField:_propTypes.string,sortBy:_propTypes.string})),sortByWithCount:(0,_propTypes.oneOf)(['asc','desc','count']),stats:(0,_propTypes.arrayOf)(_propTypes.object),string:_propTypes.string,stringArray:(0,_propTypes.arrayOf)(_propTypes.string),stringOrArray:(0,_propTypes.oneOfType)([_propTypes.string,(0,_propTypes.arrayOf)(_propTypes.string)]),stringRequired:_propTypes.string.isRequired,style:_propTypes.object,themePreset:(0,_propTypes.oneOf)(['light','dark']),queryFormatDate:(0,_propTypes.oneOf)(Object.keys(_dateFormats2.default)),queryFormatSearch:(0,_propTypes.oneOf)(['and','or']),queryFormatNumberBox:(0,_propTypes.oneOf)(['exact','lte','gte']),params:_propTypes.object.isRequired,props:_propTypes.object,rangeLabelsAlign:(0,_propTypes.oneOf)(['left','right']),title:(0,_propTypes.oneOfType)([_propTypes.string,_propTypes.any]),location:(0,_propTypes.shape)({lat:validateLocation,lng:validateLocation}),unit:(0,_propTypes.oneOf)(['mi','miles','yd','yards','ft','feet','in','inch','km','kilometers','m','meters','cm','centimeters','mm','millimeters','NM','nmi','nauticalmiles']),aggregationData:_propTypes.array,showClearAll:(0,_propTypes.oneOf)([_constants.CLEAR_ALL.NEVER,_constants.CLEAR_ALL.ALWAYS,_constants.CLEAR_ALL.DEFAULT,true,false]),componentObject:_propTypes.object};exports.default=types; |
{ | ||
"name": "@appbaseio/reactivecore", | ||
"version": "8.2.19", | ||
"version": "9.0.0", | ||
"description": "Core architecture of reactive UI libraries", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
104455
2