PackageName
API reference › Foxy › Native › PackageName
Validates the package names the native manager reads from manifests, lock files, and registry metadata.
A valid name is at most 214 bytes long and is an optional @scope/ prefix followed by a name, where the scope and
the name each start with an ASCII letter or digit and continue with letters, digits, ., _, or -.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
isValid() static | Returns whether the name matches the grammar, which rules out empty parts, path separators outside the scope separator, leading dots, and absolute paths. | PackageName |
Method details
Section titled “Method details”isValid()
Section titled “isValid() ”public static function isValid(string $name): boolReturns whether the name matches the grammar, which rules out empty parts, path separators outside the scope separator, leading dots, and absolute paths.
Parameters
| Parameter | Type | Description |
|---|---|---|
$name | string |
Returns
bool