🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
12 lines
252 B
JavaScript
Executable File
12 lines
252 B
JavaScript
Executable File
'use strict';
|
|
|
|
module.exports = function min(key) {
|
|
if (key !== undefined) {
|
|
const filtered = this.items.filter(item => item[key] !== undefined);
|
|
|
|
return Math.min(...filtered.map(item => item[key]));
|
|
}
|
|
|
|
return Math.min(...this.items);
|
|
};
|