Welcome to the Kancolle Wiki!
If you have any questions regarding site content, account registration, etc., please visit the
KanColle Wiki Discord
Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
Module:Iterator
(view source)
Revision as of 00:10, 11 September 2022
36 bytes added
,
2 years ago
m
→Protect against nil sort for unknown ship class, etc.
Line 133:
Line 133:
if sortKey then
if sortKey then
table.sort(collection, function(a, b)
table.sort(collection, function(a, b)
−
if a[sortKey] ~= b[sortKey] then
+
if
a[sortKey] and b[sortKey] and
a[sortKey] ~= b[sortKey] then
return a[sortKey] < b[sortKey]
return a[sortKey] < b[sortKey]
elseif a._id == b._id then
elseif a._id == b._id then
return a._api_id < b._api_id
return a._api_id < b._api_id
−
else
+
else
return a._id < b._id
return a._id < b._id
end
end
Line 438:
Line 438:
end
end
−
testIterator('shipsByType', { type = '
18
', sort = '
_id
' , listBase = true})
+
testIterator('shipsByType', { type = '
11
', sort = '
_class
' , listBase = true})
testIterator('shipsBy', { pred = 'is_auxiliary' , sort = '_name'})
testIterator('shipsBy', { pred = 'is_auxiliary' , sort = '_name'})
Memetails
1,025
edits
Navigation menu
Personal tools
Log in
Request account
Namespaces
Module
Discussion
Variants
Views
Read
View source
View history
More
Search
Content Navigation
Kancolle Wiki
Random page
Recent changes
Batch Uploading
Current Mini-event
Pumpkin Festival
Sortie
Sortie
World 1 (Naval Base Waters)
World 2 (Nansei Island Waters)
World 3 (Northern Waters)
World 7 (South Western Waters)
World 4 (Western Waters)
World 5 (Southern Waters)
World 6 (Central Waters)
Events
Shortcuts
Expeditions
Quests
Ships Maximum Status
Equipment
Construction
Development
Akashi's Improvement Arsenal
Shop
Inventory
Combat Mechanics
Glossary
Drop List
Interviews
Tutorials
How to Register
How To Play
Leveling
Resource Farming
Ship Priority
Equipment Setup
Akashi Upgrades
Event Preparation
Troubleshooting
FAQ
Community
Help
Sandbox
Tools
Upload file
Special pages
Printable version