feat(fulfillment): Module service implementation first iteration (#6381)
This commit is contained in:
committed by
GitHub
parent
02c53ec93f
commit
fafde4f54d
19
packages/utils/src/common/get-set-difference.ts
Normal file
19
packages/utils/src/common/get-set-difference.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Get the difference between two sets. The difference is the elements that are in the original set but not in the compare set.
|
||||
* @param orignalSet
|
||||
* @param compareSet
|
||||
*/
|
||||
export function getSetDifference<T>(
|
||||
orignalSet: Set<T>,
|
||||
compareSet: Set<T>
|
||||
): Set<T> {
|
||||
const difference = new Set<T>()
|
||||
|
||||
orignalSet.forEach((element) => {
|
||||
if (!compareSet.has(element)) {
|
||||
difference.add(element)
|
||||
}
|
||||
})
|
||||
|
||||
return difference
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
export * from "./alter-columns-helper"
|
||||
export * from "./array-difference"
|
||||
export * from "./get-set-difference"
|
||||
export * from "./build-query"
|
||||
export * from "./camel-to-snake-case"
|
||||
export * from "./container"
|
||||
@@ -46,4 +47,3 @@ export * from "./to-pascal-case"
|
||||
export * from "./transaction"
|
||||
export * from "./upper-case-first"
|
||||
export * from "./wrap-handler"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user