GitHub Package
the javascript
Contents 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43    101 102 103 201 202 203 204 301 302 303 304 401 402 403 404 501 502 503 504 601 602 603 604    700 701 702 703 704 705 706 707 708 709 710 © 2024 Steen Hansen
06 - Validate Parameters And Results

One use for the linkUp(your_function, before_test, after_test) construct is to help with debugging and testing without changing the actual source code. The before and after conditions of functions can be viewed without asserts actually littering the functions.

Note that any function names can be used, not just PRE_check_function_name() and POST_check_function_name(), which are used to lessen confusion.
function before_Person(first_name, last_name){
  console.log('before Person:', first_name, last_name)
  if (first_name.match(/^[a-z]/))
    return 'ERROR, first name not capitalized: ' + first_name
}

function Person(first_name, last_name){
  console.log('in Person:', first_name, last_name)
  return {first: first_name, last: last_name} 
}

function person_after(person_result) {
  console.log('after Person:', person_result)
}

Person = type_czech.linkUp(Person, before_Person, person_after) 
jane_doe = Person('Jane', 'Pass')
john_doe = Person('john', 'fail')
>> ERROR, first name not capitalized: john
Note that PRE_check_Person() and POST_check_Person functions do not need to return anything if no error has occured; undefined and '' both mean no errors found.
Console Output