Categories

Keys In List

List own and inherited keys using lodash _.keysIn

List own and inherited enumerable keys of an object.

Highlights:

  • Uses lodash _.keysIn
  • Includes inherited enumerable properties
  • Returns a JSON array of keys

Example:

  • Object: {"a":1,"b":2}
  • Result: ["a","b"]

Enter a JSON object

Key Facts

Category
Data Processing
Input Types
textarea
Output Type
text
Sample Coverage
4
API Ready
Yes

Overview

The Keys In List tool allows you to extract all enumerable property names from a JSON object, including both its own properties and those inherited through the prototype chain.

When to Use

  • When you need to inspect the full structure of an object including inherited properties.
  • When debugging JavaScript objects to verify which keys are accessible via the prototype chain.
  • When you need a clean JSON array of all available keys for further data processing.

How It Works

  • Paste your JSON object into the input field.
  • The tool processes the input using the lodash _.keysIn method.
  • It identifies all own and inherited enumerable keys.
  • The tool outputs a formatted JSON array containing all discovered keys.

Use Cases

Auditing object prototypes during development.
Generating dynamic form fields based on object property names.
Comparing property sets between different object instances.

Examples

1. Extracting Prototype Keys

Frontend Developer
Background
A developer is working with a custom class instance and needs to verify all accessible properties, including those inherited from a base class.
Problem
Standard object inspection only shows own properties, hiding inherited functionality.
How to Use
Paste the object representation into the input field to generate the full list of keys.
Example Config
{"name": "Device", "type": "Sensor"}
Outcome
Returns a JSON array: ["name", "type"] plus any additional keys inherited from the object's prototype.

Try with Samples

json

Related Hubs

FAQ

What is the difference between this and Object.keys?

Object.keys only returns an object's own enumerable properties, whereas this tool uses _.keysIn to include inherited enumerable properties as well.

Does this tool support nested objects?

The tool processes the top-level object provided in the input. Nested objects will be treated as values associated with their respective keys.

What happens if the input is not valid JSON?

The tool requires valid JSON input to function correctly; invalid syntax will result in an error.

Are non-enumerable properties included?

No, this tool only lists enumerable properties as per the behavior of lodash _.keysIn.

Is the output sorted?

The output is returned as a JSON array of strings representing the keys found in the object.

API Documentation

Request Endpoint

POST /en/api/tools/keys-in-list

Request Parameters

Parameter Name Type Required Description
objectInput textarea Yes Enter a JSON object

Response Format

{
  "result": "Processed text content",
  "error": "Error message (optional)",
  "message": "Notification message (optional)",
  "metadata": {
    "key": "value"
  }
}
Text: Text

AI MCP Documentation

Add this tool to your MCP server configuration:

{
  "mcpServers": {
    "elysiatools-keys-in-list": {
      "name": "keys-in-list",
      "description": "List own and inherited keys using lodash _.keysIn",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=keys-in-list",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

You can chain multiple tools, e.g.: `https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`, max 20 tools.

If you encounter any issues, please contact us at [email protected]