@lokalise/node-core
Advanced tools
Comparing version 10.0.1 to 11.0.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.validateNumber = exports.validateOneOf = exports.ConfigScope = void 0; | ||
exports.ConfigScope = void 0; | ||
exports.validateOneOf = validateOneOf; | ||
exports.validateNumber = validateNumber; | ||
const InternalError_1 = require("../errors/InternalError"); | ||
@@ -162,3 +164,2 @@ class ConfigScope { | ||
} | ||
exports.validateOneOf = validateOneOf; | ||
function validateNumber(validatedObject, errorText) { | ||
@@ -173,3 +174,2 @@ if (!Number.isFinite(validatedObject)) { | ||
} | ||
exports.validateNumber = validateNumber; | ||
//# sourceMappingURL=ConfigScope.js.map |
@@ -8,3 +8,4 @@ export type EnvValueValidator<InputType> = (value: InputType) => boolean; | ||
*/ | ||
db: number; | ||
db?: number; | ||
keyPrefix?: string; | ||
port: number; | ||
@@ -11,0 +12,0 @@ username?: string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isEntityGoneError = void 0; | ||
exports.isEntityGoneError = isEntityGoneError; | ||
const typeUtils_1 = require("../utils/typeUtils"); | ||
@@ -8,3 +8,2 @@ function isEntityGoneError(entity) { | ||
} | ||
exports.isEntityGoneError = isEntityGoneError; | ||
//# sourceMappingURL=errorTypeGuards.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.executeSettleAllAndHandleGlobalErrors = exports.executeAsyncAndHandleGlobalErrors = exports.executeAndHandleGlobalErrors = exports.resolveGlobalErrorLogObject = exports.globalLogger = void 0; | ||
exports.globalLogger = void 0; | ||
exports.resolveGlobalErrorLogObject = resolveGlobalErrorLogObject; | ||
exports.executeAndHandleGlobalErrors = executeAndHandleGlobalErrors; | ||
exports.executeAsyncAndHandleGlobalErrors = executeAsyncAndHandleGlobalErrors; | ||
exports.executeSettleAllAndHandleGlobalErrors = executeSettleAllAndHandleGlobalErrors; | ||
const node_util_1 = require("node:util"); | ||
@@ -34,3 +38,2 @@ const pino_1 = require("pino"); | ||
} | ||
exports.resolveGlobalErrorLogObject = resolveGlobalErrorLogObject; | ||
function executeAndHandleGlobalErrors(operation) { | ||
@@ -47,3 +50,2 @@ try { | ||
} | ||
exports.executeAndHandleGlobalErrors = executeAndHandleGlobalErrors; | ||
async function executeAsyncAndHandleGlobalErrors(operation, stopOnError = true) { | ||
@@ -62,3 +64,2 @@ try { | ||
} | ||
exports.executeAsyncAndHandleGlobalErrors = executeAsyncAndHandleGlobalErrors; | ||
async function executeSettleAllAndHandleGlobalErrors(promises, stopOnError = true) { | ||
@@ -79,3 +80,2 @@ const result = await Promise.allSettled(promises); | ||
} | ||
exports.executeSettleAllAndHandleGlobalErrors = executeSettleAllAndHandleGlobalErrors; | ||
//# sourceMappingURL=globalErrorHandler.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.resolveLoggerConfiguration = exports.resolveMonorepoLoggerConfiguration = void 0; | ||
exports.resolveMonorepoLoggerConfiguration = resolveMonorepoLoggerConfiguration; | ||
exports.resolveLoggerConfiguration = resolveLoggerConfiguration; | ||
const tslib_1 = require("tslib"); | ||
@@ -30,3 +31,2 @@ const pino_1 = require("pino"); | ||
} | ||
exports.resolveMonorepoLoggerConfiguration = resolveMonorepoLoggerConfiguration; | ||
function resolveLoggerConfiguration(appConfig) { | ||
@@ -52,3 +52,2 @@ if (appConfig.nodeEnv !== 'production') { | ||
} | ||
exports.resolveLoggerConfiguration = resolveLoggerConfiguration; | ||
//# sourceMappingURL=loggerConfigResolver.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.removeFalsy = exports.removeNullish = exports.callChunked = exports.chunk = void 0; | ||
exports.chunk = chunk; | ||
exports.callChunked = callChunked; | ||
exports.removeNullish = removeNullish; | ||
exports.removeFalsy = removeFalsy; | ||
function chunk(array, chunkSize) { | ||
@@ -18,3 +21,2 @@ const length = array.length; | ||
} | ||
exports.chunk = chunk; | ||
async function callChunked(chunkSize, array, processFn) { | ||
@@ -26,3 +28,2 @@ for (let i = 0; i < array.length; i += chunkSize) { | ||
} | ||
exports.callChunked = callChunked; | ||
/** | ||
@@ -34,3 +35,2 @@ * Return a copy of the given array without null or undefined values | ||
} | ||
exports.removeNullish = removeNullish; | ||
/** | ||
@@ -42,3 +42,2 @@ * Return a copy of the given array without falsy values (eg: false, 0, '', null, undefined) | ||
} | ||
exports.removeFalsy = removeFalsy; | ||
//# sourceMappingURL=arrayUtils.js.map |
@@ -1,3 +0,1 @@ | ||
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import type { BinaryLike } from 'node:crypto'; | ||
@@ -4,0 +2,0 @@ import type { Readable } from 'node:stream'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.generateChecksumForReadable = exports.generateChecksumForObject = exports.generateChecksumForBufferOrString = void 0; | ||
exports.generateChecksumForBufferOrString = generateChecksumForBufferOrString; | ||
exports.generateChecksumForObject = generateChecksumForObject; | ||
exports.generateChecksumForReadable = generateChecksumForReadable; | ||
const node_crypto_1 = require("node:crypto"); | ||
@@ -9,3 +11,2 @@ const HASH_ALGORITHM = 'md5'; | ||
} | ||
exports.generateChecksumForBufferOrString = generateChecksumForBufferOrString; | ||
function generateChecksumForObject(object) { | ||
@@ -15,3 +16,2 @@ const objectAsString = JSON.stringify(object); | ||
} | ||
exports.generateChecksumForObject = generateChecksumForObject; | ||
function generateChecksumForReadable(readable) { | ||
@@ -39,3 +39,2 @@ return new Promise((resolve, reject) => { | ||
} | ||
exports.generateChecksumForReadable = generateChecksumForReadable; | ||
//# sourceMappingURL=checksumUtils.js.map |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node" /> | ||
export type Options = { | ||
@@ -3,0 +2,0 @@ saltLength?: number; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.generateHash = exports.HashAlgorithm = exports.HashEncoding = void 0; | ||
exports.HashAlgorithm = exports.HashEncoding = void 0; | ||
exports.generateHash = generateHash; | ||
const node_crypto_1 = require("node:crypto"); | ||
@@ -18,3 +19,2 @@ var HashEncoding; | ||
} | ||
exports.generateHash = generateHash; | ||
//# sourceMappingURL=hashUtils.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.transformToKebabCase = exports.deepClone = exports.convertDateFieldsToIsoString = exports.groupByUnique = exports.groupByPath = exports.groupBy = exports.isEmptyObject = exports.pickWithoutUndefined = exports.pick = exports.copyWithoutEmpty = exports.copyWithoutUndefined = void 0; | ||
exports.copyWithoutUndefined = copyWithoutUndefined; | ||
exports.copyWithoutEmpty = copyWithoutEmpty; | ||
exports.pick = pick; | ||
exports.pickWithoutUndefined = pickWithoutUndefined; | ||
exports.isEmptyObject = isEmptyObject; | ||
exports.groupBy = groupBy; | ||
exports.groupByPath = groupByPath; | ||
exports.groupByUnique = groupByUnique; | ||
exports.convertDateFieldsToIsoString = convertDateFieldsToIsoString; | ||
exports.deepClone = deepClone; | ||
exports.transformToKebabCase = transformToKebabCase; | ||
const tslib_1 = require("tslib"); | ||
@@ -17,3 +27,2 @@ const dot_prop_1 = tslib_1.__importDefault(require("dot-prop")); | ||
} | ||
exports.copyWithoutUndefined = copyWithoutUndefined; | ||
function copyWithoutEmpty(originalValue) { | ||
@@ -32,3 +41,2 @@ return Object.keys(originalValue).reduce((acc, key) => { | ||
} | ||
exports.copyWithoutEmpty = copyWithoutEmpty; | ||
function pick(source, propNames) { | ||
@@ -47,3 +55,2 @@ const result = {}; | ||
} | ||
exports.pick = pick; | ||
function pickWithoutUndefined(source, propNames) { | ||
@@ -62,3 +69,2 @@ const result = {}; | ||
} | ||
exports.pickWithoutUndefined = pickWithoutUndefined; | ||
function isEmptyObject(params) { | ||
@@ -72,3 +78,2 @@ for (const key in params) { | ||
} | ||
exports.isEmptyObject = isEmptyObject; | ||
/** | ||
@@ -92,3 +97,2 @@ * @param array The array of objects to be grouped. | ||
} | ||
exports.groupBy = groupBy; | ||
/** | ||
@@ -113,3 +117,2 @@ * @param array The array of objects to be grouped. | ||
} | ||
exports.groupByPath = groupByPath; | ||
/** | ||
@@ -139,3 +142,2 @@ * @param array The array of objects to be grouped. | ||
} | ||
exports.groupByUnique = groupByUnique; | ||
function convertDateFieldsToIsoString(object) { | ||
@@ -152,3 +154,2 @@ if (Array.isArray(object)) { | ||
} | ||
exports.convertDateFieldsToIsoString = convertDateFieldsToIsoString; | ||
function convertDateFieldsToIsoStringAux(item) { | ||
@@ -180,3 +181,2 @@ if (item instanceof Date) { | ||
} | ||
exports.deepClone = deepClone; | ||
function transformToKebabCase(object) { | ||
@@ -202,3 +202,2 @@ if (Array.isArray(object)) { | ||
} | ||
exports.transformToKebabCase = transformToKebabCase; | ||
//# sourceMappingURL=objectUtils.js.map |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node" /> | ||
import type { Readable } from 'node:stream'; | ||
@@ -3,0 +2,0 @@ export type ReadableProvider = { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getReadableContentLength = exports.FsReadableProvider = void 0; | ||
exports.FsReadableProvider = void 0; | ||
exports.getReadableContentLength = getReadableContentLength; | ||
const node_constants_1 = require("node:constants"); | ||
@@ -84,3 +85,2 @@ const node_fs_1 = require("node:fs"); | ||
} | ||
exports.getReadableContentLength = getReadableContentLength; | ||
//# sourceMappingURL=streamUtils.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isPublicNonRecoverableError = exports.isError = exports.isInternalError = exports.isStandardizedError = exports.isObject = exports.hasMessage = void 0; | ||
exports.hasMessage = hasMessage; | ||
exports.isObject = isObject; | ||
exports.isStandardizedError = isStandardizedError; | ||
exports.isInternalError = isInternalError; | ||
exports.isError = isError; | ||
exports.isPublicNonRecoverableError = isPublicNonRecoverableError; | ||
function hasMessage(maybe) { | ||
return isObject(maybe) && typeof maybe.message === 'string'; | ||
} | ||
exports.hasMessage = hasMessage; | ||
function isObject(maybeObject) { | ||
return typeof maybeObject === 'object' && maybeObject !== null; | ||
} | ||
exports.isObject = isObject; | ||
function isStandardizedError(error) { | ||
return isObject(error) && typeof error.code === 'string' && typeof error.message === 'string'; | ||
} | ||
exports.isStandardizedError = isStandardizedError; | ||
function isInternalError(error) { | ||
return isObject(error) && error.name === 'InternalError'; | ||
} | ||
exports.isInternalError = isInternalError; | ||
function isError(maybeError) { | ||
return (maybeError instanceof Error || Object.prototype.toString.call(maybeError) === '[object Error]'); | ||
} | ||
exports.isError = isError; | ||
function isPublicNonRecoverableError(error) { | ||
return isObject(error) && error.name === 'PublicNonRecoverableError'; | ||
} | ||
exports.isPublicNonRecoverableError = isPublicNonRecoverableError; | ||
//# sourceMappingURL=typeUtils.js.map |
{ | ||
"name": "@lokalise/node-core", | ||
"version": "10.0.1", | ||
"version": "11.0.0", | ||
"author": { | ||
@@ -48,3 +48,3 @@ "name": "Lokalise", | ||
"@typescript-eslint/parser": "^7.12.0", | ||
"@vitest/coverage-v8": "1.6.0", | ||
"@vitest/coverage-v8": "2.0.1", | ||
"auto-changelog": "^2.4.0", | ||
@@ -57,4 +57,4 @@ "eslint": "^8.57.0", | ||
"typescript": "^5.4.5", | ||
"vitest": "1.6.0" | ||
"vitest": "2.0.1" | ||
} | ||
} |
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
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
118517
1423