Crates.io | polyvalid |
lib.rs | polyvalid |
version | 0.1.7 |
source | src |
created_at | 2023-03-25 16:30:24.093466 |
updated_at | 2023-04-04 12:09:26.916094 |
description | A validator for package names, namespace, username and app name on wasmer |
homepage | |
repository | https://github.com/ayys/polyvalid |
max_upload_size | |
id | 820373 |
size | 143,750 |
polyvalid
is a Rust library for validating package names, usernames, namespace names, and app names. The library provides a single source of truth for validating the names with the following rules:
_
or -
Additionally, the library checks if the name contains --
since it can break URL rules.
The library can be used from Python and JS through the provided bindings.
The library can be used from rust, python or javascript. The following describes how to use it from all three languages.
cargo add polyvalid
use polyvalid;
let name: String = "polyvalid";
assert!(polyvalid::is_app_name_valid(name));
pip add polyvalid
import polyvalid
name = "polyvalid"
polyvalid.is_app_name_valid(name) # returns True
npm i polyvalid
import "polyvalid";
name = "polyvalid";
polyvalid.is_valid_name(name); // returns true
Contributions are welcome! If you'd like to contribute to polyvalid
, please follow these steps:
polyvalid
repo.