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
24 - Empty Either Checks

If a function can take parameters with different empty signatures then valuelessness can be caught with a call to checkParam_emptyEither().

function PRE_check_firstMidLast(first, middle, last){
  the_parameters = [first, middle, last]
  first_middle_last = [ 'EMPTY-ERROR', 'EMPTY-ERROR', 'EMPTY-ERROR' ]
  first_only = [ 'EMPTY-ERROR', 'EMPTY-OK', 'EMPTY-OK' ]
  signature = [ first_middle_last, first_only ]
  return type_czech.checkParam_emptyEither(the_parameters, signature)
}

firstMidLast = type_czech.linkUp(firstMidLast, PRE_check_firstMidLast)

function firstMidLast(first, middle, last){
}

firstMidLast('pass_a', 'middle-a', 'last-a') // pass first_middle_last
firstMidLast('pass_b', '', '')               // pass first_only

firstMidLast('', 'fail_c', '')       // fail
firstMidLast('', 'fail_d', 'last-d') // fail
Console Output