@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.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -3
- package/dist/index.mjs.map +1 -1
- package/dist/types/medium.d.ts +3 -0
- package/dist/types/medium.spec.d.ts +1 -0
- package/dist/types/repository.d.ts +1 -0
- package/package.json +1 -1
- package/src/medium.spec.ts +12 -0
- package/src/medium.ts +19 -0
- package/src/repository.spec.ts +9 -0
- package/src/repository.ts +10 -5
- package/asdasd/index.js +0 -2
- package/asdasd/index.js.map +0 -1
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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 {
|