amis-formula 1.3.5 → 1.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/doc.js CHANGED
@@ -421,6 +421,23 @@ exports.doc = [
421
421
  },
422
422
  namespace: "数学函数"
423
423
  },
424
+ {
425
+ name: "LAST",
426
+ description: "取数据最后一个",
427
+ example: "LAST(array)",
428
+ params: [
429
+ {
430
+ type: "...number",
431
+ name: "arr",
432
+ description: "要处理的数组"
433
+ }
434
+ ],
435
+ returns: {
436
+ type: "any",
437
+ description: "最后一个值"
438
+ },
439
+ namespace: "数学函数"
440
+ },
424
441
  {
425
442
  name: "LEFT",
426
443
  description: "返回传入文本左侧的指定长度字符串。",
@@ -926,6 +943,23 @@ exports.doc = [
926
943
  },
927
944
  namespace: "文本函数"
928
945
  },
946
+ {
947
+ name: "BASENAME",
948
+ description: "返回路径中的文件名\n\n示例:`/home/amis/a.json`\n\n返回:a.json`",
949
+ example: "BASENAME(text)",
950
+ params: [
951
+ {
952
+ type: "string",
953
+ name: "text",
954
+ description: "要处理的文本"
955
+ }
956
+ ],
957
+ returns: {
958
+ type: "string",
959
+ description: "文件名"
960
+ },
961
+ namespace: "文本函数"
962
+ },
929
963
  {
930
964
  name: "DATE",
931
965
  description: "创建日期对象,可以通过特定格式的字符串,或者数值。\n\n需要注意的是,其中月份的数值是从0开始的,也就是说,\n如果是12月份,你应该传入数值11。",
package/dist/doc.md CHANGED
@@ -256,6 +256,16 @@
256
256
 
257
257
  返回 0-100 之间的随机数
258
258
 
259
+ ### LAST
260
+
261
+ 用法:`LAST(array)`
262
+
263
+ * `arr:...number` 要处理的数组
264
+
265
+ 返回:`any` 最后一个值
266
+
267
+ 取数据最后一个
268
+
259
269
  ## 文本函数
260
270
 
261
271
  ### LEFT
@@ -554,6 +564,20 @@
554
564
 
555
565
  返回文本字符串中从指定位置开始的特定数目的字符
556
566
 
567
+ ### BASENAME
568
+
569
+ 用法:`BASENAME(text)`
570
+
571
+ * `text:string` 要处理的文本
572
+
573
+ 返回:`string` 文件名
574
+
575
+ 返回路径中的文件名
576
+
577
+ 示例:`/home/amis/a.json`
578
+
579
+ 返回:a.json`
580
+
557
581
  ## 日期函数
558
582
 
559
583
  ### DATE
@@ -103,7 +103,7 @@ export declare class Evaluator {
103
103
  add(ast: {
104
104
  left: any;
105
105
  right: any;
106
- }): any;
106
+ }): number;
107
107
  minus(ast: {
108
108
  left: any;
109
109
  right: any;
@@ -459,6 +459,16 @@ export declare class Evaluator {
459
459
  * @returns {number} 随机数
460
460
  */
461
461
  fnRAND(): number;
462
+ /**
463
+ * 取数据最后一个
464
+ *
465
+ * @example LAST(array)
466
+ * @param {...number} arr - 要处理的数组
467
+ * @namespace 数学函数
468
+ *
469
+ * @returns {any} 最后一个值
470
+ */
471
+ fnLAST(arr: Array<any>): any;
462
472
  normalizeText(raw: any): string;
463
473
  /**
464
474
  * 返回传入文本左侧的指定长度字符串。
@@ -756,6 +766,20 @@ export declare class Evaluator {
756
766
  * @returns {number} 命中的位置
757
767
  */
758
768
  fnMID(text: string, from: number, len: number): string;
769
+ /**
770
+ * 返回路径中的文件名
771
+ *
772
+ * 示例:`/home/amis/a.json`
773
+ *
774
+ * 返回:a.json`
775
+ *
776
+ * @example BASENAME(text)
777
+ * @param {string} text - 要处理的文本
778
+ * @namespace 文本函数
779
+ *
780
+ * @returns {string} 文件名
781
+ */
782
+ fnBASENAME(text: string): string | undefined;
759
783
  /**
760
784
  * 创建日期对象,可以通过特定格式的字符串,或者数值。
761
785
  *