@balena/sbvr-types
Advanced tools
Comparing version 4.0.0-build-big-int-parsing-f52cae46de1703f88fc31a251a524dc201d34e9e-1 to 4.0.0-build-renovate-typescript-5-x-bb7292c5e8ed96ecd90acd99212fd4dcf9e2213c-1
@@ -8,5 +8,9 @@ # Change Log | ||
# v4.0.0 | ||
## (2023-03-17) | ||
## (2023-03-21) | ||
* Switch 'Big Integer' & 'Big Serial' parsing to use native BigInt JS type [Thodoris Greasidis] | ||
* Update dependency typescript to v5 [Renovate Bot] | ||
# v3.5.0 | ||
## (2023-03-21) | ||
* Add Big Serial type [Josh Bowling] | ||
@@ -13,0 +17,0 @@ |
@@ -40,11 +40,6 @@ export interface DatabaseTypeFn { | ||
}; | ||
bigint: { | ||
(value: any, required: true): Promise<bigint>; | ||
(value: undefined | null, required: false): Promise<null>; | ||
<U_2>(value: U_2, required: boolean): Promise<bigint | null>; | ||
}; | ||
text: (length?: number) => { | ||
(value: any, required: true): Promise<string>; | ||
(value: undefined | null, required: false): Promise<null>; | ||
<U_3>(value: U_3, required: boolean): Promise<string | null>; | ||
<U_2>(value: U_2, required: boolean): Promise<string | null>; | ||
}; | ||
@@ -54,4 +49,4 @@ date: { | ||
(value: undefined | null, required: false): Promise<null>; | ||
<U_4>(value: U_4, required: boolean): Promise<Date | null>; | ||
<U_3>(value: U_3, required: boolean): Promise<Date | null>; | ||
}; | ||
}; |
@@ -40,9 +40,2 @@ "use strict"; | ||
}), | ||
bigint: checkRequired((value) => { | ||
if (value === '') { | ||
throw new Error('Cannot convert empty string to a BigInt'); | ||
} | ||
const processedValue = BigInt(value); | ||
return processedValue; | ||
}), | ||
text: (length) => checkRequired((value) => { | ||
@@ -49,0 +42,0 @@ if (typeof value !== 'string') { |
@@ -9,3 +9,2 @@ export declare const types: { | ||
}; | ||
export declare const fetchProcessing: (data: any) => any; | ||
export declare const nativeFactTypes: { | ||
@@ -24,5 +23,5 @@ Integer: { | ||
export declare const validate: { | ||
(value: any, required: true): Promise<bigint>; | ||
(value: any, required: true): Promise<number>; | ||
(value: null | undefined, required: false): Promise<null>; | ||
<U>(value: U, required: boolean): Promise<bigint | null>; | ||
<U>(value: U, required: boolean): Promise<number | null>; | ||
}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.validate = exports.nativeFactTypes = exports.fetchProcessing = exports.types = void 0; | ||
exports.validate = exports.nativeFactTypes = exports.types = void 0; | ||
const TypeUtils = require("../type-utils"); | ||
@@ -13,9 +13,2 @@ exports.types = { | ||
}; | ||
const fetchProcessing = (data) => { | ||
if (data == null) { | ||
return data; | ||
} | ||
return BigInt(data); | ||
}; | ||
exports.fetchProcessing = fetchProcessing; | ||
exports.nativeFactTypes = { | ||
@@ -25,3 +18,3 @@ Integer: TypeUtils.nativeFactTypeTemplates.comparison, | ||
}; | ||
exports.validate = TypeUtils.validate.bigint; | ||
exports.validate = TypeUtils.validate.integer; | ||
//# sourceMappingURL=big-integer.js.map |
@@ -10,7 +10,6 @@ import * as TypeUtils from '../type-utils'; | ||
}; | ||
export declare const fetchProcessing: (data: any) => any; | ||
export declare const validate: { | ||
(value: any, required: true): Promise<bigint>; | ||
(value: any, required: true): Promise<number>; | ||
(value: null | undefined, required: false): Promise<null>; | ||
<U>(value: U, required: boolean): Promise<bigint | null>; | ||
<U>(value: U, required: boolean): Promise<number | null>; | ||
}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.validate = exports.fetchProcessing = exports.types = void 0; | ||
exports.validate = exports.types = void 0; | ||
const TypeUtils = require("../type-utils"); | ||
@@ -17,10 +17,3 @@ const mysqlType = (necessity, index, defaultValue = '') => 'BIGINT' + defaultValue + necessity + index + ' AUTO_INCREMENT'; | ||
}; | ||
const fetchProcessing = (data) => { | ||
if (data == null) { | ||
return data; | ||
} | ||
return BigInt(data); | ||
}; | ||
exports.fetchProcessing = fetchProcessing; | ||
exports.validate = TypeUtils.validate.bigint; | ||
exports.validate = TypeUtils.validate.integer; | ||
//# sourceMappingURL=big-serial.js.map |
{ | ||
"name": "@balena/sbvr-types", | ||
"version": "4.0.0-build-big-int-parsing-f52cae46de1703f88fc31a251a524dc201d34e9e-1", | ||
"version": "4.0.0-build-renovate-typescript-5-x-bb7292c5e8ed96ecd90acd99212fd4dcf9e2213c-1", | ||
"description": "SBVR type definitions.", | ||
@@ -38,3 +38,3 @@ "main": "out", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^4.9.3" | ||
"typescript": "^5.0.0" | ||
}, | ||
@@ -56,4 +56,4 @@ "lint-staged": { | ||
"versionist": { | ||
"publishedAt": "2023-03-17T09:28:43.091Z" | ||
"publishedAt": "2023-03-21T11:51:02.484Z" | ||
} | ||
} |
@@ -61,9 +61,2 @@ export interface DatabaseTypeFn { | ||
}), | ||
bigint: checkRequired((value: any) => { | ||
if (value === '') { | ||
throw new Error('Cannot convert empty string to a BigInt'); | ||
} | ||
const processedValue = BigInt(value); | ||
return processedValue; | ||
}), | ||
text: (length?: number) => | ||
@@ -70,0 +63,0 @@ checkRequired((value: any) => { |
@@ -12,9 +12,2 @@ import * as TypeUtils from '../type-utils'; | ||
export const fetchProcessing = (data: any) => { | ||
if (data == null) { | ||
return data; | ||
} | ||
return BigInt(data); | ||
}; | ||
export const nativeFactTypes = { | ||
@@ -25,2 +18,2 @@ Integer: TypeUtils.nativeFactTypeTemplates.comparison, | ||
export const validate = TypeUtils.validate.bigint; | ||
export const validate = TypeUtils.validate.integer; |
@@ -26,9 +26,2 @@ import * as TypeUtils from '../type-utils'; | ||
export const fetchProcessing = (data: any) => { | ||
if (data == null) { | ||
return data; | ||
} | ||
return BigInt(data); | ||
}; | ||
export const validate = TypeUtils.validate.bigint; | ||
export const validate = TypeUtils.validate.integer; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
112531
1694