ruchy-syntax-tools
Version:
Comprehensive syntax highlighting and language support for the Ruchy programming language
10 lines (8 loc) • 368 B
JavaScript
import { MAX_ARRAY_INDEX } from './_setup.js';
// Common internal logic for `isArrayLike` and `isBufferLike`.
export default function createSizePropertyCheck(getSizeProperty) {
return function(collection) {
var sizeProperty = getSizeProperty(collection);
return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= MAX_ARRAY_INDEX;
}
}