You've already forked obsidian-visualiser
Renaming general.utils to general.util
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import type { CanvasNode } from "~/types/canvas";
|
||||
import { clamp } from "#shared/general.utils";
|
||||
import { clamp } from "#shared/general.util";
|
||||
|
||||
export type Direction = 'bottom' | 'top' | 'left' | 'right';
|
||||
export type Position = { x: number, y: number };
|
||||
|
||||
@@ -40,15 +40,13 @@ export function format(date: Date, template: string): string
|
||||
|
||||
return template;
|
||||
}
|
||||
export function clamp(x: number, min: number, max: number): number {
|
||||
if (x > max)
|
||||
return max;
|
||||
if (x < min)
|
||||
return min;
|
||||
return x;
|
||||
export function clamp(x: number, min: number, max: number): number
|
||||
{
|
||||
return x > max ? max : x < min ? min : x;
|
||||
}
|
||||
export function lerp(a: number, b: number, t: number) {
|
||||
return a + t * (b - a);
|
||||
export function lerp(x: number, a: number, b: number): number
|
||||
{
|
||||
return (1-x)*a+x*b;
|
||||
}
|
||||
export function convertContentFromText(type: FileType, content: string): CanvasContent | string {
|
||||
switch(type)
|
||||
Reference in New Issue
Block a user