File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ const DEFAULT_PREFIX = 'RN';
12
12
const DEFAULT_MODULE_PREFIX = 'react-native' ;
13
13
const DEFAULT_PACKAGE_IDENTIFIER = 'com.reactlibrary' ;
14
14
const DEFAULT_PLATFORMS = [ 'android' , 'ios' , 'windows' ] ;
15
+ const DEFAULT_OVERRIDE_PREFIX = false ;
15
16
16
17
module . exports = ( {
17
18
namespace,
@@ -20,14 +21,17 @@ module.exports = ({
20
21
modulePrefix = DEFAULT_MODULE_PREFIX ,
21
22
packageIdentifier = DEFAULT_PACKAGE_IDENTIFIER ,
22
23
platforms = DEFAULT_PLATFORMS ,
24
+ overridePrefix = DEFAULT_OVERRIDE_PREFIX ,
23
25
} ) => {
24
- if ( hasPrefix ( name ) ) {
25
- throw new Error ( 'Please don\'t include the prefix in the name' ) ;
26
- }
26
+ if ( ! overridePrefix ) {
27
+ if ( hasPrefix ( name ) ) {
28
+ throw new Error ( 'Please don\'t include the prefix in the name' ) ;
29
+ }
27
30
28
- if ( prefix === 'RCT' ) {
29
- throw new Error ( `The \`RCT\` name prefix is reserved for core React modules.
30
- Please use a different prefix.` ) ;
31
+ if ( prefix === 'RCT' ) {
32
+ throw new Error ( `The \`RCT\` name prefix is reserved for core React modules.
33
+ Please use a different prefix.` ) ;
34
+ }
31
35
}
32
36
33
37
if ( pathExists . sync ( path . join ( process . cwd ( ) , 'package.json' ) ) ) {
You can’t perform that action at this time.
0 commit comments