Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
19 lines
687 B
Plaintext
19 lines
687 B
Plaintext
/*#__NO_SIDE_EFFECTS__*/
|
|
const createUnitType = (unit) => ({
|
|
test: (v) => typeof v === "string" && v.endsWith(unit) && v.split(" ").length === 1,
|
|
parse: parseFloat,
|
|
transform: (v) => `${v}${unit}`,
|
|
});
|
|
const degrees = /*@__PURE__*/ createUnitType("deg");
|
|
const percent = /*@__PURE__*/ createUnitType("%");
|
|
const px = /*@__PURE__*/ createUnitType("px");
|
|
const vh = /*@__PURE__*/ createUnitType("vh");
|
|
const vw = /*@__PURE__*/ createUnitType("vw");
|
|
const progressPercentage = /*@__PURE__*/ (() => ({
|
|
...percent,
|
|
parse: (v) => percent.parse(v) / 100,
|
|
transform: (v) => percent.transform(v * 100),
|
|
}))();
|
|
|
|
export { degrees, percent, progressPercentage, px, vh, vw };
|