source: node_modules/redux-immutable/dist/utilities/getUnexpectedInvocationParameterMessage.js.map@ 65b6638

main
Last change on this file since 65b6638 was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 2.5 KB
Line 
1{"version":3,"sources":["../../src/utilities/getUnexpectedInvocationParameterMessage.js"],"names":["state","reducers","action","reducerNames","Object","keys","length","stateName","isImmutable","Iterable","isIterable","join","unexpectedStatePropertyNames","toSeq","keySeq","toArray","filter","name","hasOwnProperty"],"mappings":";;;;;;AAAA;;;;AACA;;;;;;kBAEe,UAACA,KAAD,EAAgBC,QAAhB,EAAkCC,MAAlC,EAAqD;AAClE,MAAMC,eAAeC,OAAOC,IAAP,CAAYJ,QAAZ,CAArB;;AAEA,MAAI,CAACE,aAAaG,MAAlB,EAA0B;AACxB,WAAO,+HAAP;AACD;;AAED,MAAMC,YAAY,4BAAaL,MAAb,CAAlB;;AAEA,MAAI,oBAAUM,WAAV,GAAwB,CAAC,oBAAUA,WAAV,CAAsBR,KAAtB,CAAzB,GAAwD,CAAC,oBAAUS,QAAV,CAAmBC,UAAnB,CAA8BV,KAA9B,CAA7D,EAAmG;AACjG,WAAO,SAASO,SAAT,GAAqB,0IAArB,GAAkKJ,aAAaQ,IAAb,CAAkB,MAAlB,CAAlK,GAA8L,IAArM;AACD;;AAED,MAAMC,+BAA+BZ,MAAMa,KAAN,GAAcC,MAAd,GAAuBC,OAAvB,GAAiCC,MAAjC,CAAwC,UAACC,IAAD,EAAU;AACrF,WAAO,CAAChB,SAASiB,cAAT,CAAwBD,IAAxB,CAAR;AACD,GAFoC,CAArC;;AAIA,MAAIL,6BAA6BN,MAA7B,GAAsC,CAA1C,EAA6C;AAC3C,WAAO,iBAAiBM,6BAA6BN,MAA7B,KAAwC,CAAxC,GAA4C,UAA5C,GAAyD,YAA1E,IAA0F,IAA1F,GAAiGM,6BAA6BD,IAA7B,CAAkC,MAAlC,CAAjG,GAA6I,aAA7I,GAA6JJ,SAA7J,GAAyK,uEAAzK,GAAmPJ,aAAaQ,IAAb,CAAkB,MAAlB,CAAnP,GAA+Q,2CAAtR;AACD;;AAED,SAAO,IAAP;AACD,C","file":"getUnexpectedInvocationParameterMessage.js","sourcesContent":["import Immutable from 'immutable';\nimport getStateName from './getStateName';\n\nexport default (state: Object, reducers: Object, action: Object) => {\n const reducerNames = Object.keys(reducers);\n\n if (!reducerNames.length) {\n return 'Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.';\n }\n\n const stateName = getStateName(action);\n\n if (Immutable.isImmutable ? !Immutable.isImmutable(state) : !Immutable.Iterable.isIterable(state)) {\n return 'The ' + stateName + ' is of unexpected type. Expected argument to be an instance of Immutable.Collection or Immutable.Record with the following properties: \"' + reducerNames.join('\", \"') + '\".';\n }\n\n const unexpectedStatePropertyNames = state.toSeq().keySeq().toArray().filter((name) => {\n return !reducers.hasOwnProperty(name);\n });\n\n if (unexpectedStatePropertyNames.length > 0) {\n return 'Unexpected ' + (unexpectedStatePropertyNames.length === 1 ? 'property' : 'properties') + ' \"' + unexpectedStatePropertyNames.join('\", \"') + '\" found in ' + stateName + '. Expected to find one of the known reducer property names instead: \"' + reducerNames.join('\", \"') + '\". Unexpected properties will be ignored.';\n }\n\n return null;\n};\n"]}
Note: See TracBrowser for help on using the repository browser.