stepsObjectToArray

Turn an object with steps as properties to an array

@param stepsObject
@returns {{code: string}[]}
502301
function stepsObjectToArray (stepsObject) {
  return Object.keys(stepsObject).map(stepCode => {
    return {
      ...stepsObject[stepCode],
      code: stepCode,
      label: getText('steps', `${stepCode}Label`),
      labelPending: getText('steps', `${stepCode}LabelPending`)
    };
  });
}
1137034
@SuppressWarnings("unchecked")
	public Object[] toArray(Object[] array)
	{
		synchronized (children)
		{
			return children.keySet().toArray(array);
		}
	}
769689
public static Object[] sub(Object array, int start, int end, int step) {
		int length = length(array);
		if (start < 0) {
			start += length;
		}
		if (end < 0) {
			end += length;
		}
		if (start == length) {
			return new Object[0];
		}
		if (start > end) {
			int tmp = start;
			start = end;
			end = tmp;
		}
		if (end > length) {
			if (start >= length) {
				return new Object[0];
			}
			end = length;
		}

		if (step <= 1) {
			step = 1;
		}

		final ArrayList<Object> list = new ArrayList<>();
		for (int i = start; i < end; i += step) {
			list.add(get(array, i));
		}

		return list.toArray();
	}
633265
public Object[] getObjectIds(Object object) {
        DimIProxy action = new DimIProxy(this, IPROXY_OBJECT_IDS);
        action.object = object;
        action.withContext();
        return action.objectArrayResult;
    }
836864
function toArray(obj) {
  var a, arr = [];
  for (a in obj) {
    arr.push(obj[a]);
  }
  return arr;
}
92349
public static Object[] toArray(Object obj, int objType) {
        Object[] values;
        switch (objType) {
            case ZealotConst.OBJTYPE_ARRAY:
                values = (Object[]) obj;
                break;
            case ZealotConst.OBJTYPE_COLLECTION:
                values = ((Collection<?>) obj).toArray();
                break;
            default:
                values = new Object[]{obj};
        }
        return values;
    }
174920
function toArray(item) {
	if (!(item instanceof Array)) {
		var newitem = [];
		if (item) {
			newitem.push(item);
		}
		return newitem;
	}
	else {
		return item;
	}
}
273648
function toArray(obj) {
    var key, val, arr = [];
    for (key in obj) {
        val = obj[key];
        if (Array.isArray(val))
            for (var i = 0; i < val.length; i++)
        arr.push([ key, val[i] ]);
        else
            arr.push([ key, val ]);
    }
    return arr;
}
63117
public function toArray($object)
    {
        $result = array();
        $className = $this->getFullClassName($object);
        $metadata = $this->metadataFactory->getMetadataForClass($className);
        foreach ($metadata->getProperties() as $property) {
            if (!$property->isExpose() || $this->propertySkipper->shouldSkip($property)) {
                continue;
            }

            $value = $this->exposeValue($object, $property);
            $value = $this->handleValue($value, $property, self::DIRECTION_SERIALIZE);

            if ($property->isNullSkipped() && $value === null) {
                continue;
            }

            $result[$property->getSerializedName()] = $value;
        }

        return $result;
    }
675479
function toArray(self) {
    if (self instanceof Array) {
        return self;
    } else if (typeof self.toArray === "function") {
        return self.toArray();
    } else if (self.elements) {
        if (self.elements instanceof Array) {
            return self.elements;
        } else if (typeof self.elements === "function") {
            return self.elements();
        }
    } else if (self.items) {
        if (self.items instanceof Array) {
            return self.items;
        } else if (typeof self.items === "function") {
            return self.items();
        }
    }
    throw new Error("(sortedArray) Could not transform instance to array. It should provide either .toArray(), .elements or .items");
}
880105
function toArray(path: NodePath): Array<string> {
  const parts = [path];
  let result = [];

  while (parts.length > 0) {
    path = parts.shift();
    const node = path.node;
    if (t.CallExpression.check(node)) {
      parts.push(path.get('callee'));
      continue;
    } else if (t.MemberExpression.check(node)) {
      parts.push(path.get('object'));
      if (node.computed) {
        const resolvedPath = resolveToValue(path.get('property'));
        if (resolvedPath !== undefined) {
          result = result.concat(toArray(resolvedPath));
        } else {
          result.push('<computed>');
        }
      } else {
        result.push(node.property.name);
      }
      continue;
    } else if (t.Identifier.check(node)) {
      result.push(node.name);
      continue;
    } else if (t.Literal.check(node)) {
      result.push(node.raw);
      continue;
    } else if (t.ThisExpression.check(node)) {
      result.push('this');
      continue;
    } else if (t.ObjectExpression.check(node)) {
      const properties = path.get('properties').map(function(property) {
        return (
          toString(property.get('key')) + ': ' + toString(property.get('value'))
        );
      });
      result.push('{' + properties.join(', ') + '}');
      continue;
    } else if (t.ArrayExpression.check(node)) {
      result.push(
        '[' +
          path
            .get('elements')
            .map(toString)
            .join(', ') +
          ']',
      );
      continue;
    }
  }

  return result.reverse();
}
798274
@Override
    public final Object[] toArray() {
        this.readLock.lock();
        try {
            return this.toArray(new Object[this.size]);
        } finally {
            this.readLock.unlock();
        }
    }
1152479
function keys(obj) {
    var keyArray = [];
    var key;

    for (key in obj) {
        if (obj.hasOwnProperty(key)) {
            keyArray.push(key);
        }
    }

    return keyArray;
}
693882
function(obj) {
        var arr = [];
        for (var prop in obj) {
            if (obj.hasOwnProperty(prop)) {
                arr.push(prop);
            }
        }
        return arr;
    }
396964
function toArray(object){
		if (!object) return [];
		if (object.charAt) return [object];
		return grunt.util.toArray(object);
	}
610343
private static Object[] convertToObjectArray(Object obj) {
        if (obj instanceof Object[]) {
            return (Object[]) obj;
        }
        int arrayLength = Array.getLength(obj);
        Object[] retArray = new Object[arrayLength];
        for (int i = 0; i < arrayLength; ++i){
            retArray[i] = Array.get(obj, i);
        }
        return retArray;
    }
669411
function (object) {
            var result = [],
                key;
            for (key in object) {
                if (object.hasOwnProperty(key)) {
                    result.push(key);
                }
            }
            return result;
        }