@lokalise/node-core
Advanced tools
Comparing version 11.1.0 to 11.2.0
@@ -13,3 +13,3 @@ "use strict"; | ||
formatters: { | ||
level: (label, numericLevel) => { | ||
level: (_label, numericLevel) => { | ||
const level = pino_1.levels.labels[numericLevel] || 'unknown'; | ||
@@ -16,0 +16,0 @@ return { level }; |
@@ -12,3 +12,3 @@ import type { Logger, LoggerOptions, redactOptions } from 'pino'; | ||
}; | ||
export declare function resolveMonorepoLoggerConfiguration(appConfig: MonorepoAppLoggerConfig): LoggerOptions | Logger | boolean; | ||
export declare function resolveLoggerConfiguration(appConfig: AppLoggerConfig): LoggerOptions | Logger | boolean; | ||
export declare function resolveMonorepoLoggerConfiguration(appConfig: MonorepoAppLoggerConfig): LoggerOptions | Logger; | ||
export declare function resolveLoggerConfiguration(appConfig: AppLoggerConfig): LoggerOptions | Logger; |
@@ -16,2 +16,3 @@ "use strict"; | ||
while (index < length) { | ||
// biome-ignore lint/suspicious/noAssignInExpressions: <explanation> | ||
result[resIndex++] = array.slice(index, (index += chunkSize)); | ||
@@ -18,0 +19,0 @@ } |
@@ -18,3 +18,3 @@ "use strict"; | ||
const hashCreator = (0, node_crypto_1.createHash)(HASH_ALGORITHM); | ||
readable.on('data', function (data) { | ||
readable.on('data', (data) => { | ||
if (Buffer.isBuffer(data)) { | ||
@@ -28,7 +28,7 @@ hashCreator.update(data); | ||
}); | ||
readable.on('end', function () { | ||
readable.on('end', () => { | ||
const hash = hashCreator.digest('hex'); | ||
resolve(hash); | ||
}); | ||
readable.on('error', function (err) { | ||
readable.on('error', (err) => { | ||
/* c8 ignore next 1 */ | ||
@@ -35,0 +35,0 @@ reject(err); |
export type Options = { | ||
saltLength?: number; | ||
pbkdf2Iterations?: number; | ||
encoding?: BufferEncoding; | ||
encoding?: NodeJS.BufferEncoding; | ||
}; | ||
@@ -6,0 +6,0 @@ /** |
@@ -5,3 +5,3 @@ "use strict"; | ||
const tslib_1 = require("tslib"); | ||
const crypto = tslib_1.__importStar(require("crypto")); | ||
const crypto = tslib_1.__importStar(require("node:crypto")); | ||
const algorithm = 'aes-256-gcm'; | ||
@@ -8,0 +8,0 @@ const ivLength = 16; |
@@ -151,10 +151,8 @@ "use strict"; | ||
} | ||
else if (item && typeof item === 'object') { | ||
if (item && typeof item === 'object') { | ||
// @ts-ignore | ||
return convertDateFieldsToIsoString(item); | ||
} | ||
else { | ||
// @ts-ignore | ||
return item; | ||
} | ||
// @ts-ignore | ||
return item; | ||
} | ||
@@ -173,2 +171,9 @@ /** | ||
} | ||
function transformKey(key) { | ||
return key | ||
.replace(/([a-z])([A-Z])/g, '$1-$2') // transforms basic camelCase | ||
.replace(/([A-Z])([A-Z][a-z])/g, '$1-$2') // transforms abbreviations | ||
.replace(/_/g, '-') // transforms snake_case | ||
.toLowerCase(); // finally lowercase all | ||
} | ||
function transformToKebabCase(object) { | ||
@@ -182,14 +187,12 @@ if (Array.isArray(object)) { | ||
} | ||
const transformKey = (key) => key | ||
.replace(/([a-z])([A-Z])/g, '$1-$2') // transforms basic camelCase | ||
.replace(/([A-Z])([A-Z][a-z])/g, '$1-$2') // transforms abbreviations | ||
.replace(/_/g, '-') // transforms snake_case | ||
.toLowerCase(); // finally lowercase all | ||
return Object.entries(object).reduce((result, [key, value]) => ({ | ||
...result, | ||
[transformKey(key)]: value && typeof value === 'object' | ||
return Object.entries(object).reduce((result, [key, value]) => { | ||
const transformedKey = transformKey(key); | ||
const transformedValue = value && typeof value === 'object' | ||
? transformToKebabCase(value) | ||
: value, | ||
}), {}); | ||
: value; | ||
// Avoiding destructuring by directly assigning the new key-value pair | ||
result[transformedKey] = transformedValue; | ||
return result; | ||
}, {}); | ||
} | ||
//# sourceMappingURL=objectUtils.js.map |
{ | ||
"name": "@lokalise/node-core", | ||
"version": "11.1.0", | ||
"version": "11.2.0", | ||
"author": { | ||
@@ -31,4 +31,4 @@ "name": "Lokalise", | ||
"test:update-snapshots": "vitest -u", | ||
"lint": "eslint . --ext .ts && prettier --check --log-level warn \"**/*.{json,md,ts}\" !CHANGELOG.md", | ||
"lint:fix": "eslint . --fix && prettier --write --log-level warn \"**/*.{json,md,ts}\" !CHANGELOG.md", | ||
"lint": "biome check . && tsc --project tsconfig.lint.json --noEmit", | ||
"lint:fix": "biome check --write", | ||
"version": "auto-changelog -p && git add CHANGELOG.md", | ||
@@ -39,23 +39,19 @@ "prepublishOnly": "npm run build" | ||
"dot-prop": "6.0.1", | ||
"pino": "^9.1.0", | ||
"pino": "^9.3.1", | ||
"pino-pretty": "^11.2.1", | ||
"tslib": "^2.6.2", | ||
"tslib": "^2.6.3", | ||
"zod": "^3.23.8" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^20.14.2", | ||
"@biomejs/biome": "^1.8.3", | ||
"@lokalise/biome-config": "^1.3.0", | ||
"@types/node": "^20.14.11", | ||
"@types/tmp": "^0.2.6", | ||
"@typescript-eslint/eslint-plugin": "^7.12.0", | ||
"@typescript-eslint/parser": "^7.12.0", | ||
"@vitest/coverage-v8": "2.0.1", | ||
"@vitest/coverage-v8": "2.0.3", | ||
"auto-changelog": "^2.4.0", | ||
"eslint": "^8.57.0", | ||
"eslint-plugin-import": "^2.29.1", | ||
"eslint-plugin-vitest": "0.4.1", | ||
"pino-test": "^1.0.1", | ||
"prettier": "^3.3.1", | ||
"tmp": "^0.2.3", | ||
"typescript": "^5.4.5", | ||
"vitest": "2.0.1" | ||
"typescript": "^5.5.3", | ||
"vitest": "2.0.3" | ||
} | ||
} |
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
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
118845
10
1430
Updatedpino@^9.3.1
Updatedtslib@^2.6.3