Skip to content

More specific JSON parse reviver argument in lib.d.ts #6955

Closed
@avonwyss

Description

@avonwyss

Currently, the JSON interface in lib.d.ts declares the following:

parse(text: string, reviver?: (key: any, value: any) => any): any;

However, my understanding is that the spec guaratees a string for the key (see http://www.ecma-international.org/ecma-262/5.1/#sec-15.12.2 paragraph "The abstract operation Walk ... String name ..."), in consequence it could be more specific:

parse(text: string, reviver?: (key: string, value: any) => any): any;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good First IssueWell scoped, documented and has the green lightHelp WantedYou can do thisSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions