Description
Select the first matching export-condition key.
Package and container references combine names, selectors, conditions and platform metadata. A restricted lexical split can preserve these parts without validating registry identity, available targets, dependency graphs or runtime resolution.
Select the first matching export-condition key.
When to use this tool
Use Package Export Condition Priority when checking the stated package, Cargo or container-reference component.
How to use the tool and how it works
- Enter conditionKeys, activeConditions. Keep parallel arrays aligned. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read matched, selectedKey, index. Inspect matched before interpreting the associated values.
Select the first matching export-condition key. Require unique conditionKeys; scan input order for default or membership in activeConditions, returning matched/key/index or empty key and -1.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| conditionKeys | Condition Keys | Required. Array of text; maximum UTF-16 length 8192; maximum items 256. |
| activeConditions | Active Conditions | Required. Array of text; maximum UTF-16 length 8192; maximum items 256. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| matched | Whether a default or active key was encountered; no actual package export target is resolved. | Required. Boolean. |
| selectedKey | Selected Key | Required. Text; maximum UTF-16 length 8192. |
| index | First matching supplied condition key, or -1 if none; ordering follows conditionKeys. | Required. Safe integer. |
{
"input": {
"conditionKeys": [
"import",
"node",
"default"
],
"activeConditions": [
"node",
"import"
]
},
"output": {
"matched": true,
"selectedKey": "import",
"index": 0
}
} Limitations and assumptions
- The tool does not resolve targets, nested conditions or actual runtime module exports.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
Alternative or Complementary methods
Use the relevant package manager, runtime or registry against the actual project for complete resolution and validation.
References
Similar or alternative tools
- Package JSON Export Condition Key
Inspect one package export-condition key under a restricted rule.
- npm Package Tag Selector Split
Split a package selector at its required name-selector boundary.