Skip to content

Commit 3836299

Browse files
joenoonaksonov
authored andcommitted
remove dependency on assert (#698)
1 parent cd3767a commit 3836299

File tree

5 files changed

+8
-4
lines changed

5 files changed

+8
-4
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
}
3737
],
3838
"dependencies": {
39-
"assert": "^1.3.0",
4039
"react-native-tabs": "^1.0.2"
4140
},
4241
"devDependencies": {

src/Actions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* LICENSE file in the root directory of this source tree.
77
*
88
*/
9-
import assert from 'assert';
9+
import { assert } from './Util';
1010
import Scene from './Scene';
1111
export const JUMP_ACTION = 'jump';
1212
export const PUSH_ACTION = 'push';

src/Reducer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
REFRESH_ACTION,
2020
} from './Actions';
2121

22-
import assert from 'assert';
22+
import { assert } from './Util';
2323
import { getInitialState } from './State';
2424

2525
// WARN: it is not working correct. rewrite it.

src/State.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* LICENSE file in the root directory of this source tree.
77
*
88
*/
9-
import assert from 'assert';
9+
import { assert } from './Util';
1010

1111
function getStateFromScenes(route, scenes, props) {
1212
const getters = [];

src/Util.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export function assert(expr, failDescription) {
2+
if (!expr) {
3+
throw new Error(`[react-native-router-flux] ${failDescription}`);
4+
}
5+
}

0 commit comments

Comments
 (0)