PHP 8.2.30
Preview: implementation.js Size: 1.21 KB
//lib/node_modules/npm/node_modules/object.getownpropertydescriptors/implementation.js

'use strict';

var ES = require('es-abstract/es7');

var defineProperty = Object.defineProperty;
var getDescriptor = Object.getOwnPropertyDescriptor;
var getOwnNames = Object.getOwnPropertyNames;
var getSymbols = Object.getOwnPropertySymbols;
var concat = Function.call.bind(Array.prototype.concat);
var reduce = Function.call.bind(Array.prototype.reduce);
var getAll = getSymbols ? function (obj) {
	return concat(getOwnNames(obj), getSymbols(obj));
} : getOwnNames;

var isES5 = ES.IsCallable(getDescriptor) && ES.IsCallable(getOwnNames);

var safePut = function put(obj, prop, val) { // eslint-disable-line max-params
	if (defineProperty && prop in obj) {
		defineProperty(obj, prop, {
			configurable: true,
			enumerable: true,
			value: val,
			writable: true
		});
	} else {
		obj[prop] = val;
	}
};

module.exports = function getOwnPropertyDescriptors(value) {
	ES.RequireObjectCoercible(value);
	if (!isES5) {
		throw new TypeError('getOwnPropertyDescriptors requires Object.getOwnPropertyDescriptor');
	}

	var O = ES.ToObject(value);
	return reduce(getAll(O), function (acc, key) {
		var descriptor = getDescriptor(O, key);
		if (typeof descriptor !== 'undefined') {
			safePut(acc, key, descriptor);
		}
		return acc;
	}, {});
};

Directory Contents

Dirs: 0 × Files: 13

Name Size Perms Modified Actions
276 B lrw-r--r-- 2021-03-10 14:36:37
Edit Download
4.04 KB lrw-r--r-- 2021-03-10 14:36:37
Edit Download
587 B lrw-r--r-- 2021-03-10 14:36:37
Edit Download
1.91 KB lrw-r--r-- 2021-03-10 14:36:37
Edit Download
1.69 KB lrw-r--r-- 2021-03-10 14:36:37
Edit Download
1.21 KB lrw-r--r-- 2021-03-10 14:36:37
Edit Download
316 B lrw-r--r-- 2021-03-10 14:36:37
Edit Download
1.06 KB lrw-r--r-- 2021-03-10 14:36:37
Edit Download
3.74 KB lrw-r--r-- 2021-03-10 14:36:37
Edit Download
3.08 KB lrw-r--r-- 2021-03-10 14:36:37
Edit Download
227 B lrw-r--r-- 2021-03-10 14:36:37
Edit Download
3.63 KB lrw-r--r-- 2021-03-10 14:36:37
Edit Download
381 B lrw-r--r-- 2021-03-10 14:36:37
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).