# @lingxiteam/functors

> 灵犀平台---函数定义

Latest version **0.4.3** (published 2024-12-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install @lingxiteam/functors
pnpm add @lingxiteam/functors
yarn add @lingxiteam/functors
bun add @lingxiteam/functors
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.3 |
| Published | 2024-12-23 |
| First published | 2022-07-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 239.4 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | limanpm, wanerrr, mishi-brother, hammersjs, zhang.guoyong, zzzzjq, diyc, goulili, pengyh, wujian666, taiyangteng, cenxiaolian, xiaohuoni, duan_duan, yaozanwen, brinkr, babelczx |

## Links

- npm: https://www.npmjs.com/package/@lingxiteam/functors
- npm.io page: https://npm.io/package/@lingxiteam/functors

## Dependencies (2)

- [dayjs](https://npm.io/package/dayjs.md) 1.11.3
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) 7.23.2

## Recent versions

- 0.4.3 (latest) — 2024-12-23
- 0.4.2 — 2024-11-28
- 0.4.1 — 2024-11-28
- 0.4.0 — 2024-11-28
- 0.3.4 — 2024-10-15
- 0.3.3 — 2024-08-20
- 0.3.2 — 2024-08-10
- 0.3.1 — 2023-09-08
- 0.3.0 — 2023-07-21
- 0.2.9 — 2023-05-27
- 0.2.8 — 2023-05-27
- 0.2.7 — 2023-05-18
- 0.2.6 — 2023-03-17
- 0.2.5 — 2023-02-27
- 0.2.4 — 2023-02-25
- … 20 more at https://npm.io/package/@lingxiteam/functors/versions

## README

#  函数库开发说明

> 1. 在src下直接添加对应的函数文件，以ABS函数为例，增加`ABS.ts`文件(文件名大写).
> 2. 导入类型定义文件，并导出该函数
   ```javascript
  //  导入类型定义文件，并导出该函数
   import { FunctorDefine } from './types';
    export const ABS = FunctorDefine({
      // 显示内容
      label: "绝对值",
      // 函数名
      type: "ABS",
      // 插入函数值的默认值
      value: "ABS(-7)",
     // 函数体逻辑
      functor(x: number) {
        if ([null, undefined, ""].includes(x as any)) {
          return undefined;
        }
        return Math.abs(x);
      },
      // 函数
      define: ["计算数字的绝对值"],
      // 描述信息 
      description: {
        tips: [],
        title: "(数值)"
      },
      // 示例说明
      example: {
        tips: ['求 -7 的绝对值'],
        title: "示例：=ABS(-7) ，结果：7"
      }
    });

   ```

> 3. 在`src/utils/export.ts`中导出该函数

> 4. 在`src/utils/register.functor.ts`文件的`export default`方法中导出即可。

> 关于调试，因为目前没有在开发测生成真实的web前端工程，所以无法在这边进行调试。调试可通过link方式在工程中进行测试。开发时，可执行yarn watch命令开发
 开发完成后，需要发布版本，并在编辑器工程和运行态工程中修改版本号。

---
_Source: https://npm.io/package/@lingxiteam/functors · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
