UNPKG

laif-ds

Version:

Design System di Laif con componenti React basati su principi di Atomic Design

39 lines (38 loc) 895 B
"use client"; import { linearish as p } from "./linear.js"; import { transformer as c, copy as f, identity as e } from "./continuous.js"; import { initRange as s } from "./init.js"; function o(n) { return function(t) { return t < 0 ? -Math.pow(-t, n) : Math.pow(t, n); }; } function l(n) { return n < 0 ? -Math.sqrt(-n) : Math.sqrt(n); } function m(n) { return n < 0 ? -n * n : n * n; } function h(n) { var t = n(e, e), r = 1; function i() { return r === 1 ? n(e, e) : r === 0.5 ? n(l, m) : n(o(r), o(1 / r)); } return t.exponent = function(a) { return arguments.length ? (r = +a, i()) : r; }, p(t); } function u() { var n = h(c()); return n.copy = function() { return f(n, u()).exponent(n.exponent()); }, s.apply(n, arguments), n; } function y() { return u.apply(null, arguments).exponent(0.5); } export { u as default, h as powish, y as sqrt };