Skip to content

Commit 20bd42b

Browse files
thonatosJacksonTian
authored andcommitted
refactor: replace typeof() with typeof
1 parent 24387f0 commit 20bd42b

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

app/view/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class="topic-tab <%= value === tab ? 'current-tab' : '' %>"><%= text %></a>
1111
<% }) %>
1212
</div>
13-
<% if (typeof(topics) !== 'undefined' && topics.length > 0) { %>
13+
<% if (typeof topics !== 'undefined' && topics.length > 0) { %>
1414
<div class="inner no-padding">
1515
<%- include('topic/list', {
1616
topics: topics,

app/view/layout.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@
5252
.done(assets, config.site_static_host, config.mini_assets)
5353
%>
5454

55-
<% if (typeof(topic) !== 'undefined') { %>
55+
<% if (typeof topic !== 'undefined') { %>
5656
<title><%= topic.title %> - <%= config.name %></title>
57-
<% } else if (typeof(pageTitle) !== 'undefined') { %>
57+
<% } else if (typeof pageTitle !== 'undefined') { %>
5858
<title><%= pageTitle %> - <%= config.name %></title>
5959
<% } else { %>
6060
<title><%= config.description %></title>

app/view/sidebar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<span class='col_fade'>个人信息</span>
77
</div>
88
<div class='inner'>
9-
<%- include('./user/card.html',{ object: typeof(user) === 'undefined' ? current_user : user, as: 'user' }) %>
9+
<%- include('./user/card.html',{ object: typeof user === 'undefined' ? current_user : user, as: 'user' }) %>
1010
</div>
1111
<% } else { %>
1212
<div class='inner'>

app/view/sign/signin.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</ul>
1010
</div>
1111
<div class='inner'>
12-
<% if(typeof(error) !== 'undefined' && error){ %>
12+
<% if(typeof error !== 'undefined' && error){ %>
1313
<div class="alert alert-error">
1414
<a class="close" data-dismiss="alert" href="#">&times;</a>
1515
<strong><%= error %></strong>

0 commit comments

Comments
 (0)