3
3
4
4
/**
5
5
* Copyright (c) 2013-present, Facebook, Inc.
6
- * All rights reserved.
7
6
*
8
- * This source code is licensed under the BSD-style license found in the
9
- * LICENSE file in the root directory of this source tree. An additional grant
10
- * of patent rights can be found in the PATENTS file in the same directory.
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
11
9
*
12
10
*
13
11
*/
@@ -40,11 +38,9 @@ module.exports = emptyFunction;
40
38
} , { } ] , 2 :[ function ( require , module , exports ) {
41
39
/**
42
40
* Copyright (c) 2013-present, Facebook, Inc.
43
- * All rights reserved.
44
41
*
45
- * This source code is licensed under the BSD-style license found in the
46
- * LICENSE file in the root directory of this source tree. An additional grant
47
- * of patent rights can be found in the PATENTS file in the same directory.
42
+ * This source code is licensed under the MIT license found in the
43
+ * LICENSE file in the root directory of this source tree.
48
44
*
49
45
*/
50
46
@@ -95,12 +91,10 @@ function invariant(condition, format, a, b, c, d, e, f) {
95
91
module . exports = invariant ;
96
92
} , { } ] , 3 :[ function ( require , module , exports ) {
97
93
/**
98
- * Copyright 2014-2015, Facebook, Inc.
99
- * All rights reserved.
94
+ * Copyright (c) 2014-present, Facebook, Inc.
100
95
*
101
- * This source code is licensed under the BSD-style license found in the
102
- * LICENSE file in the root directory of this source tree. An additional grant
103
- * of patent rights can be found in the PATENTS file in the same directory.
96
+ * This source code is licensed under the MIT license found in the
97
+ * LICENSE file in the root directory of this source tree.
104
98
*
105
99
*/
106
100
@@ -159,13 +153,103 @@ if ("production" !== 'production') {
159
153
160
154
module . exports = warning ;
161
155
} , { "./emptyFunction" :1 } ] , 4 :[ function ( require , module , exports ) {
156
+ /*
157
+ object-assign
158
+ (c) Sindre Sorhus
159
+ @license MIT
160
+ */
161
+
162
+ 'use strict' ;
163
+ /* eslint-disable no-unused-vars */
164
+ var getOwnPropertySymbols = Object . getOwnPropertySymbols ;
165
+ var hasOwnProperty = Object . prototype . hasOwnProperty ;
166
+ var propIsEnumerable = Object . prototype . propertyIsEnumerable ;
167
+
168
+ function toObject ( val ) {
169
+ if ( val === null || val === undefined ) {
170
+ throw new TypeError ( 'Object.assign cannot be called with null or undefined' ) ;
171
+ }
172
+
173
+ return Object ( val ) ;
174
+ }
175
+
176
+ function shouldUseNative ( ) {
177
+ try {
178
+ if ( ! Object . assign ) {
179
+ return false ;
180
+ }
181
+
182
+ // Detect buggy property enumeration order in older V8 versions.
183
+
184
+ // https://bugs.chromium.org/p/v8/issues/detail?id=4118
185
+ var test1 = new String ( 'abc' ) ; // eslint-disable-line no-new-wrappers
186
+ test1 [ 5 ] = 'de' ;
187
+ if ( Object . getOwnPropertyNames ( test1 ) [ 0 ] === '5' ) {
188
+ return false ;
189
+ }
190
+
191
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
192
+ var test2 = { } ;
193
+ for ( var i = 0 ; i < 10 ; i ++ ) {
194
+ test2 [ '_' + String . fromCharCode ( i ) ] = i ;
195
+ }
196
+ var order2 = Object . getOwnPropertyNames ( test2 ) . map ( function ( n ) {
197
+ return test2 [ n ] ;
198
+ } ) ;
199
+ if ( order2 . join ( '' ) !== '0123456789' ) {
200
+ return false ;
201
+ }
202
+
203
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
204
+ var test3 = { } ;
205
+ 'abcdefghijklmnopqrst' . split ( '' ) . forEach ( function ( letter ) {
206
+ test3 [ letter ] = letter ;
207
+ } ) ;
208
+ if ( Object . keys ( Object . assign ( { } , test3 ) ) . join ( '' ) !==
209
+ 'abcdefghijklmnopqrst' ) {
210
+ return false ;
211
+ }
212
+
213
+ return true ;
214
+ } catch ( err ) {
215
+ // We don't expect any of the above to throw, but better to be safe.
216
+ return false ;
217
+ }
218
+ }
219
+
220
+ module . exports = shouldUseNative ( ) ? Object . assign : function ( target , source ) {
221
+ var from ;
222
+ var to = toObject ( target ) ;
223
+ var symbols ;
224
+
225
+ for ( var s = 1 ; s < arguments . length ; s ++ ) {
226
+ from = Object ( arguments [ s ] ) ;
227
+
228
+ for ( var key in from ) {
229
+ if ( hasOwnProperty . call ( from , key ) ) {
230
+ to [ key ] = from [ key ] ;
231
+ }
232
+ }
233
+
234
+ if ( getOwnPropertySymbols ) {
235
+ symbols = getOwnPropertySymbols ( from ) ;
236
+ for ( var i = 0 ; i < symbols . length ; i ++ ) {
237
+ if ( propIsEnumerable . call ( from , symbols [ i ] ) ) {
238
+ to [ symbols [ i ] ] = from [ symbols [ i ] ] ;
239
+ }
240
+ }
241
+ }
242
+ }
243
+
244
+ return to ;
245
+ } ;
246
+
247
+ } , { } ] , 5 :[ function ( require , module , exports ) {
162
248
/**
163
- * Copyright 2013-present, Facebook, Inc.
164
- * All rights reserved.
249
+ * Copyright (c) 2013-present, Facebook, Inc.
165
250
*
166
- * This source code is licensed under the BSD-style license found in the
167
- * LICENSE file in the root directory of this source tree. An additional grant
168
- * of patent rights can be found in the PATENTS file in the same directory.
251
+ * This source code is licensed under the MIT license found in the
252
+ * LICENSE file in the root directory of this source tree.
169
253
*/
170
254
171
255
'use strict' ;
@@ -199,7 +283,7 @@ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
199
283
try {
200
284
// This is intentionally an invariant that gets caught. It's the same
201
285
// behavior as without this statement except with a better message.
202
- invariant ( typeof typeSpecs [ typeSpecName ] === 'function' , '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes. ' , componentName || 'React class' , location , typeSpecName ) ;
286
+ invariant ( typeof typeSpecs [ typeSpecName ] === 'function' , '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`. ' , componentName || 'React class' , location , typeSpecName , typeof typeSpecs [ typeSpecName ] ) ;
203
287
error = typeSpecs [ typeSpecName ] ( values , typeSpecName , componentName , location , null , ReactPropTypesSecret ) ;
204
288
} catch ( ex ) {
205
289
error = ex ;
@@ -221,14 +305,12 @@ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
221
305
222
306
module . exports = checkPropTypes ;
223
307
224
- } , { "./lib/ReactPropTypesSecret" :8 , "fbjs/lib/invariant" :2 , "fbjs/lib/warning" :3 } ] , 5 :[ function ( require , module , exports ) {
308
+ } , { "./lib/ReactPropTypesSecret" :9 , "fbjs/lib/invariant" :2 , "fbjs/lib/warning" :3 } ] , 6 :[ function ( require , module , exports ) {
225
309
/**
226
- * Copyright 2013-present, Facebook, Inc.
227
- * All rights reserved.
310
+ * Copyright (c) 2013-present, Facebook, Inc.
228
311
*
229
- * This source code is licensed under the BSD-style license found in the
230
- * LICENSE file in the root directory of this source tree. An additional grant
231
- * of patent rights can be found in the PATENTS file in the same directory.
312
+ * This source code is licensed under the MIT license found in the
313
+ * LICENSE file in the root directory of this source tree.
232
314
*/
233
315
234
316
'use strict' ;
@@ -273,7 +355,8 @@ module.exports = function() {
273
355
objectOf : getShim ,
274
356
oneOf : getShim ,
275
357
oneOfType : getShim ,
276
- shape : getShim
358
+ shape : getShim ,
359
+ exact : getShim
277
360
} ;
278
361
279
362
ReactPropTypes . checkPropTypes = emptyFunction ;
@@ -282,21 +365,20 @@ module.exports = function() {
282
365
return ReactPropTypes ;
283
366
} ;
284
367
285
- } , { "./lib/ReactPropTypesSecret" :8 , "fbjs/lib/emptyFunction" :1 , "fbjs/lib/invariant" :2 } ] , 6 :[ function ( require , module , exports ) {
368
+ } , { "./lib/ReactPropTypesSecret" :9 , "fbjs/lib/emptyFunction" :1 , "fbjs/lib/invariant" :2 } ] , 7 :[ function ( require , module , exports ) {
286
369
/**
287
- * Copyright 2013-present, Facebook, Inc.
288
- * All rights reserved.
370
+ * Copyright (c) 2013-present, Facebook, Inc.
289
371
*
290
- * This source code is licensed under the BSD-style license found in the
291
- * LICENSE file in the root directory of this source tree. An additional grant
292
- * of patent rights can be found in the PATENTS file in the same directory.
372
+ * This source code is licensed under the MIT license found in the
373
+ * LICENSE file in the root directory of this source tree.
293
374
*/
294
375
295
376
'use strict' ;
296
377
297
378
var emptyFunction = require ( 'fbjs/lib/emptyFunction' ) ;
298
379
var invariant = require ( 'fbjs/lib/invariant' ) ;
299
380
var warning = require ( 'fbjs/lib/warning' ) ;
381
+ var assign = require ( 'object-assign' ) ;
300
382
301
383
var ReactPropTypesSecret = require ( './lib/ReactPropTypesSecret' ) ;
302
384
var checkPropTypes = require ( './checkPropTypes' ) ;
@@ -395,7 +477,8 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
395
477
objectOf : createObjectOfTypeChecker ,
396
478
oneOf : createEnumTypeChecker ,
397
479
oneOfType : createUnionTypeChecker ,
398
- shape : createShapeTypeChecker
480
+ shape : createShapeTypeChecker ,
481
+ exact : createStrictShapeTypeChecker ,
399
482
} ;
400
483
401
484
/**
@@ -610,7 +693,7 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
610
693
if ( typeof checker !== 'function' ) {
611
694
warning (
612
695
false ,
613
- 'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' +
696
+ 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
614
697
'received %s at index %s.' ,
615
698
getPostfixForTypeWarning ( checker ) ,
616
699
i
@@ -664,6 +747,36 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
664
747
return createChainableTypeChecker ( validate ) ;
665
748
}
666
749
750
+ function createStrictShapeTypeChecker ( shapeTypes ) {
751
+ function validate ( props , propName , componentName , location , propFullName ) {
752
+ var propValue = props [ propName ] ;
753
+ var propType = getPropType ( propValue ) ;
754
+ if ( propType !== 'object' ) {
755
+ return new PropTypeError ( 'Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ( 'supplied to `' + componentName + '`, expected `object`.' ) ) ;
756
+ }
757
+ // We need to check all keys in case some are required but missing from
758
+ // props.
759
+ var allKeys = assign ( { } , props [ propName ] , shapeTypes ) ;
760
+ for ( var key in allKeys ) {
761
+ var checker = shapeTypes [ key ] ;
762
+ if ( ! checker ) {
763
+ return new PropTypeError (
764
+ 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
765
+ '\nBad object: ' + JSON . stringify ( props [ propName ] , null , ' ' ) +
766
+ '\nValid keys: ' + JSON . stringify ( Object . keys ( shapeTypes ) , null , ' ' )
767
+ ) ;
768
+ }
769
+ var error = checker ( propValue , key , componentName , location , propFullName + '.' + key , ReactPropTypesSecret ) ;
770
+ if ( error ) {
771
+ return error ;
772
+ }
773
+ }
774
+ return null ;
775
+ }
776
+
777
+ return createChainableTypeChecker ( validate ) ;
778
+ }
779
+
667
780
function isNode ( propValue ) {
668
781
switch ( typeof propValue ) {
669
782
case 'number' :
@@ -796,14 +909,12 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
796
909
return ReactPropTypes ;
797
910
} ;
798
911
799
- } , { "./checkPropTypes" :4 , "./lib/ReactPropTypesSecret" :8 , "fbjs/lib/emptyFunction" :1 , "fbjs/lib/invariant" :2 , "fbjs/lib/warning" :3 } ] , 7 :[ function ( require , module , exports ) {
912
+ } , { "./checkPropTypes" :5 , "./lib/ReactPropTypesSecret" :9 , "fbjs/lib/emptyFunction" :1 , "fbjs/lib/invariant" :2 , "fbjs/lib/warning" :3 , "object-assign" : 4 } ] , 8 :[ function ( require , module , exports ) {
800
913
/**
801
- * Copyright 2013-present, Facebook, Inc.
802
- * All rights reserved.
914
+ * Copyright (c) 2013-present, Facebook, Inc.
803
915
*
804
- * This source code is licensed under the BSD-style license found in the
805
- * LICENSE file in the root directory of this source tree. An additional grant
806
- * of patent rights can be found in the PATENTS file in the same directory.
916
+ * This source code is licensed under the MIT license found in the
917
+ * LICENSE file in the root directory of this source tree.
807
918
*/
808
919
809
920
if ( "production" !== 'production' ) {
@@ -828,14 +939,12 @@ if ("production" !== 'production') {
828
939
module . exports = require ( './factoryWithThrowingShims' ) ( ) ;
829
940
}
830
941
831
- } , { "./factoryWithThrowingShims" :5 , "./factoryWithTypeCheckers" :6 } ] , 8 :[ function ( require , module , exports ) {
942
+ } , { "./factoryWithThrowingShims" :6 , "./factoryWithTypeCheckers" :7 } ] , 9 :[ function ( require , module , exports ) {
832
943
/**
833
- * Copyright 2013-present, Facebook, Inc.
834
- * All rights reserved.
944
+ * Copyright (c) 2013-present, Facebook, Inc.
835
945
*
836
- * This source code is licensed under the BSD-style license found in the
837
- * LICENSE file in the root directory of this source tree. An additional grant
838
- * of patent rights can be found in the PATENTS file in the same directory.
946
+ * This source code is licensed under the MIT license found in the
947
+ * LICENSE file in the root directory of this source tree.
839
948
*/
840
949
841
950
'use strict' ;
@@ -844,7 +953,7 @@ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
844
953
845
954
module . exports = ReactPropTypesSecret ;
846
955
847
- } , { } ] , 9 :[ function ( require , module , exports ) {
956
+ } , { } ] , 10 :[ function ( require , module , exports ) {
848
957
Object . defineProperty ( exports , "__esModule" , {
849
958
value : true
850
959
} ) ;
@@ -914,19 +1023,20 @@ function removeAll() {
914
1023
return { type : _const . RNS_REMOVE_ALL_NOTIFICATIONS } ;
915
1024
}
916
1025
917
- } , { "./const" :10 } ] , 10 :[ function ( require , module , exports ) {
1026
+ } , { "./const" :11 } ] , 11 :[ function ( require , module , exports ) {
918
1027
Object . defineProperty ( exports , "__esModule" , {
919
1028
value : true
920
1029
} ) ;
921
1030
var RNS_SHOW_NOTIFICATION = exports . RNS_SHOW_NOTIFICATION = 'RNS_SHOW_NOTIFICATION' ;
922
1031
var RNS_HIDE_NOTIFICATION = exports . RNS_HIDE_NOTIFICATION = 'RNS_HIDE_NOTIFICATION' ;
923
1032
var RNS_REMOVE_ALL_NOTIFICATIONS = exports . RNS_REMOVE_ALL_NOTIFICATIONS = 'RNS_REMOVE_ALL_NOTIFICATIONS' ;
924
1033
925
- } , { } ] , 11 :[ function ( require , module , exports ) {
1034
+ } , { } ] , 12 :[ function ( require , module , exports ) {
926
1035
( function ( global ) {
927
1036
Object . defineProperty ( exports , "__esModule" , {
928
1037
value : true
929
1038
} ) ;
1039
+ exports . reducer = undefined ;
930
1040
931
1041
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 ; } ;
932
1042
@@ -948,6 +1058,19 @@ Object.keys(_actions).forEach(function (key) {
948
1058
} ) ;
949
1059
} ) ;
950
1060
1061
+ var _reducer = require ( './reducer' ) ;
1062
+
1063
+ Object . defineProperty ( exports , 'reducer' , {
1064
+ enumerable : true ,
1065
+ get : function ( ) {
1066
+ function get ( ) {
1067
+ return _interopRequireDefault ( _reducer ) [ 'default' ] ;
1068
+ }
1069
+
1070
+ return get ;
1071
+ } ( )
1072
+ } ) ;
1073
+
951
1074
var _react = ( typeof window !== "undefined" ? window [ 'React' ] : typeof global !== "undefined" ? global [ 'React' ] : null ) ;
952
1075
953
1076
var _react2 = _interopRequireDefault ( _react ) ;
@@ -958,10 +1081,6 @@ var _propTypes2 = _interopRequireDefault(_propTypes);
958
1081
959
1082
var actions = _interopRequireWildcard ( _actions ) ;
960
1083
961
- var _reducer = require ( './reducer' ) ;
962
-
963
- var _reducer2 = _interopRequireDefault ( _reducer ) ;
964
-
965
1084
var _reactNotificationSystem = require ( 'react-notification-system' ) ;
966
1085
967
1086
var _reactNotificationSystem2 = _interopRequireDefault ( _reactNotificationSystem ) ;
@@ -1074,14 +1193,11 @@ Notifications.contextTypes = {
1074
1193
store : _propTypes2 [ 'default' ] . object
1075
1194
} ;
1076
1195
1077
- // Tie actions to Notifications component instance
1078
-
1079
-
1080
- Notifications . reducer = _reducer2 [ 'default' ] ;
1196
+ // Export actions and reducer
1081
1197
exports [ 'default' ] = Notifications ;
1082
1198
1083
1199
} ) . call ( this , typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : { } )
1084
- } , { "./actions" :9 , "./reducer" :12 , "prop-types" :7 , "react-notification-system" :undefined } ] , 12 :[ function ( require , module , exports ) {
1200
+ } , { "./actions" :10 , "./reducer" :13 , "prop-types" :8 , "react-notification-system" :undefined } ] , 13 :[ function ( require , module , exports ) {
1085
1201
Object . defineProperty ( exports , "__esModule" , {
1086
1202
value : true
1087
1203
} ) ;
@@ -1116,5 +1232,5 @@ function Notifications() {
1116
1232
return state ;
1117
1233
}
1118
1234
1119
- } , { "./const" :10 } ] } , { } , [ 11 ] ) ( 11 )
1235
+ } , { "./const" :11 } ] } , { } , [ 12 ] ) ( 12 )
1120
1236
} ) ;
0 commit comments