Skip to content

Commit

Permalink
fix(backport): remove duplicates in banis #release
Browse files Browse the repository at this point in the history
  • Loading branch information
sarabveer committed May 27, 2024
1 parent 9abebb0 commit 583ce97
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/backport.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 } ) => (
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 583ce97

Please sign in to comment.