From e2fcec8f21e0ee941922c590a6ad58a4e41f3fec Mon Sep 17 00:00:00 2001 From: Jan Martin Date: Mon, 30 Sep 2024 11:08:35 -0700 Subject: [PATCH] doc: spell out condition restrictions --- doc/api/packages.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/api/packages.md b/doc/api/packages.md index 09f32e6c160892..9de294d2d73545 100644 --- a/doc/api/packages.md +++ b/doc/api/packages.md @@ -689,6 +689,17 @@ exports, while resolving the existing `"node"`, `"node-addons"`, `"default"`, Any number of custom conditions can be set with repeat flags. +Conditions can be almost any string, including multi-byte characters and +whitespace. There's only a few restrictions: + +1. They must contain at least one character. +2. They cannot start with "." since they may appear in places that also + allow relative paths. +3. They cannot contain "," since they may be parsed as a comma-separated + list by some CLI tools. +4. They cannot be numeric property keys like "10" since that can have + unexpected effects on property ordering. + ### Community Conditions Definitions Condition strings other than the `"import"`, `"require"`, `"node"`,