@cqse/commons 1.0.0-beta.2 → 1.0.0-beta.5

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.
@@ -5,7 +5,7 @@
5
5
  * This is helpful for writing prototypes and not yet handling all possible cases.
6
6
  */
7
7
  export declare class ImplementMeException extends Error {
8
- private readonly _implementMeFor;
8
+ private readonly _implementMeFor?;
9
9
  constructor(implementMeFor?: string);
10
10
  get message(): string;
11
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Exceptions.d.ts","sourceRoot":"","sources":["../src/Exceptions.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;IAC9C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAmB;gBAEvC,cAAc,CAAC,EAAE,MAAM;IAKnC,IAAI,OAAO,IAAI,MAAM,CAMpB;CACD;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;CAAG;AAEnD;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;CAAG;AAEtD;;GAEG;AACH,qBAAa,6BAA8B,SAAQ,KAAK;CAAG"}
1
+ {"version":3,"file":"Exceptions.d.ts","sourceRoot":"","sources":["../src/Exceptions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;IAC9C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAS;gBAE9B,cAAc,CAAC,EAAE,MAAM;IAKnC,IAAI,OAAO,IAAI,MAAM,CAMpB;CACD;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;CAAG;AAEnD;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;CAAG;AAEtD;;GAEG;AACH,qBAAa,6BAA8B,SAAQ,KAAK;CAAG"}
package/lib/Exceptions.js CHANGED
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InvalidConfigurationException = exports.IllegalArgumentException = exports.IllegalStateException = exports.ImplementMeException = void 0;
4
- const typescript_optional_1 = require("typescript-optional");
5
4
  /**
6
5
  * Excepting signaling that there is functionality that is supposed
7
6
  * to be implemented in case the exception is thrown.
@@ -11,11 +10,11 @@ const typescript_optional_1 = require("typescript-optional");
11
10
  class ImplementMeException extends Error {
12
11
  constructor(implementMeFor) {
13
12
  super('Implement me!');
14
- this._implementMeFor = typescript_optional_1.Optional.ofNullable(implementMeFor);
13
+ this._implementMeFor = implementMeFor;
15
14
  }
16
15
  get message() {
17
- if (this._implementMeFor.isPresent()) {
18
- return `Implement me for: ${this._implementMeFor.get()}`;
16
+ if (this._implementMeFor) {
17
+ return `Implement me for: ${this._implementMeFor}`;
19
18
  }
20
19
  else {
21
20
  return 'Implement me!';
@@ -1 +1 @@
1
- {"version":3,"file":"Exceptions.js","sourceRoot":"","sources":["../src/Exceptions.ts"],"names":[],"mappings":";;;AAAA,6DAA+C;AAE/C;;;;;GAKG;AACH,MAAa,oBAAqB,SAAQ,KAAK;IAG9C,YAAY,cAAuB;QAClC,KAAK,CAAC,eAAe,CAAC,CAAC;QACvB,IAAI,CAAC,eAAe,GAAG,8BAAQ,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;IAC5D,CAAC;IAED,IAAI,OAAO;QACV,IAAI,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,EAAE,CAAC;YACtC,OAAO,qBAAqB,IAAI,CAAC,eAAe,CAAC,GAAG,EAAE,EAAE,CAAC;QAC1D,CAAC;aAAM,CAAC;YACP,OAAO,eAAe,CAAC;QACxB,CAAC;IACF,CAAC;CACD;AAfD,oDAeC;AAED;;GAEG;AACH,MAAa,qBAAsB,SAAQ,KAAK;CAAG;AAAnD,sDAAmD;AAEnD;;GAEG;AACH,MAAa,wBAAyB,SAAQ,KAAK;CAAG;AAAtD,4DAAsD;AAEtD;;GAEG;AACH,MAAa,6BAA8B,SAAQ,KAAK;CAAG;AAA3D,sEAA2D"}
1
+ {"version":3,"file":"Exceptions.js","sourceRoot":"","sources":["../src/Exceptions.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,MAAa,oBAAqB,SAAQ,KAAK;IAG9C,YAAY,cAAuB;QAClC,KAAK,CAAC,eAAe,CAAC,CAAC;QACvB,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;IACvC,CAAC;IAED,IAAI,OAAO;QACV,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YAC1B,OAAO,qBAAqB,IAAI,CAAC,eAAe,EAAE,CAAC;QACpD,CAAC;aAAM,CAAC;YACP,OAAO,eAAe,CAAC;QACxB,CAAC;IACF,CAAC;CACD;AAfD,oDAeC;AAED;;GAEG;AACH,MAAa,qBAAsB,SAAQ,KAAK;CAAG;AAAnD,sDAAmD;AAEnD;;GAEG;AACH,MAAa,wBAAyB,SAAQ,KAAK;CAAG;AAAtD,4DAAsD;AAEtD;;GAEG;AACH,MAAa,6BAA8B,SAAQ,KAAK;CAAG;AAA3D,sEAA2D"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Checks if the given string describes a commit in a valid fashion.
3
+ */
4
+ export declare function isValidCommitInfo(commit?: unknown): boolean;
5
+ //# sourceMappingURL=Validation.d.ts.map
@@ -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
@@ -5,4 +5,5 @@ export * from './Strings';
5
5
  export * from './ConfigParser';
6
6
  export * from './ConfigWithOverwrites';
7
7
  export * from './CollectorConfig';
8
+ export * from './Validation';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cqse/commons",
3
- "version": "1.0.0-beta.2",
3
+ "version": "1.0.0-beta.5",
4
4
  "description": "A collection of generic functionality for TypeScript projects.",
5
5
  "author": "CQSE GmbH",
6
6
  "main": "lib/index.js",
@@ -10,21 +10,6 @@
10
10
  "dist/**/*",
11
11
  "lib/**/*"
12
12
  ],
13
- "dependencies": {
14
- "typescript-optional": "^2.0.1"
15
- },
16
- "devDependencies": {
17
- "@babel/core": "^7.26.8",
18
- "@babel/preset-env": "^7.26.8",
19
- "@types/jest": "^29.5.14",
20
- "@types/node": "^22.13.4",
21
- "babel-jest": "^29.7.0",
22
- "jest": "^29.7.0",
23
- "rimraf": "^6.0.1",
24
- "ts-jest": "^29.2.5",
25
- "ts-node": "^10.9.2",
26
- "typescript": "^5.7.3"
27
- },
28
13
  "publishConfig": {
29
14
  "access": "public"
30
15
  },