Skip to content

Commit

Permalink
Merge branch 'main' into page-heading-addition
Browse files Browse the repository at this point in the history
  • Loading branch information
PritishBudhiraja authored Dec 1, 2023
2 parents 9f0c2a4 + aaa47a1 commit 786b9d7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 43 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: CI

on:
merge_group:
pull_request:

jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr-title-spell-check.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: PR Title Spell Check

on:
merge_group:
pull_request:
types:
- opened
Expand Down
44 changes: 1 addition & 43 deletions src/utils/DictionaryUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@ let appnedDataToKey = (dict, key, value) => {
dict->Js.Dict.set(key, updatedValue)
}

let appnedArrDataToKey = (dict, key, value) => {
let updatedValue = switch dict->Js.Dict.get(key) {
| Some(val) => Belt.Array.concat(val, value)
| None => value
}
dict->Js.Dict.set(key, updatedValue)
}

let mergeDicts = (arrDict: array<Js.Dict.t<'a>>) => {
arrDict->Js.Array2.reduce((acc, dict) => {
acc->Js.Array2.concat(dict->Js.Dict.entries)
Expand All @@ -61,19 +53,7 @@ let equalDicts = (dictionary1, dictionary2) => {
->Belt.Option.isNone
}

let updateDict = (dict, key, value) => {
let updatedValue = switch dict->Js.Dict.get(key) {
| Some(val) => {
let _ = val->Js.Array2.push(value)
val
}

| None => [value]
}
dict->Js.Dict.set(key, updatedValue)
}

let checkEqualJsonDicts = (~checkKeys=[], ~ignoreKeys=[], dictionary1, dictionary2) => {
let checkEqualJsonDicts = (~checkKeys, ~ignoreKeys, dictionary1, dictionary2) => {
let dictionary1 = dictionary1->Js.Json.object_->JsonFlattenUtils.flattenObject(false)
let dictionary2 = dictionary2->Js.Json.object_->JsonFlattenUtils.flattenObject(false)

Expand Down Expand Up @@ -125,25 +105,3 @@ let checkEqualJsonDicts = (~checkKeys=[], ~ignoreKeys=[], dictionary1, dictionar
let copyOfDict = dict => {
dict->Js.Dict.entries->Js.Array2.copy->Js.Dict.fromArray
}

let sortKeysByAlphaOrder = dict => {
dict
->Js.Dict.entries
->Js.Array2.sortInPlaceWith((item1, item2) => {
let (key1, _) = item1
let (key2, _) = item2

key1 <= key2 ? -1 : 1
})
->Js.Dict.fromArray
}

let filterDictFromArray = (dict, array) => {
dict
->Js.Dict.entries
->Js.Array2.filter(item => {
let (key, _) = item
!(array->Js.Array2.includes(key))
})
->Js.Dict.fromArray
}

0 comments on commit 786b9d7

Please sign in to comment.