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
22 - Empty Checks with Extra Optional Parameters

This is only for empty checking parameters and results that are single objects and single arrays. The idea is that extra values, to be ignored, are inside the checked collection variable. Extra optional parameter values are not checked for emptiness, they are just ignored. As long as the correct declared type shape is not violated, any additional elective parameters will be overlooked .

Objects specify their mandatory empty description, whilst arrays just check the beginning elements for being valueless, and ignore the rest undescribed elements.

Thus checkParam_emptyExtra(an_object, {a:'EMPTY-ERROR'}) means extra properties inside the parameter_object are ignored after the number property of 'a'.
func0 = (an_object) => an_object
PRE_check_func0 = (an_object) => { 
  return type_czech.checkParam_emptyExtra(an_object, {a:'EMPTY-ERROR'})
}
func0 = type_czech.linkUp(func0, PRE_check_func0)
func0({a:11, extra:'string'}) //pass
func0({a:'pass'}, 'ok-also')  // pass
func0({a:''})                 //fail - empty
func0({b:'bad-key'})          //fail - not 'a' key
And checkParam_emptyExtra(an_array, 'EMPTY-ERROR') refers to one number and something extra possibly.
func1 = (an_array) => an_array
PRE_check_func1 = (an_array) => { 
  return type_czech.checkParam_emptyExtra(an_array, 'EMPTY-ERROR')
}
func1 = type_czech.linkUp(func1, PRE_check_func1)
func1([1, '', '', '', 'pass'])      // pass
func1(1, '')                        // pass
func1(['', 'fail', 'fail', 'fail']) // fail
func1('', 'fail')                   // fail
Whereas checkParam_emptyExtra(an_array, ['EMPTY-ERROR', 'EMPTY-ERROR']) refers to two entities that should not be empty, possibly followed by something extra.
func2 = (an_array) => an_array
PRE_check_func2 = (an_array) => { 
  the_signature = ['EMPTY-ERROR', 'EMPTY-ERROR']
  return type_czech.checkParam_emptyExtra(an_array, the_signature)
}
func2 = type_czech.linkUp(func2, PRE_check_func2)
func2([7, true, '', '', '', 'pass'])    // pass
func2([{}, '', 'fail', 'fail', 'fail']) // fail
func2(['fail-one-element'])             // fail
Console Output