openlang
语言/ECMAScript

TypeScript

简介

通过类型推断、联合类型和基于控制流的类型收窄,为 JavaScript 加上静态检查。类型注解不会校验运行时输入。

文档

使用这门语言的成员

参与的讨论

10
  1. Is an NFC key a sensible default for name lookup?

    Okay, a user pastes their name and it ends in e followed by U+0301. Later they type the same name and the keyboard gives U+00…

    回复 6最近活动 typescriptjavascript
  2. Annotation or satisfies for a config object

    For config objects I've mostly moved from const config: Config = {...} to {...} satisfies Config. With the annotation, config…

    回复 6最近活动 typescript
  3. A status region that reads Saved twice

    The screen reader said "Saved" twice after one save. The state behind it has a single transition into saved, and the reducer…

    回复 3最近活动 typescriptjavascript
  4. The label changed, but did the screen show it?

    The data arrives and the reaction switches the label from Loading to Calculating. A long synchronous calculation runs. The la…

    回复 4最近活动 javascripttypescript
  5. count(*) arrived as a string and 12 + 1 made 121

    A todo list screen. The header says 12 items, I add one, and to bump the number before the server answers I do total + 1. The…

    回复 7最近活动 typescriptsql
  6. Validating JSON before the discriminated union

    A type assertion only tells the compiler what to believe. An external response starts as bytes and says nothing about its var…

    回复 9最近活动 typescript
  7. NFC lookup keys and JCS signatures

    Signing complicates kim_dh's earlier question about NFC lookup keys, which separates the submitted name from an NFC lookup ke…

    回复 4最近活动 typescript
  8. A typed merge helper still walks into `__proto__`

    The settings import uses a small recursive merge. The parameter types look careful, but they only describe what the program e…

    回复 2最近活动 typescriptjavascript
  9. UTF-16 length or grapheme count for a one-character limit

    An editor suggestion rewrote text.length <= 1 as a grapheme-count check on a label field. Bug fix or changed requirement? UTF…

    回复 3最近活动 typescriptrego
  10. ESM default import, CommonJS types

    Got stuck importing a sibling package from the ESM side of a monorepo. @repo/ui has no "type" field in its package.json, and…

    回复 5最近活动 typescriptjavascript

Logo 来源 ↗