Skip to content

Commit e769a2c

Browse files
committed
chore: fix spellchecker issues
1 parent 48f3f4c commit e769a2c

1 file changed

Lines changed: 32 additions & 30 deletions

File tree

crates/rspack_plugin_javascript/src/dependency/amd/amd_define_dependency.rs

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,24 @@ impl Branch {
2525
RuntimeGlobals::REQUIRE | RuntimeGlobals::EXPORTS | RuntimeGlobals::MODULE
2626
}
2727
o if o == Branch::O => RuntimeGlobals::MODULE,
28-
of if of == (Branch::O | Branch::F) => {
28+
o_f if o_f == (Branch::O | Branch::F) => {
2929
RuntimeGlobals::REQUIRE | RuntimeGlobals::EXPORTS | RuntimeGlobals::MODULE
3030
}
31-
af if af == (Branch::A | Branch::F) => RuntimeGlobals::EXPORTS | RuntimeGlobals::MODULE,
32-
ao if ao == (Branch::A | Branch::O) => RuntimeGlobals::MODULE,
33-
aof if aof == (Branch::A | Branch::O | Branch::F) => {
31+
a_f if a_f == (Branch::A | Branch::F) => RuntimeGlobals::EXPORTS | RuntimeGlobals::MODULE,
32+
a_o if a_o == (Branch::A | Branch::O) => RuntimeGlobals::MODULE,
33+
a_o_f if a_o_f == (Branch::A | Branch::O | Branch::F) => {
3434
RuntimeGlobals::EXPORTS | RuntimeGlobals::MODULE
3535
}
36-
lf if lf == (Branch::L | Branch::F) => RuntimeGlobals::REQUIRE | RuntimeGlobals::MODULE,
37-
lo if lo == (Branch::L | Branch::O) => RuntimeGlobals::empty(),
38-
lof if lof == (Branch::L | Branch::O | Branch::F) => {
36+
l_f if l_f == (Branch::L | Branch::F) => RuntimeGlobals::REQUIRE | RuntimeGlobals::MODULE,
37+
l_o if l_o == (Branch::L | Branch::O) => RuntimeGlobals::empty(),
38+
l_o_f if l_o_f == (Branch::L | Branch::O | Branch::F) => {
3939
RuntimeGlobals::REQUIRE | RuntimeGlobals::MODULE
4040
}
41-
laf if laf == (Branch::L | Branch::A | Branch::F) => RuntimeGlobals::empty(),
42-
lao if lao == (Branch::L | Branch::A | Branch::O) => RuntimeGlobals::empty(),
43-
laof if laof == (Branch::L | Branch::A | Branch::O | Branch::F) => RuntimeGlobals::empty(),
41+
l_a_f if l_a_f == (Branch::L | Branch::A | Branch::F) => RuntimeGlobals::empty(),
42+
l_a_o if l_a_o == (Branch::L | Branch::A | Branch::O) => RuntimeGlobals::empty(),
43+
l_a_o_f if l_a_o_f == (Branch::L | Branch::A | Branch::O | Branch::F) => {
44+
RuntimeGlobals::empty()
45+
}
4446
_ => RuntimeGlobals::empty(),
4547
}
4648
}
@@ -53,30 +55,30 @@ impl Branch {
5355
match *self {
5456
f if f == Branch::F => "var __WEBPACK_AMD_DEFINE_RESULT__;".to_string(),
5557
o if o == Branch::O => "".to_string(),
56-
of if of == (Branch::O | Branch::F) => {
58+
o_f if o_f == (Branch::O | Branch::F) => {
5759
"var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;".to_string()
5860
}
59-
af if af == (Branch::A | Branch::F) => {
61+
a_f if a_f == (Branch::A | Branch::F) => {
6062
"var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;".to_string()
6163
}
62-
ao if ao == (Branch::A | Branch::O) => "".to_string(),
63-
aof if aof == (Branch::A | Branch::O | Branch::F) => "var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;".to_string(),
64-
lf if lf == (Branch::L | Branch::F) => {
64+
a_o if a_o == (Branch::A | Branch::O) => "".to_string(),
65+
a_o_f if a_o_f == (Branch::A | Branch::O | Branch::F) => "var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;".to_string(),
66+
l_f if l_f == (Branch::L | Branch::F) => {
6567
format!("var {}, {}module;", name, name)
6668
},
67-
lo if lo == (Branch::L | Branch::O) => {
69+
l_o if l_o == (Branch::L | Branch::O) => {
6870
format!("var {};", name)
6971
},
70-
lof if lof == (Branch::L | Branch::O | Branch::F) => {
72+
l_o_f if l_o_f == (Branch::L | Branch::O | Branch::F) => {
7173
format!("var {}, {}factory, {}module;", name, name, name)
7274
},
73-
laf if laf == (Branch::L | Branch::A | Branch::F) => {
75+
l_a_f if l_a_f == (Branch::L | Branch::A | Branch::F) => {
7476
format!("var __WEBPACK_AMD_DEFINE_ARRAY__, {}, {}exports;", name, name)
7577
},
76-
lao if lao == (Branch::L | Branch::A | Branch::O)=> {
78+
l_a_o if l_a_o == (Branch::L | Branch::A | Branch::O)=> {
7779
format!("var {};", name)
7880
},
79-
laof if laof == (Branch::L | Branch::A | Branch::O | Branch::F) => {
81+
l_a_o_f if l_a_o_f == (Branch::L | Branch::A | Branch::O | Branch::F) => {
8082
format!("var {}array, {}factory, {}exports, {};", name, name, name, name)
8183
},
8284
_ => "".to_string(),
@@ -105,7 +107,7 @@ impl Branch {
105107
)
106108
}
107109
o if o == Branch::O => "!(module.exports = #)".to_string(),
108-
of if of == (Branch::O | Branch::F) => {
110+
o_f if o_f == (Branch::O | Branch::F) => {
109111
format!(
110112
"!(__WEBPACK_AMD_DEFINE_FACTORY__ = (#),
111113
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
@@ -115,35 +117,35 @@ impl Branch {
115117
require = RuntimeGlobals::REQUIRE.name()
116118
)
117119
}
118-
af if af == (Branch::A | Branch::F) => "!(__WEBPACK_AMD_DEFINE_ARRAY__ = #, __WEBPACK_AMD_DEFINE_RESULT__ = (#).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
120+
a_f if a_f == (Branch::A | Branch::F) => "!(__WEBPACK_AMD_DEFINE_ARRAY__ = #, __WEBPACK_AMD_DEFINE_RESULT__ = (#).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
119121
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))".to_string(),
120-
ao if ao == (Branch::A | Branch::O) => "!(#, module.exports = #)".to_string(),
121-
aof if aof == (Branch::A | Branch::O | Branch::F) => {
122+
a_o if a_o == (Branch::A | Branch::O) => "!(#, module.exports = #)".to_string(),
123+
a_o_f if a_o_f == (Branch::A | Branch::O | Branch::F) => {
122124
"!(__WEBPACK_AMD_DEFINE_ARRAY__ = #, __WEBPACK_AMD_DEFINE_FACTORY__ = (#),
123125
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
124126
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
125127
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))".to_string()
126128
}
127-
lf if lf == (Branch::L | Branch::F) => {
129+
l_f if l_f == (Branch::L | Branch::F) => {
128130
format!(
129131
"!({var_name}module = {{ id: {module_id}, exports: {{}}, loaded: false }}, {var_name} = (#).call({var_name}module.exports, {require}, {var_name}module.exports, {var_name}module), {var_name}module.loaded = true, {var_name} === undefined && ({var_name} = {var_name}module.exports))",
130132
var_name = local_module_var,
131133
module_id = json_stringify(named_module),
132134
require = RuntimeGlobals::REQUIRE.name(),
133135
)
134136
}
135-
lo if lo == (Branch::L | Branch::O) => format!("!({} = #)", local_module_var),
136-
lof if lof == (Branch::L | Branch::O | Branch::F) => {
137+
l_o if l_o == (Branch::L | Branch::O) => format!("!({} = #)", local_module_var),
138+
l_o_f if l_o_f == (Branch::L | Branch::O | Branch::F) => {
137139
format!(
138140
"!({var_name}factory = (#), (typeof {var_name}factory === 'function' ? (({var_name}module = {{ id: {module_id}, exports: {{}}, loaded: false }}), ({var_name} = {var_name}factory.call({var_name}module.exports, {require}, {var_name}module.exports, {var_name}module)), ({var_name}module.loaded = true), {var_name} === undefined && ({var_name} = {var_name}module.exports)) : {var_name} = {var_name}factory))",
139141
var_name = local_module_var,
140142
module_id = json_stringify(named_module),
141143
require = RuntimeGlobals::REQUIRE.name(),
142144
)
143145
}
144-
laf if laf == (Branch::L | Branch::A | Branch::F) => format!("!(__WEBPACK_AMD_DEFINE_ARRAY__ = #, {} = (#).apply({}exports = {{}}, __WEBPACK_AMD_DEFINE_ARRAY__), {} === undefined && ({} = {}exports))", local_module_var, local_module_var, local_module_var, local_module_var, local_module_var),
145-
lao if lao == (Branch::L | Branch::A | Branch::O) => format!("!(#, {} = #)", local_module_var),
146-
laof if laof == (Branch::L | Branch::A | Branch::O | Branch::F) => format!(
146+
l_a_f if l_a_f == (Branch::L | Branch::A | Branch::F) => format!("!(__WEBPACK_AMD_DEFINE_ARRAY__ = #, {} = (#).apply({}exports = {{}}, __WEBPACK_AMD_DEFINE_ARRAY__), {} === undefined && ({} = {}exports))", local_module_var, local_module_var, local_module_var, local_module_var, local_module_var),
147+
l_a_o if l_a_o == (Branch::L | Branch::A | Branch::O) => format!("!(#, {} = #)", local_module_var),
148+
l_a_o_f if l_a_o_f == (Branch::L | Branch::A | Branch::O | Branch::F) => format!(
147149
"!({var_name}array = #, {var_name}factory = (#),
148150
(typeof {var_name}factory === 'function' ?
149151
(({var_name} = {var_name}factory.apply({var_name}exports = {{}}, {var_name}array)), {var_name} === undefined && ({var_name} = {var_name}exports)) :

0 commit comments

Comments
 (0)