PromoCursed/node_modules/es-abstract/2019/CreateIterResultObject.js
2024-08-20 23:25:37 +04:00

16 lines
349 B
JavaScript

'use strict';
var $TypeError = require('es-errors/type');
// https://262.ecma-international.org/6.0/#sec-createiterresultobject
module.exports = function CreateIterResultObject(value, done) {
if (typeof done !== 'boolean') {
throw new $TypeError('Assertion failed: Type(done) is not Boolean');
}
return {
value: value,
done: done
};
};