From f295b673231d0b8aa209eef63a2431cd943448e0 Mon Sep 17 00:00:00 2001 From: adarleyjrr <50996706+adarleyjrr@users.noreply.github.com> Date: Fri, 19 Jul 2024 15:09:13 -0400 Subject: [PATCH 1/2] fix: for csv maker helper to use file encoding provided in options, when provided --- CHANGELOG.md | 2 ++ src/helpers/csv/index.ts | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index afbe67c..ad26848 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fixes CSV maker helper to use file encoding option from args, when provided + ## [3.0.2] - 2024-07-16 ### Fixed diff --git a/src/helpers/csv/index.ts b/src/helpers/csv/index.ts index db363e0..a1c2e4d 100644 --- a/src/helpers/csv/index.ts +++ b/src/helpers/csv/index.ts @@ -134,7 +134,10 @@ export const parseCsv = ( */ export const makeCsv = async (dir: string, name: string, content: Input, opts: Options = {}, append = false) => new Promise((resolve, reject) => { - const writeStream = fs.createWriteStream(path.join(dir, name), { flags: append ? 'a' : 'w', encoding: 'utf8' }); + const writeStream = fs.createWriteStream(path.join(dir, name), { + flags: append ? 'a' : 'w', + encoding: opts.encoding || 'utf8' + }); stringify(content, opts) .on('data', (chunk) => { From 44315ca6357caea6962514b8404132546293ec62 Mon Sep 17 00:00:00 2001 From: adarleyjrr <50996706+adarleyjrr@users.noreply.github.com> Date: Fri, 19 Jul 2024 15:10:38 -0400 Subject: [PATCH 2/2] build: bumping version: 3.0.3 --- CHANGELOG.md | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad26848..9cdb31d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +## [3.0.3] - 2024-07-19 + +### Fixed + - Fixes CSV maker helper to use file encoding option from args, when provided ## [3.0.2] - 2024-07-16 diff --git a/package.json b/package.json index 1baa7b2..08e93d8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@perimetre/helpers", "description": "Our bundle with all of our utilities and reusable helpers", - "version": "3.0.2", + "version": "3.0.3", "repository": { "type": "git", "url": "git+https://github.com/perimetre/helpers.git"