mirror of
https://github.com/github/codeql-action.git
synced 2025-12-27 09:40:17 +08:00
16 lines
303 B
JavaScript
16 lines
303 B
JavaScript
'use strict'
|
|
|
|
const isLength = require('lodash/isLength')
|
|
|
|
const hop = Object.prototype.hasOwnProperty
|
|
|
|
function hasLength (obj) {
|
|
return (
|
|
Array.isArray(obj) ||
|
|
(hop.call(obj, 'length') &&
|
|
isLength(obj.length) &&
|
|
(obj.length === 0 || '0' in obj))
|
|
)
|
|
}
|
|
module.exports = hasLength
|