@squiz/db-lib 1.2.1-alpha.97 → 1.2.1-alpha.99
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +16 -0
- package/lib/index.d.ts +0 -7
- package/lib/index.js +0 -114
- package/lib/index.js.map +4 -4
- package/package.json +4 -5
- package/src/index.ts +0 -11
- package/tsconfig.tsbuildinfo +1 -1
- package/lib/assertions/assertAssign.d.ts +0 -4
- package/lib/assertions/assertAssign.spec.d.ts +0 -1
- package/lib/assertions/assertAssignWithDefaultUndefinedValue.d.ts +0 -4
- package/lib/assertions/assertAssignWithDefaultUndefinedValue.spec.d.ts +0 -1
- package/lib/assertions/assertIsDefined.d.ts +0 -1
- package/lib/assertions/assertIsDefined.spec.d.ts +0 -1
- package/lib/assertions/assertIsMapOfStringString.d.ts +0 -3
- package/lib/assertions/assertIsMapOfStringString.spec.d.ts +0 -1
- package/lib/assertions/assertIsNotAnEmptyString.d.ts +0 -1
- package/lib/assertions/assertIsNotAnEmptyString.spec.d.ts +0 -1
- package/lib/assertions/assertIsObject.d.ts +0 -1
- package/lib/assertions/assertIsObject.spec.d.ts +0 -1
- package/lib/assertions/assertIsString.d.ts +0 -1
- package/lib/assertions/assertIsString.spec.d.ts +0 -1
- package/src/assertions/assertAssign.spec.ts +0 -18
- package/src/assertions/assertAssign.ts +0 -22
- package/src/assertions/assertAssignWithDefaultUndefinedValue.spec.ts +0 -31
- package/src/assertions/assertAssignWithDefaultUndefinedValue.ts +0 -17
- package/src/assertions/assertIsDefined.spec.ts +0 -19
- package/src/assertions/assertIsDefined.ts +0 -7
- package/src/assertions/assertIsMapOfStringString.spec.ts +0 -23
- package/src/assertions/assertIsMapOfStringString.ts +0 -29
- package/src/assertions/assertIsNotAnEmptyString.spec.ts +0 -25
- package/src/assertions/assertIsNotAnEmptyString.ts +0 -17
- package/src/assertions/assertIsObject.spec.ts +0 -17
- package/src/assertions/assertIsObject.ts +0 -11
- package/src/assertions/assertIsString.spec.ts +0 -16
- package/src/assertions/assertIsString.ts +0 -11
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,22 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
## [1.2.1-alpha.99](https://gitlab.squiz.net/developer-experience/cmp/compare/v1.2.1-alpha.90...v1.2.1-alpha.99) (2022-08-18)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @squiz/db-lib
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
## [1.2.1-alpha.98](https://gitlab.squiz.net/developer-experience/cmp/compare/v1.2.1-alpha.90...v1.2.1-alpha.98) (2022-08-17)
|
15
|
+
|
16
|
+
**Note:** Version bump only for package @squiz/db-lib
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
6
22
|
## [1.2.1-alpha.97](https://gitlab.squiz.net/developer-experience/cmp/compare/v1.2.1-alpha.90...v1.2.1-alpha.97) (2022-08-17)
|
7
23
|
|
8
24
|
**Note:** Version bump only for package @squiz/db-lib
|
package/lib/index.d.ts
CHANGED
@@ -4,10 +4,3 @@ export * from './Migrator';
|
|
4
4
|
export * from './Repositories';
|
5
5
|
export * from './getConnectionInfo';
|
6
6
|
export * from './PostgresErrorCodes';
|
7
|
-
export * from './assertions/assertIsString';
|
8
|
-
export * from './assertions/assertIsDefined';
|
9
|
-
export * from './assertions/assertIsMapOfStringString';
|
10
|
-
export * from './assertions/assertIsObject';
|
11
|
-
export * from './assertions/assertIsNotAnEmptyString';
|
12
|
-
export * from './assertions/assertAssignWithDefaultUndefinedValue';
|
13
|
-
export * from './assertions/assertAssign';
|
package/lib/index.js
CHANGED
@@ -30932,13 +30932,6 @@ __export(src_exports, {
|
|
30932
30932
|
ConnectionManager: () => ConnectionManager,
|
30933
30933
|
Migrator: () => Migrator,
|
30934
30934
|
PostgresErrorCode: () => PostgresErrorCode,
|
30935
|
-
assertAssign: () => assertAssign,
|
30936
|
-
assertAssignWithDefaultUndefinedValue: () => assertAssignWithDefaultUndefinedValue,
|
30937
|
-
assertIsDefined: () => assertIsDefined,
|
30938
|
-
assertIsMapOfStringString: () => assertIsMapOfStringString,
|
30939
|
-
assertIsNotAnEmptyString: () => assertIsNotAnEmptyString,
|
30940
|
-
assertIsObject: () => assertIsObject,
|
30941
|
-
assertIsString: () => assertIsString,
|
30942
30935
|
getConnectionInfo: () => getConnectionInfo
|
30943
30936
|
});
|
30944
30937
|
module.exports = __toCommonJS(src_exports);
|
@@ -31519,119 +31512,12 @@ var PostgresErrorCode = /* @__PURE__ */ ((PostgresErrorCode2) => {
|
|
31519
31512
|
PostgresErrorCode2["INDEX_CORRUPTED"] = "XX002";
|
31520
31513
|
return PostgresErrorCode2;
|
31521
31514
|
})(PostgresErrorCode || {});
|
31522
|
-
|
31523
|
-
// src/assertions/assertIsString.ts
|
31524
|
-
var import_assert = require("assert");
|
31525
|
-
function assertIsString(val) {
|
31526
|
-
if (typeof val !== "string") {
|
31527
|
-
throw new import_assert.AssertionError({
|
31528
|
-
actual: val,
|
31529
|
-
expected: "string",
|
31530
|
-
message: "value is not a string"
|
31531
|
-
});
|
31532
|
-
}
|
31533
|
-
}
|
31534
|
-
|
31535
|
-
// src/assertions/assertIsDefined.ts
|
31536
|
-
var import_assert2 = require("assert");
|
31537
|
-
function assertIsDefined(value) {
|
31538
|
-
if (value === void 0 || value === null) {
|
31539
|
-
throw new import_assert2.AssertionError({ message: `Expected 'val' to be defined, but received ${value}` });
|
31540
|
-
}
|
31541
|
-
}
|
31542
|
-
|
31543
|
-
// src/assertions/assertIsMapOfStringString.ts
|
31544
|
-
var import_assert3 = require("assert");
|
31545
|
-
function assertIsMapOfStringString(value) {
|
31546
|
-
if (!value) {
|
31547
|
-
throw new import_assert3.AssertionError({
|
31548
|
-
actual: value,
|
31549
|
-
expected: "not null",
|
31550
|
-
message: "value cannot be null or undefined"
|
31551
|
-
});
|
31552
|
-
}
|
31553
|
-
if (typeof value !== "object") {
|
31554
|
-
throw new import_assert3.AssertionError({
|
31555
|
-
actual: value,
|
31556
|
-
expected: "string",
|
31557
|
-
message: "value is not a string"
|
31558
|
-
});
|
31559
|
-
}
|
31560
|
-
for (const [key, propValue] of Object.entries(value)) {
|
31561
|
-
if (typeof propValue !== "string") {
|
31562
|
-
throw new import_assert3.AssertionError({
|
31563
|
-
actual: typeof propValue,
|
31564
|
-
expected: "string",
|
31565
|
-
message: `property ${key} is not type of string`
|
31566
|
-
});
|
31567
|
-
}
|
31568
|
-
}
|
31569
|
-
}
|
31570
|
-
|
31571
|
-
// src/assertions/assertIsObject.ts
|
31572
|
-
var import_assert4 = require("assert");
|
31573
|
-
function assertIsObject(val) {
|
31574
|
-
if (Object.prototype.toString.call(val) !== "[object Object]") {
|
31575
|
-
throw new import_assert4.AssertionError({
|
31576
|
-
actual: Object.prototype.toString.call(val),
|
31577
|
-
expected: "object",
|
31578
|
-
message: "value is not an object"
|
31579
|
-
});
|
31580
|
-
}
|
31581
|
-
}
|
31582
|
-
|
31583
|
-
// src/assertions/assertIsNotAnEmptyString.ts
|
31584
|
-
var import_assert5 = require("assert");
|
31585
|
-
function assertIsNotAnEmptyString(val) {
|
31586
|
-
if (typeof val !== "string") {
|
31587
|
-
throw new import_assert5.AssertionError({
|
31588
|
-
actual: typeof val,
|
31589
|
-
expected: "string",
|
31590
|
-
message: "value is not a string"
|
31591
|
-
});
|
31592
|
-
}
|
31593
|
-
if (val.trim().length === 0) {
|
31594
|
-
throw new import_assert5.AssertionError({
|
31595
|
-
message: "string cannot be empty"
|
31596
|
-
});
|
31597
|
-
}
|
31598
|
-
}
|
31599
|
-
|
31600
|
-
// src/assertions/assertAssign.ts
|
31601
|
-
var import_assert6 = require("assert");
|
31602
|
-
function assertAssign(value, assertionFunc, errorMessage) {
|
31603
|
-
try {
|
31604
|
-
assertionFunc(value);
|
31605
|
-
} catch (e) {
|
31606
|
-
if (errorMessage) {
|
31607
|
-
throw new import_assert6.AssertionError({ message: errorMessage });
|
31608
|
-
} else {
|
31609
|
-
throw e;
|
31610
|
-
}
|
31611
|
-
}
|
31612
|
-
return value;
|
31613
|
-
}
|
31614
|
-
|
31615
|
-
// src/assertions/assertAssignWithDefaultUndefinedValue.ts
|
31616
|
-
function assertAssignWithDefaultUndefinedValue(value, assertionFunc, defaultValue, errorMessage) {
|
31617
|
-
if (value === void 0 || value === null) {
|
31618
|
-
return defaultValue;
|
31619
|
-
}
|
31620
|
-
return assertAssign(value, assertionFunc, errorMessage);
|
31621
|
-
}
|
31622
31515
|
// Annotate the CommonJS export names for ESM import in node:
|
31623
31516
|
0 && (module.exports = {
|
31624
31517
|
AbstractRepository,
|
31625
31518
|
ConnectionManager,
|
31626
31519
|
Migrator,
|
31627
31520
|
PostgresErrorCode,
|
31628
|
-
assertAssign,
|
31629
|
-
assertAssignWithDefaultUndefinedValue,
|
31630
|
-
assertIsDefined,
|
31631
|
-
assertIsMapOfStringString,
|
31632
|
-
assertIsNotAnEmptyString,
|
31633
|
-
assertIsObject,
|
31634
|
-
assertIsString,
|
31635
31521
|
getConnectionInfo
|
31636
31522
|
});
|
31637
31523
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|