+/**
+ * Returns the value of the provided own property on the provided
+ * value using the provided receiver, or undefined if the provided
+ * property is not an own property on the provided value.
+ *
+ * ※ If the receiver is not provided, it defaults to the provided
+ * value.
+ */
+export const getOwnPropertyValue = (O, P, Receiver = UNDEFINED) => {
+ const obj = toObject(O);
+ const desc = getOwnPropertyDescriptor(O, P);
+ if (desc === UNDEFINED) {
+ // The provided property is not an own property on the provided
+ // value; return undefined.
+ return UNDEFINED;
+ }
+ if (isDataDescriptor(desc)) {
+ // The provided property is a data property; return its value.
+ return desc.value;
+ } else {
+ // The provided property is an accessor property; get its value
+ // using the appropriate receiver.
+ const target = Receiver === UNDEFINED ? obj : toObject(Receiver);
+ return call(desc.get, target, []);
+ }
+};
+
+/**
+ * Returns an array of own property values on the provided value, using
+ * the provided receiver if given.
+ */
+export const getOwnPropertyValues = (O, Receiver = O) => {
+ const obj = toObject(O);
+ const keys = ownKeys(obj);
+ const target = Receiver === UNDEFINED ? obj : toObject(Receiver);
+ const result = createArray(keys.length);
+ for (let k = 0; k < keys.length; ++k) {
+ // Iterate over each key and collect the values.
+ defineOwnDataProperty(
+ result,
+ k,
+ getOwnPropertyValue(obj, keys[k], target),
+ );
+ }
+ return result;
+};
+