[task-416]

This commit is contained in:
fenris 2025-10-23 13:19:39 +02:00
parent 3ca0822cff
commit 745fdaafa4
2 changed files with 15 additions and 2 deletions

View file

@ -882,6 +882,9 @@ declare namespace lib_plankton.call {
/** /**
*/ */
export function sleep(seconds: float): Promise<void>; export function sleep(seconds: float): Promise<void>;
/**
*/
export function null_prop<type_value_from, type_value_to>(value_from: (null | type_value_from), function_: ((value: type_value_from) => type_value_to)): (null | type_value_to);
export {}; export {};
} }
declare namespace lib_plankton.file { declare namespace lib_plankton.file {

View file

@ -2043,6 +2043,16 @@ var lib_plankton;
})); }));
} }
call.sleep = sleep; call.sleep = sleep;
/**
*/
function null_prop(value_from, function_) {
return ((value_from === null)
?
null
:
function_(value_from));
}
call.null_prop = null_prop;
})(call = lib_plankton.call || (lib_plankton.call = {})); })(call = lib_plankton.call || (lib_plankton.call = {}));
})(lib_plankton || (lib_plankton = {})); })(lib_plankton || (lib_plankton = {}));
/* /*
@ -3792,10 +3802,10 @@ var lib_plankton;
options = Object.assign({ options = Object.assign({
"compare_value": instance_compare "compare_value": instance_compare
}, options); }, options);
if (is_empty(list)) { /*if (is_empty<type_element>(list)) {
throw (new Error("the max-arg of an empty list is not defined")); throw (new Error("the max-arg of an empty list is not defined"));
} }
else { else */ {
return (list return (list
.reduce(function (result, element, index) { .reduce(function (result, element, index) {
var value = target_function(element); var value = target_function(element);