webhook-action/node_modules/es-abstract/2019/FromPropertyDescriptor.js

17 lines
536 B
JavaScript
Raw Normal View History

'use strict';
2024-03-28 02:00:41 +00:00
var $TypeError = require('es-errors/type');
2024-03-28 02:00:41 +00:00
var isPropertyDescriptor = require('../helpers/records/property-descriptor');
var fromPropertyDescriptor = require('../helpers/fromPropertyDescriptor');
2024-03-28 02:00:41 +00:00
// https://262.ecma-international.org/6.0/#sec-frompropertydescriptor
module.exports = function FromPropertyDescriptor(Desc) {
2024-03-28 02:00:41 +00:00
if (typeof Desc !== 'undefined' && !isPropertyDescriptor(Desc)) {
throw new $TypeError('Assertion failed: `Desc` must be a Property Descriptor');
}
2022-11-10 10:43:16 +00:00
return fromPropertyDescriptor(Desc);
};