Sha256: 44727b6097cbe0570c6c45bbc301c0ea7e6fc4c298722715b55badb7234b2c0f

Contents?: true

Size: 1.08 KB

Versions: 3

Compression:

Stored size: 1.08 KB

Contents

/*!
 * UI development toolkit for HTML5 (OpenUI5)
 * (c) Copyright 2009-2018 SAP SE or an SAP affiliate company.
 * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
 */
sap.ui.define(function() {
	"use strict";

	/**
	 * Returns values from an object
	 *
	 * @function
	 * @since 1.58
	 * @alias module:sap/base/util/values
	 * @param {object} mObject - Object to be extracted
	 * @returns {Array.<*>} - array of object values, if object does not contain values, an empty array will be returned
	 * @public
	 */
	return function values(mObject) {
		// Default is always an empty array
		if (
			typeof mObject === "undefined"
			|| mObject === null
			|| mObject !== mObject // eslint-disable-line no-self-compare
		) {
			return [];
		}

		// Object.values is not supported in IE
		if (typeof Object.values === 'function') {
			return Object.values(mObject);
		}

		if (typeof mObject === 'string') {
			return mObject.split('');
		}

		if (typeof mObject !== 'object') {
			return [];
		}

		return Object.keys(mObject).map(function (vValue) {
			return mObject[vValue];
		});
	};
});

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fiveapples-0.0.7 lib/openui5-runtime-1.60.23/resources/sap/base/util/values-dbg.js
fiveapples-0.0.6 lib/openui5-runtime-1.60.23/resources/sap/base/util/values-dbg.js
fiveapples-0.0.5 lib/openui5-runtime-1.60.23/resources/sap/base/util/values-dbg.js