GitShow/sindresorhus/is-identifier
sindresorhus

is-identifier

Check if a string is a valid JavaScript identifier

by sindresorhus
Star on GitHubForknpm

JavaScript

29 stars2 forks1 contributorActive · 16h agoSince 2024v1.1.0MIT

Meet the team

See all 1 on GitHub →
sindresorhus
sindresorhus6 contributions

Languages

View on GitHub →
JavaScript100%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
71
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template

Recent fixes

View closed PRs →
selrond
`isIdentifier` acts as a type guard when it shouldn’tClosedIssue

Here https://github.com/sindresorhus/is-identifier/blob/f1222ac0a28b04d91d0e83bd25a08c8bbde0968d/index.d.ts#L18C1-L18C7 there’s a type predicate, where the value is narrowed to be a string when returns . Consider the following example: The thus acts as a type guard when it shouldn’t. Here’s a TS playground: https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBMAzgSQCYFMB2NgDNjpRy5QQhwDkSAtMBtngVBQFCiSxwDeCiAouBgBPOAF9ipchQA2EVAENEAC1Yt0ADw7wAxhEyIdeg1ACu2mAClEegAryYSuAF44ACkToA5iCwxEALjgAQSgoeSEAHmNgTE8APgBKZzjuFjgEXDckATBhdy8fbEQEpK409LgodBgTKExKVnTRcqqaurgPb19EADoq1DN0V1cweyUAGjhtWqrsAGUC3ySnFLKKjLdp0N8FruxnJxcKClLy9dba+tGHM7FbvCyUehx8Qlct2ZhdwpgS1PX0hd2tdHAB+OAAAwAJFwQaIejCPjtFthRBC4IEkfMUTBbukAPT4gHEkkAgB6oNuzXWhI6MCgMU8cAA7sAHB1Rtp0Ig4NA4PJ6jEYF5CMQ+TEDAKubw4JgIPB5HAAG7yaR0BDPRiESYAIxM8AMwGk0n5dIZsR6t10+gNOOckIA2gAiREzZF7BU86KxUROgC6ENutNJIbgFNuQKuYzg4OhsLGohhnR+aIxHRx5VEk2OCRYzSAA

selrond · 1y ago
Structured data for AI agents

Repository: sindresorhus/is-identifier. Description: Check if a string is a valid JavaScript identifier Stars: 29, Forks: 2. Primary language: JavaScript. Languages: JavaScript (100%). License: MIT. Latest release: v1.1.0 (16h ago). Open PRs: 0, open issues: 0. Last activity: 16h ago. Community health: 71%. Top contributors: sindresorhus.

·@ofershap

Replace github.com with gitshow.dev