commit dist
This commit is contained in:
parent
694e106bcf
commit
73441fc007
36
dist/index.cjs
vendored
Normal file
36
dist/index.cjs
vendored
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
var __defProp = Object.defineProperty;
|
||||||
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||||
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||||
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||||
|
var __export = (target, all) => {
|
||||||
|
for (var name in all)
|
||||||
|
__defProp(target, name, { get: all[name], enumerable: true });
|
||||||
|
};
|
||||||
|
var __copyProps = (to, from, except, desc) => {
|
||||||
|
if (from && typeof from === "object" || typeof from === "function") {
|
||||||
|
for (let key of __getOwnPropNames(from))
|
||||||
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||||
|
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||||
|
}
|
||||||
|
return to;
|
||||||
|
};
|
||||||
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||||
|
|
||||||
|
// libs/index.ts
|
||||||
|
var index_exports = {};
|
||||||
|
__export(index_exports, {
|
||||||
|
formatMoney: () => formatMoney,
|
||||||
|
helloWorld: () => helloWorld
|
||||||
|
});
|
||||||
|
module.exports = __toCommonJS(index_exports);
|
||||||
|
function helloWorld() {
|
||||||
|
console.log("Hello World!");
|
||||||
|
}
|
||||||
|
function formatMoney(amount) {
|
||||||
|
return new Intl.NumberFormat("en-US", { style: "decimal", minimumFractionDigits: 2, maximumFractionDigits: 2 }).format(amount);
|
||||||
|
}
|
||||||
|
// Annotate the CommonJS export names for ESM import in node:
|
||||||
|
0 && (module.exports = {
|
||||||
|
formatMoney,
|
||||||
|
helloWorld
|
||||||
|
});
|
13
dist/index.d.cts
vendored
Normal file
13
dist/index.d.cts
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
declare function helloWorld(): void;
|
||||||
|
/**
|
||||||
|
* 将数字格式化为美式金额表示法
|
||||||
|
* 将金额格式化为两位小数,需要处理千分位格式
|
||||||
|
* @param amount - 需要格式化的数字金额
|
||||||
|
* @returns 返回格式化后的金额字符串,保留2位小数
|
||||||
|
* @example
|
||||||
|
* formatMoney(1234.5) // 返回 "1,234.50"
|
||||||
|
* formatMoney(1000000) // 返回 "1,000,000.00"
|
||||||
|
*/
|
||||||
|
declare function formatMoney(amount: number): string;
|
||||||
|
|
||||||
|
export { formatMoney, helloWorld };
|
Loading…
x
Reference in New Issue
Block a user