Elysia Tools

Browse tools, examples, visual explainers, and topic guides from one clear workspace.

Top Categories

Hubs

Language
ZHDERUPTENFRES

Elysia Tools

Navigation

Data Processing

Defaults Deep

· Last updated:2026-01-29

Apply deep default values using lodash _.defaultsDeep

Details

What this tool helps you do

Assign default values recursively for undefined properties.

Highlights:

  • Uses lodash _.defaultsDeep
  • Applies defaults deeply to nested objects
  • Only fills in undefined properties

Example:

  • Target: {"a":{"b":1}}
  • Source 1: {"a":{"b":2,"c":3}}
  • Result: {"a":{"b":1,"c":3}}

Execution

Run this tool

Fill in the form, run the tool, and review the result in one place.

Samples

Examples that match this tool

Related

Continue with connected tools and hubs

Written by the Elysia Tools team
Data Processing130
Lodash53

Tool usage guide

Learn when to use this tool, what it supports, and how real users apply it.

Key facts

Category
Data Processing
Input types
textarea
Output type
text
Sample coverage
4
API ready
Yes

Overview

Defaults Deep allows you to recursively merge default values into your JSON objects using the lodash _.defaultsDeep method, ensuring your data structures are complete without overwriting existing defined properties.

When to use

  • When you need to populate missing configuration settings in a nested JSON object.
  • When merging user-provided input with a set of required system defaults.
  • When you want to ensure specific keys exist in a data structure while preserving current values.

How it works

  1. 1Input your primary target object containing your current data.
  2. 2Provide one or more source objects containing the default values you wish to apply.
  3. 3The tool recursively traverses the objects, assigning values from the sources only where the target property is undefined.
  4. 4Receive the merged JSON object with all missing nested properties filled in.

Use cases

  • Standardizing API request payloads by injecting missing default parameters.
  • Merging user-defined application settings with factory-default configurations.
  • Preparing complex data structures for database insertion by ensuring all required fields are present.

Examples

1. Merging Application Settings

Frontend Developer

Background

An application has a user-defined theme object that might be missing certain nested color or spacing properties.

Problem

The UI breaks when expected nested properties are missing from the user's saved configuration.

How to use

Paste the user's partial configuration into the Target Object field and the full theme schema into Source 1.

Target: {"theme": {"primary": "blue"}} | Source 1: {"theme": {"primary": "red", "spacing": "10px"}}

Outcome

The result is {"theme": {"primary": "blue", "spacing": "10px"}}, preserving the user's primary color while adding the missing spacing.

2. API Payload Normalization

Backend Engineer

Background

Incoming requests from a client are missing several optional fields that the backend service requires to function correctly.

Problem

The service logic fails because it expects a complete object structure.

How to use

Use the incoming request as the Target Object and a template of default values as Source 1.

FAQ

Does this tool overwrite existing values?

No, it only assigns values to properties that are currently undefined in the target object.

Can it handle deeply nested objects?

Yes, the tool uses lodash _.defaultsDeep, which performs a recursive merge across all levels of the object hierarchy.

What happens if a property is null?

Since null is a defined value, the tool will not overwrite it with the default value.

How many source objects can I provide?

You can provide up to three source objects to merge into your target object.

Is the output valid JSON?

Yes, the tool returns a clean, valid JSON string representing the merged object.

Home
Tools3212
Samples593
Visualizations471
Viewers103
Hubs239
Tags333
Images, Audio & Video657

Image, audio, and video processing, conversion, and optimization tools

Math, Date & Finance647

Calculators, numerics, date logic, statistics, and finance tools

Design & Color298

Color, layout, graphics, visual styling, and design helper tools

Text & Writing209

Writing, cleanup, formatting, extraction, and text analysis tools

Developer & Web193

Developer utilities, networking, web debugging, and automation helpers

Conversion & Encoding175

Format, file, archive, unit, and encoding conversion tools

Lead Generation Quiz Launch and Contact Handoff
Memorial Drafts: Family Review and Print Handoff
Private Habit Records: Backup, Restore and Sharing Review
Article to X and LinkedIn Drafts: Fact Review and Handoff
Markdown Interactive Deck Review and Offline Handoff

© 2026 Elysia Tools. All rights reserved.

DocsPricingAboutTerms of ServicePrivacy PolicyCookiesContact
Monitoring

Grafana Advanced Application Samples

Comprehensive Grafana samples covering advanced dashboard design, alerting configurations, data source integrations, and plugin development

Media

QR Code Samples

Sample QR code images for testing QR code reading and generation tools

Data Visualization

D3.js Data Visualization Samples

Comprehensive D3.js data visualization examples including charts, maps, animations, and interactive visualizations

Developer Tools

Rome JavaScript Toolchain Samples

Rome JavaScript toolchain examples including configuration, linting, formatting, bundling, and project management

Data Processing

Assign In Object

Assign own and inherited properties using lodash _.assignIn

Data Processing

Flatten Deep Array

Flatten array completely using lodash _.flattenDeep

Data Processing

For In Object

Iterate over object properties using lodash _.forIn

Data Processing

For Own

Iterate over own object properties using lodash _.forOwn

Target: {"settings": {"notifications": true}} | Source 1: {"settings": {"notifications": false, "theme": "dark"}}

Outcome

The result is {"settings": {"notifications": true, "theme": "dark"}}, ensuring the 'theme' key is present without changing the user's 'notifications' preference.