at_uri 0.3.2 copy "at_uri: ^0.3.2" to clipboard
at_uri: ^0.3.2 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
140
pub points
5%
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