redux-collector
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -156,3 +156,3 @@ 'use strict'; | ||
for (var i = 0, updated = 0; i < state.length; i++) { | ||
if (i >= skip && updated < limit && matcher(state[i], query, i)) { | ||
if (i >= skip && updated < limit && matcher(state[i], query)) { | ||
result.push(reducer(state[i], rest)); | ||
@@ -198,3 +198,3 @@ updated++; | ||
for (var i = 0, removed = 0; i < state.length; i++) { | ||
if (i < skip || removed >= limit || query !== undefined && !matcher(state[i], query, i)) { | ||
if (i < skip || removed >= limit || query !== undefined && !matcher(state[i], query)) { | ||
result.push(state[i]); | ||
@@ -228,2 +228,2 @@ } else { | ||
exports.default = collectorReducerBase; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9jb2xsZWN0b3ItcmVkdWNlci1iYXNlLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7O0FBQUE7O0FBQ0E7O0FBQ0E7Ozs7Ozs7Ozs7QUFFQSxTQUFTLGNBQVQsT0FBdUM7QUFBQSxNQUFkLEtBQWMsUUFBZCxLQUFjO0FBQUEsTUFBUCxJQUFPLFFBQVAsSUFBTzs7QUFDckMsU0FBTztBQUNMLGNBREs7QUFFTCxXQUFPLFFBQVE7QUFGVixHQUFQO0FBSUQ7O0FBRUQsU0FBUyxvQkFBVCxRQUErRztBQUFBLE1BQWhGLFdBQWdGLFNBQWhGLFdBQWdGO0FBQUEsTUFBbkUsT0FBbUUsU0FBbkUsT0FBbUU7QUFBQSxNQUExRCxVQUEwRCxTQUExRCxVQUEwRDtBQUFBLE1BQTlDLGNBQThDLFNBQTlDLGNBQThDO0FBQUEsTUFBOUIsT0FBOEIsU0FBOUIsT0FBOEI7QUFBQSxNQUFyQixVQUFxQixTQUFyQixVQUFxQjtBQUFBLE1BQVQsTUFBUyxTQUFULE1BQVM7OztBQUk3RyxTQUFPO0FBQ0wsT0FESyxpQkFDMEQ7Q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uICB9O1xufVxuXG5leHBvcnQgZGVmYXVsdCBjb2xsZWN0b3JSZWR1Y2VyQmFzZTtcbiJdfQ== |
@@ -86,2 +86,3 @@ 'use strict'; | ||
var action = normalizeAction(stateArg, actionArgs); | ||
var indexes = (0, _normalizers.normalizeIndexArgs)(actionArgs); | ||
@@ -92,3 +93,3 @@ for (var _len = arguments.length, args = Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) { | ||
var result = reducer.call.apply(reducer, [this, stateArg, action].concat(args)); | ||
var result = reducer.call.apply(reducer, [this, stateArg, _extends({}, action, indexes)].concat(args)); | ||
return (0, _lib.resultTransform)(result, action); | ||
@@ -146,2 +147,2 @@ } | ||
exports.default = generateCollector; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9jb2xsZWN0b3ItcmVkdWNlcnMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7QUFBQTs7OztBQUNBOztBQUVBOztBQUNBOztBQUVBOztBQUNBOztBQUNBOzs7O0FBQ0E7Ozs7OztBQUVBLFNBQVMsVUFBVCxDQUFxQixLQUFyQixFQUE0QjtBQUMxQixNQUFJLENBQUMsaUJBQUUsT0FBRixDQUFVLEtBQVYsQ0FBTCxFQUF1QjtBQUNyQix5Q0FBbUMsS0FBSyxTQUFMLENBQWUsS0FBZixDQUFuQztBQUNEO0FBQ0Y7O0FBRUQsU0FBUyxpQkFBVCxHQUErSztBQUFBLG1FQUEzRCxFQUEyRDs7QUFBQSxNQUExSSxVQUEwSSxRQUFuSixPQUFtSjtBQUFBLE1BQXJILFVBQXFILFFBQTlILE9BQThIO0FBQUEsTUFBOUYsWUFBOEYsUUFBekcsU0FBeUc7QUFBQSxNQUF4RSxTQUF3RSxRQUFoRixNQUFnRjs7QUFBQSxvRUFBSixFQUFJOztBQUFBLDRCQUF0RCxPQUFzRDtBQUFBLE1BQTdDLFdBQTZDLGlDQU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3RvcjtcbiJdfQ== |
@@ -17,4 +17,8 @@ 'use strict'; | ||
return true; | ||
} else if (_lodash2.default.isArray(predicate)) { | ||
return _lodash2.default.every(predicate, function (query) { | ||
return defaultMatcher(arg, query, index); | ||
}); | ||
} else if (_lodash2.default.isFunction(predicate)) { | ||
return predicate(arg); | ||
return predicate(arg, index); | ||
} else if (_lodash2.default.isBoolean(predicate)) { | ||
@@ -24,2 +28,6 @@ return predicate; | ||
return predicate === arg; | ||
} else if (predicate.$or) { | ||
return _lodash2.default.some(predicate.$or, function (query) { | ||
return defaultMatcher(arg, query, index); | ||
}); | ||
} else { | ||
@@ -31,2 +39,2 @@ return _lodash2.default.isMatch(arg, predicate); | ||
exports.defaultMatcher = defaultMatcher; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9kZWZhdWx0LXJlc29sdmVyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFBQTs7Ozs7O0FBRUEsU0FBUyxjQUFULENBQXdCLEdBQXhCLEVBQTZCLFNBQTdCLEVBQXdDLEtBQXhDLEVBQStDO0FBQzdDLE1BQUksY0FBYyxTQUFsQixFQUE2QjtBQUMzQixXQUFPLElBQVA7QUFDRCxHQUZELE1BRU8sSUFBSSxpQkFBRSxVQUFGLENBQWEsU0FBYixDQUFKLEVBQTZCO0FBQ2xDLFdBQU8sVUFBVSxHQUFWLENBQVA7QUFDRCxHQUZNLE1BRUEsSUFBRyxpQkFBRSxTQUFGLENBQVksU0FBWixDQUFILEVBQTJCO0FBQ2hDLFdBQU8sU0FBUDtBQUNELEdBRk0sTUFFQSxJQUFHLENBQUMsaUJBQUUsYUFBRixDQUFnQixTQUFoQixDQUFKLEVBQWdDO0FBQ3JDLFdBQU8sY0FBYyxHQUFyQjtBQUNELEdBRk0sTUFFQTtBQUNMLFdBQU8saUJBQUUsT0FBRixDQUFVLEdBQVYsRUFBZSxTQUFmL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VyeSA9PiBkZWZhdWx0TWF0Y2hlcihhcmcsIHF1ZXJ5LCBpbmRleCkpO1xuICB9IGVsc2UgaWYgKF8uaXNGdW5jdGlvbihwcmVkaWNhdGUpKSB7XG4gICAgcmV0dXJuIHByZWRpY2F0ZShhcmcsIGluZGV4KTtcbiAgfSBlbHNlIGlmKF8uaXNCb29sZWFuKHByZWRpY2F0ZSkpIHtcbiAgICByZXR1cm4gcHJlZGljYXRlO1xuICB9IGVsc2UgaWYoIV8uaXNQbGFpbk9iamVjdChwcmVkaWNhdGUpKSB7XG4gICAgcmV0dXJuIHByZWRpY2F0ZSA9PT0gYXJnO1xuICB9IGVsc2UgaWYocHJlZGljYXRlLiRvcikge1xuICAgIHJldHVybiBfLnNvbWUocHJlZGljYXRlLiRvciwgcXVlcnkgPT4gZGVmYXVsdE1hdGNoZXIoYXJnLCBxdWVyeSwgaW5kZXgpKTtcbiAgfSBlbHNlIHtcbiAgICByZXR1cm4gXy5pc01hdGNoKGFyZywgcHJlZGljYXRlKTtcbiAgfVxufVxuXG5leHBvcnQge2RlZmF1bHRNYXRjaGVyfTtcbiJdfQ== |
@@ -84,10 +84,11 @@ 'use strict'; | ||
function matcherWrap(fn, _ref7) { | ||
function matcherWrap(fn, _ref7, query) { | ||
var item = _ref7.item; | ||
var index = _ref7.index; | ||
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { | ||
args[_key - 2] = arguments[_key]; | ||
for (var _len = arguments.length, args = Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) { | ||
args[_key - 3] = arguments[_key]; | ||
} | ||
return fn.call.apply(fn, [this, item].concat(args)); | ||
return fn.call.apply(fn, [this, item, query, index].concat(args)); | ||
} | ||
@@ -104,2 +105,2 @@ | ||
exports.sortTransform = sortTransform; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9saWIuanMiXSwibmFtZXMiO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0IHtjbGFtcCwgbWF0Y2hlcldyYXAsIGNvbnRhaW5zLCBtYXBJbmRleGVzLCB1bk1hcEluZGV4ZXMsIHJlc3VsdFRyYW5zZm9ybSwgc29ydFJlc3VsdFRyYW5zZm9ybSwgYWRkV3JhcHBlciwgc29ydFRyYW5zZm9ybX07XG4iXX0= |
@@ -99,2 +99,3 @@ 'use strict'; | ||
var limit = _action$limit === undefined ? state.length : _action$limit; | ||
var indexes = action.indexes; | ||
var index = action.index; | ||
@@ -104,3 +105,3 @@ var after = action.after; | ||
var rest = _objectWithoutProperties(action, ['skip', 'limit', 'index', 'after', 'range']); | ||
var rest = _objectWithoutProperties(action, ['skip', 'limit', 'indexes', 'index', 'after', 'range']); | ||
@@ -126,3 +127,8 @@ var toSkip = skip; | ||
} | ||
return _extends({ skip: toSkip, limit: toLimit }, rest); | ||
if (indexes !== undefined && rest.query === undefined) { | ||
rest.query = function (item, index) { | ||
return (0, _lib.contains)(indexes, index); | ||
}; | ||
} | ||
return _extends({ skip: toSkip, indexes: indexes, limit: toLimit }, rest); | ||
} | ||
@@ -144,2 +150,2 @@ | ||
exports.normalizeTo = normalizeTo; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9ub3JtYWxpemVycy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7OztBQUFBOzs7O0FBRUE7O0FBQ0E7Ozs7Ozs7O0FBRUEsU0FBUyxjQUFULENBQXdCLFFBQXhCLEVBQWtDO0FBQ2hDLE1BQU0sUUFBUSxpQkFBRSxRQUFGLENBQVcsUUFBWCxJQUNWLFNBQVMsV0FBVCxFQURVLEdBRVYsUUFGSjtBQUdBLE1BQUksbUJBQVMsb0JBQVksSUFBckIsRUFBMkIsUUFBM0IsQ0FBSixFQUEwQztBQUN4QyxXQUFPLE1BQVA7QUFDRDtBQUNELE1BQUksbUJBQVMsb0JBQVksR0FBckIsRUFBME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XR1cm4gXy5pc051bWJlcihmcm9tKVxuICAgID8ge2luZGV4OiBmcm9tfVxuICAgIDogXy5pc0FycmF5KGZyb20pXG4gICAgPyBmcm9tLmxlbmd0aCA9PT0gMiA/IHtyYW5nZTogZnJvbX0gOiB7aW5kZXhlczogZnJvbX1cbiAgICA6IF8uaXNGdW5jdGlvbihmcm9tKSA/IHtxdWVyeTogZnJvbX0gOiBmcm9tO1xufVxuXG5mdW5jdGlvbiBub3JtYWxpemVUbyh0bykge1xuICByZXR1cm4gXy5pc051bWJlcih0bylcbiAgICA/IHtpbmRleDogdG99XG4gICAgOiBfLmlzQXJyYXkodG8pXG4gICAgPyB7cmFuZ2U6IHRvfVxuICAgIDogdG87XG59XG5cblxuZXhwb3J0IHtub3JtYWxpemVPcmRlciwgbm9ybWFsaXplU29ydEFyZ3MsIG5vcm1hbGl6ZUluZGV4QXJncywgbm9ybWFsaXplQWN0aW9uLCBub3JtYWxpemVGcm9tLCBub3JtYWxpemVUb307XG4iXX0= |
{ | ||
"name": "redux-collector", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Easy Collection Reducers for Redux", | ||
@@ -5,0 +5,0 @@ "main": "lib/redux-collector.js", |
375
README.md
@@ -124,2 +124,353 @@ # Redux Collector [![Build Status](https://travis-ci.org/gtg092x/redux-collector.svg?branch=master)](https://travis-ci.org/gtg092x/redux-collector) | ||
Basically, you'll get a reducer that does everything you need to arrays. When you call `collectify` you'll get a chance to declare action types for any of the following methods. | ||
### Collectify | ||
```js | ||
collectify([[itemReducer<Object|Function>], actionTypes<Object>]); | ||
``` | ||
One primary function, wrap your item reducers with this. | ||
`itemReducer` | ||
Use reducer that you want applied to items in an array as the first (optional) argument. | ||
`actionTypes` | ||
Use this to declare the action types you want to use to manipulate your array. This is a sample configuration: | ||
```js | ||
function itemReducer(state, action) { | ||
// reducer stuff | ||
} | ||
const actionTypes = { | ||
add = 'ADD_MY_ITEM', | ||
move = 'MOVE_MY_ITEM', | ||
swap = 'SWAP_MY_ITEMS', | ||
addRange = 'ADD_MY_ITEMS', | ||
remove = 'REMOVE_MY_ITEMS', | ||
hydrate = 'HYDRATE_MY_ITEMS', | ||
sort = 'SORT_MY_ITEMS' | ||
}; | ||
const myReducer = collectify(itemReducer, actionTypes); | ||
``` | ||
If you pass only one argument, we assume the reducer is a static reducer for an empty array and will treat the one argument as the `actionTypes` argument. See [Reducify static reducers](http://reducify.mediadrake.com/#statics). | ||
### Reducers | ||
If your Collectify reducer does not receive an action type outlined in your config, any actions you dispatch will be passed to your item reducer for every item in your array. | ||
For example: | ||
```js | ||
function itemReducer(state, action) { | ||
switch(action.type) { | ||
case "INCREMENT_BY_TWO": | ||
return state + 2; | ||
default: | ||
return state; | ||
} | ||
} | ||
const myStore = createStore(collectify(itemReducer, {hydrate: 'SET_ITEMS'})); | ||
myStore.dispatch({ | ||
type: 'SET_ITEMS', | ||
data: [2, 4, 6] | ||
}); | ||
// state is [2, 4, 6] | ||
myStore.dispatch({ | ||
type: 'INCREMENT_BY_TWO' | ||
}); | ||
// state is [4, 6, 8] | ||
``` | ||
Notice the action 'INCREMENT_BY_TWO' was applied to every item in the array. | ||
### Config | ||
There are two configuration options you can pass in with your action types. | ||
#### collectionDefault | ||
This is the default or initial value of the collection. | ||
```js | ||
function itemReducer(state, action) { | ||
// reducer stuff | ||
} | ||
const myStore = createStore(collectify(itemReducer, {collectionDefault: [1, 2]})); | ||
myStore.dispatch({ | ||
type: 'PASS' | ||
}); | ||
// state is [1, 2] | ||
``` | ||
#### itemDefault | ||
The default value for any item added with `add` or `addRange` | ||
```js | ||
function itemReducer(state, action) { | ||
// reducer stuff | ||
} | ||
const myStore = createStore(collectify(itemReducer, {itemDefault: 10, add: 'ADD_ITEM'})); | ||
myStore.dispatch({ | ||
type: 'ADD_ITEM' | ||
}); | ||
// state is [10] | ||
``` | ||
### Actions | ||
The actions will manipulate your array in some form or another. | ||
#### Hydrate | ||
This sets the data for your collection. It will override your entire array unless you pass in a `skip` parameter. | ||
```js | ||
function itemReducer(state, action) { | ||
// reducer stuff | ||
} | ||
const myStore = createStore( | ||
collectify( | ||
itemReducer, | ||
{ | ||
hydrate: 'HYDRATE_ITEMS' | ||
} | ||
) | ||
); | ||
myStore.dispatch({ | ||
type: 'HYDRATE', | ||
data: [1, 2, 3, 4] // data is required | ||
}); | ||
``` | ||
#### Add | ||
This will add an item to your collection. It will default to `itemDefault` if you passed one with your configuration. | ||
```js | ||
function itemReducer(state, action) { | ||
// reducer stuff | ||
} | ||
const myStore = createStore( | ||
collectify( | ||
itemReducer, | ||
{ | ||
itemDefault: 10, | ||
add: 'ADD_ITEM' | ||
} | ||
) | ||
); | ||
myStore.dispatch({ | ||
type: 'ADD_ITEM' | ||
}); | ||
// state is [10] | ||
myStore.dispatch({ | ||
type: 'ADD_ITEM', | ||
data: 11 | ||
}); | ||
// state is [10, 11] | ||
``` | ||
You can pass any [index argument](#indexes) as well. | ||
```js | ||
function itemReducer(state, action) { | ||
// reducer stuff | ||
} | ||
const myStore = createStore( | ||
collectify( | ||
itemReducer, | ||
{ add: 'ADD_ITEM' } | ||
) | ||
); | ||
myStore.dispatch({ | ||
type: 'ADD_ITEM', | ||
index: 0, | ||
data: 2 | ||
}); | ||
// state is [2] | ||
myStore.dispatch({ | ||
type: 'ADD_ITEM', | ||
index: 0, | ||
data: 3 | ||
}); | ||
// state is [3, 2] | ||
``` | ||
#### Add Range | ||
The same as `add`, except this is for adding multiple items at once. | ||
```js | ||
function itemReducer(state, action) { | ||
// reducer stuff | ||
} | ||
const myStore = createStore( | ||
collectify( | ||
itemReducer, | ||
{ | ||
itemDefault: 10, | ||
addRange: 'ADD_MULTIPLE_ITEMS' | ||
} | ||
) | ||
); | ||
myStore.dispatch({ | ||
type: 'ADD_MULTIPLE_ITEMS' | ||
}); | ||
// state is [10] | ||
myStore.dispatch({ | ||
type: 'ADD_MULTIPLE_ITEMS', | ||
data: [11, 12] | ||
}); | ||
// state is [10, 11, 12] | ||
``` | ||
You can pass any [index argument](#indexes) as well. | ||
```js | ||
function itemReducer(state, action) { | ||
// reducer stuff | ||
} | ||
const myStore = createStore( | ||
collectify( | ||
itemReducer, | ||
{ addRange: 'ADD_MULTIPLE_ITEMS' } | ||
) | ||
); | ||
myStore.dispatch({ | ||
type: 'ADD_MULTIPLE_ITEMS', | ||
index: 0, | ||
data: [2, 3] | ||
}); | ||
// state is [2, 3] | ||
myStore.dispatch({ | ||
type: 'ADD_MULTIPLE_ITEMS', | ||
index: 0, | ||
data: [4, 5] | ||
}); | ||
// state is [4, 5, 2, 3] | ||
``` | ||
#### Remove | ||
This will remove items from your collection. If you do not pass a [query](#queries), it will clear the entire collection. | ||
```js | ||
const myStore = createStore( | ||
collectify( | ||
[1, 2, 3, 4], // this is a static reducify reducer - defaulting to this array | ||
{ | ||
hydrate: 'HYDRATE_ITEMS', | ||
remove: 'REMOVE_ITEMS' | ||
} | ||
) | ||
); | ||
myStore.dispatch({ | ||
type: 'REMOVE_ITEMS' | ||
}); | ||
// state is [] | ||
myStore.dispatch({ | ||
type: 'HYDRATE_ITEMS', | ||
data: [1, 2, 3, 4] | ||
}); | ||
// state is [1, 2, 3, 4] | ||
myStore.dispatch({ | ||
type: 'REMOVE_ITEMS', | ||
query: item => item > 2 | ||
}); | ||
// state is [1, 2] | ||
myStore.dispatch({ | ||
type: 'REMOVE_ITEMS', | ||
query: item => item > 2 | ||
}); | ||
// state is [1, 2] | ||
myStore.dispatch({ | ||
type: 'REMOVE_ITEMS', | ||
limit: 1 | ||
}); | ||
// state is [2] | ||
``` | ||
You can pass any [index argument](#indexes) as well. | ||
```js | ||
myStore.dispatch({ | ||
type: 'HYDRATE_ITEMS', | ||
data: [1, 2, 3, 4] | ||
}); | ||
myStore.dispatch({ | ||
type: 'REMOVE_ITEMS', | ||
index: 0 | ||
}); | ||
// state is [2, 3, 4] | ||
myStore.dispatch({ | ||
type: 'REMOVE_ITEMS', | ||
indexes: [0, 2] | ||
}); | ||
// state is [3] | ||
``` | ||
#### Sort | ||
#### Move | ||
#### Swap | ||
### Queries | ||
### Operations | ||
@@ -143,26 +494,10 @@ | ||
## Api | ||
## Gotchas | ||
### Hydrate | ||
## Integration | ||
### Add | ||
### With Pipeline | ||
### Add Range | ||
### Without Pipeline | ||
### Remove | ||
### Sort | ||
### Move | ||
### Swap | ||
### Reducers | ||
## Gotchas | ||
## With Pipeline | ||
## Without Pipeline | ||
## Credits | ||
@@ -169,0 +504,0 @@ |
@@ -188,2 +188,18 @@ import collectify from '../src/redux-collector'; | ||
it ("Should support index", function () { | ||
const state = [1, 2, 3, 4, 5]; | ||
let newArr = myReducer(state, {type: removeAction, index: 0}); | ||
assert.deepEqual([2, 3, 4, 5], newArr); | ||
}); | ||
it ("Should support indexes", function () { | ||
const state = [1, 2, 3, 4, 5]; | ||
let newArr = myReducer(state, {type: removeAction, indexes: [0, 2]}); | ||
assert.deepEqual([2, 4, 5], newArr); | ||
}); | ||
it ("Should support order", function () { | ||
@@ -327,2 +343,13 @@ | ||
newArr = myReducer([-3, -1, -4], {...action, query: [item => Math.ceil(item) < -1, item => Math.ceil(item) >= -3]}); | ||
assert.notEqual(-3, newArr[0]); | ||
assert.equal(-4, newArr[2]); | ||
assert.equal(3, newArr.length); | ||
newArr = myReducer([-3, -1, -4], {...action, query: {$or: [item => Math.ceil(item) < -1, item => Math.ceil(item) >= -3]}}); | ||
assert.notEqual(-3, newArr[0]); | ||
assert.notEqual(-1, newArr[1]); | ||
assert.notEqual(-4, newArr[2]); | ||
assert.equal(3, newArr.length); | ||
}); | ||
@@ -329,0 +356,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
224052
1905
509