Skip to content

Commit

Permalink
Merge branch 'feature/bslt-142' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Necrelox committed Jan 29, 2025
2 parents 5e3650d + eacabde commit d817900
Show file tree
Hide file tree
Showing 17 changed files with 43 additions and 105 deletions.
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

# === Archives and build-related files ===
*.tgz

# === Bundler configuration files ===
bundler.ts
CHANGELOG.md
Expand All @@ -34,4 +33,5 @@ test/
# === Core project files ===
README.md
tsconfig.json
tsconfig.dts.json
translate.json
72 changes: 5 additions & 67 deletions bun.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
},
"devDependencies": {
"@eslint/js": "^9.19.0",
"@stylistic/eslint-plugin": "^3.0.0",
"@stylistic/eslint-plugin": "^3.0.1",
"@types/bun": "^1.2.1",
"eslint": "^9.19.0",
"eslint-plugin-tsdoc": "^0.4.0",
Expand Down
4 changes: 2 additions & 2 deletions source/error/key/coreDataKeyError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
* Core data key error is a list of errors in the data context.
*/
export const CORE_DATA_KEY_ERROR = {
DATA_MUST_BE_OBJECT: ['error.basalt-helper.data_must_be_object', 500],
DATA_IS_NULL: ['error.basalt-helper.data_is_null', 500]
DATA_MUST_BE_OBJECT: ['basalt-helper.error.data_must_be_object', 500],
DATA_IS_NULL: ['basalt-helper.error.data_is_null', 500]
} as const;
6 changes: 3 additions & 3 deletions source/error/key/coreSecurityKeyError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Core security key error is a list of errors in the security context.
*/
export const CORE_SECURITY_KEY_ERROR = {
PASSWORD_EMPTY: ['error.basalt-helper.password_empty', 500],
PASSWORD_HASHING_FAILED: ['error.basalt-helper.password_hashing_failed', 500],
PASSWORD_VERIFICATION_FAILED: ['error.basalt-helper.password_verification_failed', 500]
PASSWORD_EMPTY: ['basalt-helper.error.password_empty', 500],
PASSWORD_HASHING_FAILED: ['basalt-helper.error.password_hashing_failed', 500],
PASSWORD_VERIFICATION_FAILED: ['basalt-helper.error.password_verification_failed', 500]
} as const;
4 changes: 2 additions & 2 deletions source/error/key/coreUtilKeyError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ export const CORE_UTIL_KEY_ERROR = {
* Interpolation :
* - name: The name of the class.
*/
CLASS_CONSTRUCTOR_ALREADY_REGISTERED: ['error.basalt-helper.class_constructor_already_registered', 500],
CLASS_CONSTRUCTOR_ALREADY_REGISTERED: ['basalt-helper.error.class_constructor_already_registered', 500],
/**
* Interpolation :
* - name: The name of the class.
*/
CLASS_CONSTRUCTOR_NOT_REGISTERED: ['error.basalt-helper.class_constructor_not_registered', 500]
CLASS_CONSTRUCTOR_NOT_REGISTERED: ['basalt-helper.error.class_constructor_not_registered', 500]
} as const;
4 changes: 2 additions & 2 deletions source/i18n/ar.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"error": {
"basalt-helper": {
"basalt-helper": {
"error": {
"class_constructor_already_registered": "تم تسجيل بناء الفئة بالفعل",
"class_constructor_not_registered": "لم يتم تسجيل بناء الفئة",
"data_is_null": "البيانات فارغة",
Expand Down
4 changes: 2 additions & 2 deletions source/i18n/de.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"error": {
"basalt-helper": {
"basalt-helper": {
"error": {
"class_constructor_already_registered": "Klassenkonstruktor bereits registriert",
"class_constructor_not_registered": "Klassenkonstruktor nicht registriert",
"data_is_null": "Daten sind leer",
Expand Down
4 changes: 2 additions & 2 deletions source/i18n/en.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"error": {
"basalt-helper": {
"basalt-helper": {
"error": {
"class_constructor_already_registered": "Class constructor already registered",
"class_constructor_not_registered": "Class constructor not registered",
"data_is_null": "Data is null",
Expand Down
4 changes: 2 additions & 2 deletions source/i18n/es.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"error": {
"basalt-helper": {
"basalt-helper": {
"error": {
"class_constructor_already_registered": "Constructor de clase ya registrado",
"class_constructor_not_registered": "Constructor de clase no registrado",
"data_is_null": "Los datos son nulos",
Expand Down
4 changes: 2 additions & 2 deletions source/i18n/fr.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"error": {
"basalt-helper": {
"basalt-helper": {
"error": {
"class_constructor_already_registered": "Constructeur de classe déjà enregistré",
"class_constructor_not_registered": "Constructeur de classe non enregistré",
"data_is_null": "Les données sont nulles",
Expand Down
4 changes: 2 additions & 2 deletions source/i18n/it.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"error": {
"basalt-helper": {
"basalt-helper": {
"error": {
"class_constructor_already_registered": "Costruttore di classe già registrato",
"class_constructor_not_registered": "Costruttore di classe non registrato",
"data_is_null": "I dati sono nulli",
Expand Down
4 changes: 2 additions & 2 deletions source/i18n/ja.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"error": {
"basalt-helper": {
"basalt-helper": {
"error": {
"class_constructor_already_registered": "クラスコンストラクタはすでに登録されています",
"class_constructor_not_registered": "クラスコンストラクタは登録されていません",
"data_is_null": "データはヌルです",
Expand Down
4 changes: 2 additions & 2 deletions source/i18n/ko.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"error": {
"basalt-helper": {
"basalt-helper": {
"error": {
"class_constructor_already_registered": "클래스 생성자가 이미 등록되었습니다",
"class_constructor_not_registered": "클래스 생성자가 등록되지 않았습니다",
"data_is_null": "데이터가 널입니다",
Expand Down
16 changes: 8 additions & 8 deletions test/core/data/basaltData.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ describe('Filter By Key Exclusion', () => {

test('should throw an error when data is null', () => {
const object = null as unknown as Record<string, unknown>;
expect(() => filterByKeyExclusion(object, [])).toThrowError('error.basalt-helper.data_is_null');
expect(() => filterByKeyExclusion(object, [])).toThrowError('basalt-helper.error.data_is_null');
});

test('should throw an error when data is not a plain object', () => {
const object = 2 as unknown as Record<string, unknown>;
expect(() => filterByKeyExclusion(object, [])).toThrowError('error.basalt-helper.data_must_be_object');
expect(() => filterByKeyExclusion(object, [])).toThrowError('basalt-helper.error.data_must_be_object');
});

test('should return original object when keys are empty', () => {
Expand Down Expand Up @@ -74,12 +74,12 @@ describe('Filter By Key Inclusion', () => {

test('should throw an error when data is null', () => {
const object = null as unknown as Record<string, unknown>;
expect(() => filterByKeyInclusion(object, [])).toThrowError('error.basalt-helper.data_is_null');
expect(() => filterByKeyInclusion(object, [])).toThrowError('basalt-helper.error.data_is_null');
});

test('should throw an error when data is not a plain object', () => {
const object = 2 as unknown as Record<string, unknown>;
expect(() => filterByKeyInclusion(object, [])).toThrowError('error.basalt-helper.data_must_be_object');
expect(() => filterByKeyInclusion(object, [])).toThrowError('basalt-helper.error.data_must_be_object');
});

test('should return empty object when keys are empty', () => {
Expand Down Expand Up @@ -110,12 +110,12 @@ describe('Filter By Value', () => {

test('should throw an error when data is null', () => {
const object = null as unknown as Record<string, unknown>;
expect(() => filterByValue(object, () => true)).toThrowError('error.basalt-helper.data_is_null');
expect(() => filterByValue(object, () => true)).toThrowError('basalt-helper.error.data_is_null');
});

test('should throw an error when data is not a plain object', () => {
const object = 2 as unknown as Record<string, unknown>;
expect(() => filterByValue(object, () => true)).toThrowError('error.basalt-helper.data_must_be_object');
expect(() => filterByValue(object, () => true)).toThrowError('basalt-helper.error.data_must_be_object');
});

test('should return empty object when predicate does not match', () => {
Expand Down Expand Up @@ -152,12 +152,12 @@ describe('Transform Keys', () => {

test('should throw an error when data is null', () => {
const object = null as unknown as Record<string, unknown>;
expect(() => transformKeys(object, new BasaltCamelCaseTransformer())).toThrowError('error.basalt-helper.data_is_null');
expect(() => transformKeys(object, new BasaltCamelCaseTransformer())).toThrowError('basalt-helper.error.data_is_null');
});

test('should throw an error when data is not a plain object', () => {
const object = 2 as unknown as Record<string, unknown>;
expect(() => transformKeys(object, new BasaltCamelCaseTransformer())).toThrowError('error.basalt-helper.data_must_be_object');
expect(() => transformKeys(object, new BasaltCamelCaseTransformer())).toThrowError('basalt-helper.error.data_must_be_object');
});
});

Expand Down
6 changes: 3 additions & 3 deletions test/core/util/singletonManager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ describe('SingletonManager', () => {
});

test('should throw an error when class constructor is not registered', () => {
expect(() => SingletonManager.get('ExampleSingleton4')).toThrow('error.basalt-helper.class_constructor_not_registered');
expect(() => SingletonManager.get('ExampleSingleton4')).toThrow('basalt-helper.error.class_constructor_not_registered');
});

test('should throw an error when class constructor is already registered', () => {
SingletonManager.register('ExampleSingleton', ExampleSingleton);
expect(
() => SingletonManager.register('ExampleSingleton', ExampleSingleton)
).toThrow('error.basalt-helper.class_constructor_already_registered');
).toThrow('basalt-helper.error.class_constructor_already_registered');
});
});

Expand All @@ -90,7 +90,7 @@ describe('SingletonManager', () => {
test('should throw an error when class constructor is not registered', () => {
expect(() => {
SingletonManager.unregister('ExampleSingleton');
}).toThrow('error.basalt-helper.class_constructor_not_registered');
}).toThrow('basalt-helper.error.class_constructor_not_registered');
});
});

Expand Down
4 changes: 2 additions & 2 deletions translate.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"ja",
"ko"
],
"error": {
"basalt-helper": {
"basalt-helper": {
"error": {
"class_constructor_already_registered": {
"lang:ar": "تم تسجيل بناء الفئة بالفعل",
"lang:de": "Klassenkonstruktor bereits registriert",
Expand Down

0 comments on commit d817900

Please sign in to comment.