mirror of
https://codeberg.org/uzu/strudel
synced 2026-07-13 06:19:33 -04:00
Final docstring cleanup & adding hap tag to logValues for consistency
This commit is contained in:
@@ -854,8 +854,7 @@ export class Pattern {
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the content of the current event to the console, which is visible in the side menu
|
||||
* or as the developer console.
|
||||
* Writes the content of the current event to the console (visible in the side menu).
|
||||
* @name log
|
||||
* @memberof Pattern
|
||||
* @example
|
||||
@@ -869,13 +868,13 @@ export class Pattern {
|
||||
|
||||
/**
|
||||
* A simplified version of `log` which writes all "values" (various configurable parameters)
|
||||
* within the event to the console, which is visible in the side menu or as the developer console.
|
||||
* within the event to the console (visible in the side menu).
|
||||
* @name logValues
|
||||
* @memberof Pattern
|
||||
* @example
|
||||
* s("bd sd").gain("0.25 0.5 1").n("2 1 0").logValues()
|
||||
*/
|
||||
logValues(func = (value) => `${stringifyValues(value, true)}`) {
|
||||
logValues(func = (value) => `[hap] ${stringifyValues(value, true)}`) {
|
||||
return this.log((hap) => func(hap.value));
|
||||
}
|
||||
|
||||
|
||||
@@ -1338,7 +1338,7 @@ describe('Pattern', () => {
|
||||
});
|
||||
|
||||
expect(mockConsoleLog).toHaveBeenCalledWith(
|
||||
'%cvalue:a note:c#',
|
||||
'%c[hap] value:a note:c#',
|
||||
'background-color: black;color:white;border-radius:15px',
|
||||
);
|
||||
mockConsoleLog.mockRestore();
|
||||
|
||||
Reference in New Issue
Block a user