@utiliread/primitives 1.0.0-126 → 1.0.0-128
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.js +27 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -4
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/repository.spec.ts +3 -2
- package/src/repository.ts +1 -4
package/dist/types/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export type { AggregateId } from "./aggregate-id";
|
|
|
10
10
|
export type { BreakdownPeriod } from "./breakdown-rule";
|
|
11
11
|
export { BreakdownRule } from "./breakdown-rule";
|
|
12
12
|
export type { MeasureId } from "./measure-id";
|
|
13
|
-
export
|
|
13
|
+
export { Medium } from "./medium";
|
|
14
14
|
export type { Optional } from "./optional";
|
|
15
15
|
export { PrecisionNumber } from "./precision-number";
|
|
16
16
|
export { RegisterConvention } from "./register-convention";
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -30,7 +30,7 @@ export type { AggregateId } from "./aggregate-id";
|
|
|
30
30
|
export type { BreakdownPeriod } from "./breakdown-rule";
|
|
31
31
|
export { BreakdownRule } from "./breakdown-rule";
|
|
32
32
|
export type { MeasureId } from "./measure-id";
|
|
33
|
-
export
|
|
33
|
+
export { Medium } from "./medium";
|
|
34
34
|
export type { Optional } from "./optional";
|
|
35
35
|
export { PrecisionNumber } from "./precision-number";
|
|
36
36
|
export { RegisterConvention } from "./register-convention";
|
package/src/repository.spec.ts
CHANGED
|
@@ -2,12 +2,13 @@ import { Repository } from "./repository";
|
|
|
2
2
|
import { expect } from "chai";
|
|
3
3
|
|
|
4
4
|
describe("ctor", () => {
|
|
5
|
-
it("creates", () => {
|
|
5
|
+
it.only("creates", () => {
|
|
6
6
|
expect(Repository("gpkv", "gjoel")).to.equal("gpkv/gjoel");
|
|
7
7
|
expect(Repository("gpkv/gjoel")).to.equal("gpkv/gjoel");
|
|
8
8
|
});
|
|
9
|
-
it("throws if wrong format", () => {
|
|
9
|
+
it.only("throws if wrong format", () => {
|
|
10
10
|
expect(() => Repository("invalid")).to.throw();
|
|
11
|
+
expect(() => Repository("[object%20Object]", "dashboard")).to.throw();
|
|
11
12
|
});
|
|
12
13
|
});
|
|
13
14
|
|
package/src/repository.ts
CHANGED
|
@@ -11,12 +11,9 @@ export function Repository(repoOrTeam: string, name?: string): Repository {
|
|
|
11
11
|
return repo;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
const PART_REGEX = new RegExp(/[a-z][a-z0-9-]*/);
|
|
15
|
-
|
|
16
14
|
export namespace Repository {
|
|
17
15
|
export function isRepository(input: string): input is Repository {
|
|
18
|
-
|
|
19
|
-
return parts.length === 2 && !parts.some((x) => !PART_REGEX.test(x));
|
|
16
|
+
return /^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(input);
|
|
20
17
|
}
|
|
21
18
|
|
|
22
19
|
export function split(repo: Repository) {
|