All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.helpers.isMatchRecord.js Maven / Gradle / Ivy

There is a newer version: 1.22.3
Show newest version
'use strict';

var has = require('has');

// https://262.ecma-international.org/13.0/#sec-match-records

module.exports = function isMatchRecord(record) {
	return (
		has(record, '[[StartIndex]]')
        && has(record, '[[EndIndex]]')
        && record['[[StartIndex]]'] >= 0
        && record['[[EndIndex]]'] >= record['[[StartIndex]]']
        && String(parseInt(record['[[StartIndex]]'], 10)) === String(record['[[StartIndex]]'])
        && String(parseInt(record['[[EndIndex]]'], 10)) === String(record['[[EndIndex]]'])
	);
};




© 2015 - 2025 Weber Informatics LLC | Privacy Policy