<commit_before># json-collection-decorator
efficiently run a collection of records by conditions and decorate them when conditions match, return results - filtered items

# Inputs
1. config object
2. collection of jsonobjects

```javascript

var objConfig={
	 filters:[
	 	{ path:"path.to.key",op:"eq",val:"value to match" }
	 ]
	,decorate:[
		{
			find:[{ path:"path.to.key",op:"eq",val:"value to match" }]
			,do:[{ path:"path.to.key",act:"set",val:"value to set" }]
		},{
			,find:{ path:"path.to.key",op:"eq",val:"value to match" }
			,do:{path:"path.to.key",act:"stack",val:"value to add to array" }
		}
	]
}

arrResults = decorate(objConfig,arrCollection);
```

#multiple matching conditions

multiple conditions in an array are treated as an AND, they ALL must match. OR conditions can be listed as a separate line. Multiple actions are ALL executed

# Action Parameters

1. filter : conditions to meet for filtering out the object from the collection to return
2. decorate: pairs of conditions and decorator actions to perform on each object in the collection
3. decorate.find: the condiion for a decoration
4. decorate.act: the action to perform on hat is matched

# Comparison Parameters

1. path : dot notation path to the field
2. op : operand
3. val : stauc value to compare against
4. path2 : used for comparisons between values instead of setting a static one


# Operands

1. eq : ==
2. ne : !=
3. gt : >
4. lt : <
5. in : found in a string or simple array
6. ni : opposite of in
7. has : more than a count of occurences of in
8. any: doesnt matter
9. empty: no data, null, or undefined
10. data: populated field

# Actions

5. set: static value to set
6. stack: static value to add to an array
7. unstack: remove an exact value from an array
7. add: numeric value to add, this will also convert existing values to a number
8. append: string to append
9. prepend: string to append
10. remove: remove the field from the object
10. rename: rename a field of an object
12. prioritize: adds 1 to existings _priority, unless a different number is specified
<commit_msg>update docs for focus action<commit_after># json-collection-decorator
efficiently run a collection of records by conditions and decorate them when conditions match, return results - filtered items

# Inputs
1. config object
2. collection of jsonobjects

```javascript

var objConfig={
	 filters:[
	 	{ path:"path.to.key",op:"eq",val:"value to match" }
	 ]
	,decorate:[
		{
			find:[{ path:"path.to.key",op:"eq",val:"value to match" }]
			,do:[{ path:"path.to.key",act:"set",val:"value to set" }]
		},{
			,find:{ path:"path.to.key",op:"eq",val:"value to match" }
			,do:{path:"path.to.key",act:"stack",val:"value to add to array" }
		}
	]
}

arrResults = decorate(objConfig,arrCollection);
```

#multiple matching conditions

multiple conditions in an array are treated as an AND, they ALL must match. OR conditions can be listed as a separate line. Multiple actions are ALL executed

# Action Parameters

1. filter : conditions to meet for filtering out the object from the collection to return
2. decorate: pairs of conditions and decorator actions to perform on each object in the collection
3. decorate.find: the condiion for a decoration
4. decorate.act: the action to perform on hat is matched

# Comparison Parameters

1. path : dot notation path to the field
2. op : operand
3. val : stauc value to compare against
4. path2 : used for comparisons between values instead of setting a static one


# Operands

1. eq : ==
2. ne : !=
3. gt : >
4. lt : <
5. in : found in a string or simple array
6. ni : opposite of in
7. has : more than a count of occurences of in
8. any: doesnt matter
9. empty: no data, null, or undefined
10. data: populated field

# Actions

5. set: static value to set
6. stack: static value to add to an array
7. unstack: remove an exact value from an array
7. add: numeric value to add, this will also convert existing values to a number
8. append: string to append
9. prepend: string to append
10. remove: remove the field from the object
10. rename: rename a field of an object
12. prioritize: adds 1 to existings _priority, unless a different number is specified
13. focus: array of paths to keep, remove all others ['path1', 'path2.child']

{'fraction_non_alphanumeric': 0.09522689865976958, 'fraction_numerical': 0.017399482718081356, 'mean_word_length': 3.952270081490105, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6970518', 'n_tokens_mistral': 1319, 'n_tokens_neox': 1240, 'n_words': 608}