This repository was archived by the owner on Mar 16, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +94
-0
lines changed Expand file tree Collapse file tree 4 files changed +94
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Copyright 2016 wkh237@github. All rights reserved.
2
+ // Use of this source code is governed by a MIT-style license that can be
3
+ // found in the LICENSE file.
4
+ // @flow
5
+
6
+ import {
7
+ NativeModules ,
8
+ DeviceEventEmitter ,
9
+ Platform ,
10
+ NativeAppEventEmitter ,
11
+ } from 'react-native'
12
+
13
+ const RNFB = NativeModules . RNFetchBlob
14
+
15
+ export default class FS {
16
+
17
+ static
18
+
19
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright 2016 wkh237@github. All rights reserved.
2
+ // Use of this source code is governed by a MIT-style license that can be
3
+ // found in the LICENSE file.
4
+ // @flow
5
+ import Log from '../utils/log'
6
+ import path from 'path-parse'
7
+ const log = new Log ( 'node-path' )
8
+
9
+ log . level ( 3 )
10
+ log . info ( 'node-path polyfill loaded' )
11
+
12
+ const sep = '/'
13
+
14
+ function basename ( str :string ) :string {
15
+ return path . parse ( str ) . base
16
+ }
17
+
18
+ function dirname ( str :string ) :string {
19
+ return path . parse ( str ) . dir
20
+ }
21
+
22
+ function extname ( str :string ) :string {
23
+ return path . parse ( str ) . ext
24
+ }
25
+
26
+ function format ( args :any ) :string {
27
+ // TODO :
28
+ }
29
+
30
+ function isAbsolute ( str :string ) :boolean {
31
+ // TODO :
32
+ return true
33
+ }
34
+
35
+ function join ( arr :Array ) :string {
36
+ // TODO : error handling and type checking
37
+ return arr . join ( '' )
38
+ }
39
+
40
+ function normalize ( str :string ) :string {
41
+ // TODO
42
+ return str
43
+ }
44
+
45
+ // since nodejs modules uses es5 export by default, we should use es5 export here
46
+ export {
47
+ extname ,
48
+ dirname ,
49
+ basename ,
50
+ // TODOs
51
+ normalize ,
52
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright 2016 wkh237@github. All rights reserved.
2
+ // Use of this source code is governed by a MIT-style license that can be
3
+ // found in the LICENSE file.
4
+ // @flow
5
+ import Log from '../utils/log'
6
+ const log = new Log ( 'node-util' )
7
+
8
+ log . level ( 3 )
9
+ log . info ( 'node-util polyfill loaded' )
10
+
11
+ function inherits ( ctor , superCtor ) :any {
12
+ log . verbose ( 'inherits' , superCtor , superCtor )
13
+ if ( superCtor ) {
14
+ ctor . prototype = superCtor . prototype
15
+ ctor . super_ = superCtor
16
+ }
17
+ return ctor
18
+ }
19
+
20
+ // since nodejs modules uses es5 export by default, we should use es5 export here
21
+ export {
22
+ inherits
23
+ }
You can’t perform that action at this time.
0 commit comments