nsid 0.3.0 copy "nsid: ^0.3.0" to clipboard
nsid: ^0.3.0 copied to clipboard

Core library for parsing NSIDs 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:nsid/nsid.dart';

void main(List<String> args) {
  final id1 = NSID.parse('com.example.foo');
  id1.authority; // => 'example.com'
  id1.name; // => 'foo'
  id1.toString(); // => 'com.example.foo'

  final id2 = NSID.create('example.com', 'foo');
  id2.authority; // => 'example.com'
  id2.name; // => 'foo'
  id2.toString(); // => 'com.example.foo'

  final id3 = NSID.create('example.com', '*');
  id3.authority; // => 'example.com'
  id3.name; // => '*'
  id3.toString(); // => 'com.example.*'

  NSID.isValid('com.example.foo'); // => true
  NSID.isValid('com.example.*'); // => true
  NSID.isValid('example.com/foo'); // => false
  NSID.isValid('foo'); // => false
}
1
likes
0
pub points
19%
popularity

Publisher

verified publisheratprotodart.com

Core library for parsing NSIDs in the AT Protocol standard.

Homepage
Repository (GitHub)
View/report issues

Topics

#atproto #bluesky #nsid

Funding

Consider supporting this project:

github.com

License

unknown (license)

More

Packages that depend on nsid