New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@burnsred/defaults

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@burnsred/defaults

> **⚠️ DEPRECATED**: This package is deprecated and will no longer receive updates.

latest
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

Defaults

⚠️ DEPRECATED: This package is deprecated and will no longer receive updates.

Deprecation Notice

This package has been deprecated as of version 1.0.0 and is no longer maintained.

What this means:

  • No new features will be added
  • No bug fixes will be provided
  • Security vulnerabilities will not be patched

Recommended Action: Please migrate to alternative solutions as soon as possible.

Support

For questions about this deprecation, please open an issue in the main repository.

Last maintained version: 1.0.0 Deprecation date: February 2026

A system for providing project-wide defaults to libraries.

Setup

First, define your defaults object.

This will map lookup keys to any sort of value. It can be nested to help with specialised scoping.


export default {
    foo: FooComponent,

    routes: {
        foo: RoutedFoo,
        members: {
            foo: SpecialFooComponent,
        },
    },
}

In your code, use the hooks to access them:

  • Direct lookup
const foo = useDefault("foo"); // Will return `FooComponent`

The lookup key can contain dots, in which case it will drill down into objects.

const foo = useDefault("routes.foo");  // Will return `RoutedFoo`
  • Defaults Map

Will find the first matching (non-undefined) lookup for each key from its list of lookups.


const foo = useDefaultMap({
    foo: ["routes.members.foo", "routes.foo"],
})

This will first check for default["routes"]["members"]["foo"], and if that's undefined, try default["routes"]["foo"], finally resorting to default["foo"].

  • Fill defaults

Use the fallback defaults method to fill absent entries on an object.


const fullProps = useFillDefaults(props, defaultsMap);

Any keys from defaultsMap that are not present in props will be resolved as with useDefaultMap.

  • Scoped lookup

All of the above hooks acception an optional scope argument.

This can be useful to, for instance, provide a typed default proxy for lookups within a certain section of the defaults object:

function useDefaultWidget(key: string): Widget {
    return useDefault(key, 'widgets') as Widget;
}

FAQs

Package last updated on 23 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts