@utiliread/primitives 1.0.0-124 → 1.0.0-125

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -23,11 +23,17 @@ function $parcel$export(e, n, v, s) {
23
23
  }
24
24
  // This is clearly not correct but it provides some amazing type safety
25
25
  function $f5b26f75dc394ede$export$b340a19a1bcc0afd(repoOrTeam, name) {
26
- if (name) return `${repoOrTeam}/${name}`;
27
- else if (repoOrTeam.indexOf("/") > 0) return repoOrTeam;
28
- else throw new TypeError("Invalid repository format");
26
+ const repo = name ? `${repoOrTeam}/${name}` : repoOrTeam;
27
+ if (!$f5b26f75dc394ede$export$b340a19a1bcc0afd.isRepository(repo)) throw new TypeError("Invalid repository format");
28
+ return repo;
29
29
  }
30
+ const $f5b26f75dc394ede$var$PART_REGEX = new RegExp(/[a-z][a-z0-9-]*/);
30
31
  (function(Repository) {
32
+ function isRepository(input) {
33
+ const parts = input.split("/");
34
+ return parts.length === 2 && !parts.some((x)=>!$f5b26f75dc394ede$var$PART_REGEX.test(x));
35
+ }
36
+ Repository.isRepository = isRepository;
31
37
  function split(repo) {
32
38
  const parts = repo.split("/");
33
39
  return {