@cqse/commons 1.0.0-beta.2 → 1.0.0-beta.4
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/lib/Validation.d.ts +5 -0
- package/lib/Validation.d.ts.map +1 -0
- package/lib/Validation.js +25 -0
- package/lib/Validation.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Validation.d.ts","sourceRoot":"","sources":["../src/Validation.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,CAoB3D"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isValidCommitInfo = isValidCommitInfo;
|
|
4
|
+
/**
|
|
5
|
+
* Checks if the given string describes a commit in a valid fashion.
|
|
6
|
+
*/
|
|
7
|
+
function isValidCommitInfo(commit) {
|
|
8
|
+
if (typeof commit === 'string') {
|
|
9
|
+
if (/^[a-zA-Z0-9_-]+:([0-9]+|HEAD|head)$/.test(commit)) {
|
|
10
|
+
// Branch name with a timestamp
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
if (/^[0-9]+$/.test(commit)) {
|
|
14
|
+
// Timestamps must always be combined with a branch name;
|
|
15
|
+
// Git hashes consisting of only digits are very very unlikely.
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
if (/^[a-zA-Z0-9]{7,40}$/.test(commit)) {
|
|
19
|
+
// A Git commit hash
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=Validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Validation.js","sourceRoot":"","sources":["../src/Validation.ts"],"names":[],"mappings":";;AAGA,8CAoBC;AAvBD;;GAEG;AACH,SAAgB,iBAAiB,CAAC,MAAgB;IACjD,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAChC,IAAI,qCAAqC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YACxD,+BAA+B;YAC/B,OAAO,IAAI,CAAC;QACb,CAAC;QAED,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YAC7B,yDAAyD;YACzD,+DAA+D;YAC/D,OAAO,KAAK,CAAC;QACd,CAAC;QAED,IAAI,qBAAqB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YACxC,oBAAoB;YACpB,OAAO,IAAI,CAAA;QACZ,CAAC;IACF,CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC"}
|
package/lib/index.d.ts
CHANGED
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -21,4 +21,5 @@ __exportStar(require("./Strings"), exports);
|
|
|
21
21
|
__exportStar(require("./ConfigParser"), exports);
|
|
22
22
|
__exportStar(require("./ConfigWithOverwrites"), exports);
|
|
23
23
|
__exportStar(require("./CollectorConfig"), exports);
|
|
24
|
+
__exportStar(require("./Validation"), exports);
|
|
24
25
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA4C;AAC5C,6CAA2B;AAC3B,+CAA6B;AAC7B,4CAA0B;AAC1B,iDAA+B;AAC/B,yDAAuC;AACvC,oDAAkC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA4C;AAC5C,6CAA2B;AAC3B,+CAA6B;AAC7B,4CAA0B;AAC1B,iDAA+B;AAC/B,yDAAuC;AACvC,oDAAkC;AAClC,+CAA6B"}
|