at_uri 0.4.0 copy "at_uri: ^0.4.0" to clipboard
at_uri: ^0.4.0 copied to clipboard

Core library for parsing AT URI in the AT Protocol standard.

example/example.dart

// Copyright 2023 Shinya Kato. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided the conditions.

import 'package:at_uri/at_uri.dart';

void main(List<String> args) {
  final uri = AtUri.parse('at://bob.com/com.example.post/1234');

  uri.protocol; // => 'at:'
  uri.origin; // => 'at://bob.com'
  uri.hostname; // => 'bob.com'
  uri.collection; // => 'com.example.post'
  uri.rkey; // => '1234'

  ensureValidAtUri('at://user.bsky.social'); // => returns void
  ensureValidAtUri('at//did:plc:asdf123'); // => throws
}
1
likes
160
pub points
19%
popularity
screenshot

Publisher

verified publisheratprotodart.com

Core library for parsing AT URI in the AT Protocol standard.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#atproto #bluesky #uri #util

Documentation

API reference

Funding

Consider supporting this project:

github.com

License

BSD-3-Clause (license)

Dependencies

at_identifier, nsid

More

Packages that depend on at_uri