@appbaseio/reactivecore
Advanced tools
Comparing version 8.1.2 to 8.1.3
@@ -1,1 +0,1 @@ | ||
Object.defineProperty(exports,"__esModule",{value:true});exports.polyfills=exports.storeKey=exports.Actions=exports.suggestions=exports.causes=exports.helper=undefined;exports.default=configureStore;var _redux=require('redux');var _reduxThunk=require('redux-thunk');var _reduxThunk2=_interopRequireDefault(_reduxThunk);var _reducers=require('./reducers');var _reducers2=_interopRequireDefault(_reducers);var _constants=require('./constants');var _actions=require('./actions');var Actions=_interopRequireWildcard(_actions);var _helper=require('./utils/helper');var helper=_interopRequireWildcard(_helper);var _suggestions=require('./utils/suggestions');var _suggestions2=_interopRequireDefault(_suggestions);var _polyfills=require('./utils/polyfills');var _polyfills2=_interopRequireDefault(_polyfills);var _causes=require('./utils/causes');var _causes2=_interopRequireDefault(_causes);function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj;}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key];}}newObj.default=obj;return newObj;}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}var storeKey=_constants.STORE_KEY;var suggestions=_suggestions2.default;var causes=_causes2.default;exports.helper=helper;exports.causes=causes;exports.suggestions=suggestions;exports.Actions=Actions;exports.storeKey=storeKey;exports.polyfills=_polyfills2.default;var composeEnhancers=typeof window==='object'&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}):_redux.compose;var enhancer=composeEnhancers((0,_redux.applyMiddleware)(_reduxThunk2.default));function configureStore(initialState){return(0,_redux.createStore)(_reducers2.default,initialState,enhancer);} | ||
Object.defineProperty(exports,"__esModule",{value:true});exports.Reducers=exports.polyfills=exports.storeKey=exports.Actions=exports.suggestions=exports.causes=exports.helper=undefined;exports.default=configureStore;var _redux=require('redux');var _reduxThunk=require('redux-thunk');var _reduxThunk2=_interopRequireDefault(_reduxThunk);var _reducers=require('./reducers');var _reducers2=_interopRequireDefault(_reducers);var _constants=require('./constants');var _actions=require('./actions');var Actions=_interopRequireWildcard(_actions);var _helper=require('./utils/helper');var helper=_interopRequireWildcard(_helper);var _suggestions=require('./utils/suggestions');var _suggestions2=_interopRequireDefault(_suggestions);var _polyfills=require('./utils/polyfills');var _polyfills2=_interopRequireDefault(_polyfills);var _causes=require('./utils/causes');var _causes2=_interopRequireDefault(_causes);var _valueReducer=require('./reducers/valueReducer');var _valueReducer2=_interopRequireDefault(_valueReducer);var _queryReducer=require('./reducers/queryReducer');var _queryReducer2=_interopRequireDefault(_queryReducer);var _queryOptionsReducer=require('./reducers/queryOptionsReducer');var _queryOptionsReducer2=_interopRequireDefault(_queryOptionsReducer);var _dependencyTreeReducer=require('./reducers/dependencyTreeReducer');var _dependencyTreeReducer2=_interopRequireDefault(_dependencyTreeReducer);function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj;}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key];}}newObj.default=obj;return newObj;}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}var storeKey=_constants.STORE_KEY;var suggestions=_suggestions2.default;var causes=_causes2.default;var Reducers={valueReducer:_valueReducer2.default,queryOptionsReducer:_queryOptionsReducer2.default,queryReducer:_queryReducer2.default,dependencyTreeReducer:_dependencyTreeReducer2.default};exports.helper=helper;exports.causes=causes;exports.suggestions=suggestions;exports.Actions=Actions;exports.storeKey=storeKey;exports.polyfills=_polyfills2.default;exports.Reducers=Reducers;var composeEnhancers=typeof window==='object'&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}):_redux.compose;var enhancer=composeEnhancers((0,_redux.applyMiddleware)(_reduxThunk2.default));function configureStore(initialState){return(0,_redux.createStore)(_reducers2.default,initialState,enhancer);} |
@@ -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;}};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,source){var isWordMatch=currentValue.trim().split(' ').some(function(term){return String(val).toLowerCase().includes(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(source.hasOwnProperty(prop)){additionalKeys=_extends({},additionalKeys,_defineProperty({},prop,source[prop]));}});}var option=_extends({},defaultOption,additionalKeys);labelsList=[].concat(_toConsumableArray(labelsList),[val]);suggestionsList=[].concat(_toConsumableArray(suggestionsList),[option]);}};var parseField=function parseField(source,field){if(typeof source==='object'){var fieldNodes=field.split('.');var label=source[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);});}else{parseField(label,children);}}else{var val=extractSuggestion(label);if(val){if(Array.isArray(val)){val.forEach(function(suggestion){return populateSuggestionsList(suggestion,source);});}else{populateSuggestionsList(val,source);}}}}}};suggestions.forEach(function(item){var _score=item._score,_index=item._index,_type=item._type,_id=item._id;fields.forEach(function(field){parseField(_extends({},item._source,{_id:_id,_index:_index,_score:_score,_type:_type}),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;}};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(val).toLowerCase().includes(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; |
{ | ||
"name": "@appbaseio/reactivecore", | ||
"version": "8.1.2", | ||
"version": "8.1.3", | ||
"description": "Core architecture of reactive UI libraries", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
82807