ddablib / envvars

Environment Variables Unit
1 stars 2 forks source link

Add mapping and selection methods to TPJEnvironmentVars #15

Open delphidabbler opened 2 years ago

delphidabbler commented 2 years ago

Mapping and selection methods are often useful.

The mapping would transform each environment variable to some type T and create an array of T the same size as there are environment variables.

The selection method would select 0 or many environment variables and return an array containing them.

Both would use callbacks that are passed the environment variable and possibly the index and some data passed in by the user.

The mapping callback will return a value of the required type while the selection will return Boolean true to select the environment variable and false to exclude it.