Skip to content

[Replacement]: fn-name #1033

Closed
Closed

Description

@outslept

Package to replace

fn-name

Suggested replacement(s)

export default f => { if (typeof f != 'function') throw new TypeError('Expected a function'); return f.displayName || f.name };

// this should never be used in modern codebases. maybe deleting this altogether is a better option

Manifest type

micro-utility (tiny utility replaceable with native code or removal)

Rationale

simple util

Availability

No response

Code example (optional)

Activity

  1. gameroman commented on Aug 27, 2026

    @gameroman
    Contributor

    I think this should just be a native replacement to Function.prototype.name

  2. dreyfus92 commented on Aug 28, 2026

    @dreyfus92
    Member

    yeah, @gameroman's right. Function.prototype.name is already a replacement id in native.json with function.prototype.name and functions have names mapped to it, so fn-name should just be a third mapping there rather than a micro-utility snippet.

  3. added
    accepted
    on Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions