Skip to content

Main content

Package Export Condition Priority Tool

Select the first active conditional-export key in explicit insertion order; no filesystem resolution.

Loading tool…

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

  1. Enter conditionKeys, activeConditions. Keep parallel arrays aligned. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. 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 fieldMeaning and unitsAccepted input
conditionKeysCondition KeysRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
activeConditionsActive ConditionsRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
Output fieldInterpretationReturned shape
matchedWhether a default or active key was encountered; no actual package export target is resolved.Required. Boolean.
selectedKeySelected KeyRequired. Text; maximum UTF-16 length 8192.
indexFirst matching supplied condition key, or -1 if none; ordering follows conditionKeys.Required. Safe integer.
json
{
  "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

  1. Calculation and input contract: development/package-export-condition-priority — tool.io

Similar or alternative tools