From 583ce9706cbba9fe9f14da6c81ce152683720769 Mon Sep 17 00:00:00 2001 From: Sarabveer Singh Date: Mon, 27 May 2024 08:55:57 -0400 Subject: [PATCH] fix(backport): remove duplicates in banis #release --- lib/backport.js | 7 ++++++- package.json | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/backport.js b/lib/backport.js index 4284bbeea..dbfae288e 100644 --- a/lib/backport.js +++ b/lib/backport.js @@ -112,7 +112,12 @@ const backportBanis = async () => { await unlink( `${JSON_PATH}/bani_folders.json` ) const banisPath = resolve( JSON_PATH, 'banis.json' ) - const banis = await readJson( banisPath ) + let banis = await readJson( banisPath ) + + // Remove duplicates + banis = banis.filter( ( value, index, self ) => index === self.findIndex( test => ( + test.name_gurmukhi === value.name_gurmukhi && test.name_english === value.name_english + ) ) ) await writeJson( banis.map( ( { id, folder, bookmarks, ...rest } ) => ( diff --git a/package.json b/package.json index 2e8d0ab92..76f06cfd9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gurbaninow/database", - "version": "5.0.0-beta", + "version": "5.0.0-beta.1", "description": "The open gurbani database containing an evolving set of corrections. Used in Shabad OS software.", "scripts": { "import": "node lib/import.js",