Comparing version 1.0.19 to 1.0.20
{ | ||
"name": "js-awe", | ||
"version": "1.0.19", | ||
"version": "1.0.20", | ||
"homepage": "https://github.com/josuamanuel/js-awe", | ||
@@ -5,0 +5,0 @@ "author": "josuamanuel@hotmail.com", |
@@ -283,2 +283,29 @@ // ts-check | ||
const exclude = R.curry( | ||
(fieldToRemove, valuesToRemove, fieldSubject, subjectArray) => | ||
subjectArray.filter( | ||
(subjectEl) => { | ||
let finalSubjectEl = subjectEl | ||
if(fieldSubject !== undefined && fieldSubject !== null) | ||
finalSubjectEl = subjectEl[fieldSubject] | ||
return !valuesToRemove.find( | ||
(valToRemove) => { | ||
let finalValToRemove = valToRemove | ||
if(fieldToRemove !== undefined && fieldToRemove !== null) | ||
finalValToRemove = valToRemove[fieldToRemove] | ||
return finalSubjectEl === finalValToRemove | ||
} | ||
) | ||
} | ||
) | ||
) | ||
RE.exclude = exclude | ||
//exclude('id',[{id:2},{id:6}], undefined, [1,2,3,4,5,6,7,8]) //? | ||
//exclude('id',[{id:2},{id:6}], 'key', [{key:1, age:1},{key:2, age:2},{key:4, age:4},{key:5, age:5}]) //? | ||
const n0IsNotUnfold = | ||
@@ -285,0 +312,0 @@ R.pipe( |
@@ -124,2 +124,10 @@ export namespace RE { | ||
export const mapWithPrevious: any; | ||
/** | ||
* Exclude elements of the subject Array that matches | ||
* the valuesToRemove. | ||
* You can specify the field in both Arrays for the match. | ||
* a field with value undefined will math using the value instead | ||
* of the values of the property indicated by the field | ||
*/ | ||
export function exclude<T>(fieldToRemove:string|undefined, valuesToRemove: any[], fieldSubject:string|undefined, subjectArray:T[]):T[]; | ||
export function pipeWithChain(...func: any[]): (...params: any[]) => any; | ||
@@ -126,0 +134,0 @@ export function pipe(...func: any[]): (...params: any[]) => any; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
225419
6759