Last 12 weeks · 0 commits
4 of 6 standards met
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
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.0.1 (1y ago). Open PRs: 0, open issues: 0. Last activity: 1y ago. Community health: 71%. Top contributors: sindresorhus.