mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-05-25 07:04:45 +00:00
.
This commit is contained in:
parent
a004f0ae58
commit
fc725ba36b
7280 changed files with 19 additions and 1796407 deletions
55
node_modules/is-data-descriptor/index.js
generated
vendored
55
node_modules/is-data-descriptor/index.js
generated
vendored
|
@ -1,55 +0,0 @@
|
|||
/*!
|
||||
* is-data-descriptor <https://github.com/jonschlinkert/is-data-descriptor>
|
||||
*
|
||||
* Copyright (c) 2015, Jon Schlinkert.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var typeOf = require('kind-of');
|
||||
|
||||
// data descriptor properties
|
||||
var data = {
|
||||
configurable: 'boolean',
|
||||
enumerable: 'boolean',
|
||||
writable: 'boolean'
|
||||
};
|
||||
|
||||
function isDataDescriptor(obj, prop) {
|
||||
if (typeOf(obj) !== 'object') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (typeof prop === 'string') {
|
||||
var val = Object.getOwnPropertyDescriptor(obj, prop);
|
||||
return typeof val !== 'undefined';
|
||||
}
|
||||
|
||||
if (!('value' in obj) && !('writable' in obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (var key in obj) {
|
||||
if (key === 'value') continue;
|
||||
|
||||
if (!data.hasOwnProperty(key)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (typeOf(obj[key]) === data[key]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (typeof obj[key] !== 'undefined') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Expose `isDataDescriptor`
|
||||
*/
|
||||
|
||||
module.exports = isDataDescriptor;
|
Loading…
Add table
Add a link
Reference in a new issue