@zwa73/utils 1.0.115 → 1.0.116

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zwa73/utils",
3
- "version": "1.0.115",
3
+ "version": "1.0.116",
4
4
  "description": "my utils",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -33,7 +33,7 @@
33
33
  "@types/fluent-ffmpeg": "^2.1.21",
34
34
  "@types/jest": "^29.5.12",
35
35
  "@types/node": "^18.16.3",
36
- "@zwa73/dev-utils": "^1.0.33",
36
+ "@zwa73/dev-utils": "^1.0.37",
37
37
  "jest": "^29.7.0",
38
38
  "ts-jest": "^29.1.2",
39
39
  "tsc-alias": "^1.8.8",
@@ -63,7 +63,7 @@ async function main(){
63
63
  input: process.stdin,
64
64
  output: process.stdout
65
65
  });
66
- setTimeout(()=>rl.close(),20000);
66
+ setTimeout(()=>rl.close(),5000);
67
67
  rl.question('按任意键继续...', () => rl.close());
68
68
  }
69
69
  main()
@@ -1,11 +1,11 @@
1
- import {$macro} from '@zwa73/dev-utils';
1
+ import {regionMacro} from '@zwa73/dev-utils';
2
2
 
3
3
  const N = 20;
4
4
  const R = (n:number)=>n===0?`I`:`R${n}`;
5
5
  const prefix = (str:string,prefix?:string)=> str.length>0?`${prefix}${str}`:str;
6
6
  const suffix = (str:string,suffix?:string)=> str.length>0?`${str}${suffix}`:str;
7
7
 
8
- $macro("flow重载",(()=>{
8
+ regionMacro("flow重载",()=>{
9
9
  let result = ``;
10
10
  for (let i = 0; i <= N; i++) {
11
11
  const template = Array.from({length: i+1}, (_, k) => R(k)).join(', ');
@@ -15,8 +15,8 @@ $macro("flow重载",(()=>{
15
15
  result += `export function flow<${template}>(${args}...fs: CompFunc<${R(i)}, ${R(i)}>[]): CompFunc<I, ${R(i)}>;\n`;
16
16
  }
17
17
  return result.trim();
18
- })());
19
- $macro("pipe重载",(()=>{
18
+ });
19
+ regionMacro("pipe重载",()=>{
20
20
  let result = ``;
21
21
  for (let i = 0; i <= N; i++) {
22
22
  const template = Array.from({length: i+1}, (_, k) => R(k)).join(', ');
@@ -26,4 +26,4 @@ $macro("pipe重载",(()=>{
26
26
  result += `export function pipe<${template}>(input: I, ${args}...fs: CompFunc<${R(i)}, ${R(i)}>[]): ${R(i)};\n`;
27
27
  }
28
28
  return result.trim();
29
- })());
29
+ });
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "extends": "./tsconfig.json",
3
- "include": ["./src/**/*.ts", "./src/**/*.js"]
3
+ "include": ["./src/**/*.ts", "./src/**/*.js"],
4
+ "exclude": ["./node_modules/**/*","./src/**/*.macro.ts"]
4
5
  }
@@ -1 +0,0 @@
1
- export {};
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const dev_utils_1 = require("@zwa73/dev-utils");
4
- const N = 20;
5
- const R = (n) => n === 0 ? `I` : `R${n}`;
6
- const prefix = (str, prefix) => str.length > 0 ? `${prefix}${str}` : str;
7
- const suffix = (str, suffix) => str.length > 0 ? `${str}${suffix}` : str;
8
- (0, dev_utils_1.$macro)("flow重载", (() => {
9
- let result = ``;
10
- for (let i = 0; i <= N; i++) {
11
- const template = Array.from({ length: i + 1 }, (_, k) => R(k)).join(', ');
12
- const args = suffix(Array.from({ length: i }, (_, k) => `f${k + 1}: CompFunc<${R(k)}, ${R(k + 1)}>`).join(', '), ", ");
13
- result += `export function flow<${template}>(${args}...fs: CompFunc<${R(i)}, ${R(i)}>[]): CompFunc<I, ${R(i)}>;\n`;
14
- }
15
- return result.trim();
16
- })());
17
- (0, dev_utils_1.$macro)("pipe重载", (() => {
18
- let result = ``;
19
- for (let i = 0; i <= N; i++) {
20
- const template = Array.from({ length: i + 1 }, (_, k) => R(k)).join(', ');
21
- const args = suffix(Array.from({ length: i }, (_, k) => `f${k + 1}: CompFunc<${R(k)}, ${R(k + 1)}>`).join(', '), ", ");
22
- result += `export function pipe<${template}>(input: I, ${args}...fs: CompFunc<${R(i)}, ${R(i)}>[]): ${R(i)};\n`;
23
- }
24
- return result.trim();
25
- })());