@lppx/nlearn 1.1.4 → 1.1.5

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.
@@ -0,0 +1,261 @@
1
+ "use strict";
2
+ /**
3
+ * Fuse.js 配置详解
4
+ * ================
5
+ * 深入了解 Fuse.js 的各种配置选项及其影响
6
+ *
7
+ * 官方文档: https://www.fusejs.io/api/options.html
8
+ * 适用版本: fuse.js 7.x
9
+ */
10
+ var __importDefault = (this && this.__importDefault) || function (mod) {
11
+ return (mod && mod.__esModule) ? mod : { "default": mod };
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ const fuse_js_1 = __importDefault(require("fuse.js"));
15
+ // #region 示例1: threshold 阈值配置
16
+ function 阈值配置对比() {
17
+ console.log('\n=== 示例1: threshold 阈值配置 ===');
18
+ const words = ['apple', 'application', 'apply', 'appreciate'];
19
+ // 严格匹配 (threshold = 0.0)
20
+ const strictFuse = new fuse_js_1.default(words, { threshold: 0.0 });
21
+ console.log('严格匹配 (threshold: 0.0) 搜索 "apple":');
22
+ strictFuse.search('apple').forEach(item => {
23
+ console.log(` - ${item.item}`);
24
+ });
25
+ // 中等匹配 (threshold = 0.3)
26
+ const mediumFuse = new fuse_js_1.default(words, { threshold: 0.3, includeScore: true });
27
+ console.log('\n中等匹配 (threshold: 0.3) 搜索 "aple":');
28
+ mediumFuse.search('aple').forEach(item => {
29
+ console.log(` - ${item.item} (分数: ${item.score?.toFixed(3)})`);
30
+ });
31
+ // 宽松匹配 (threshold = 0.6)
32
+ const looseFuse = new fuse_js_1.default(words, { threshold: 0.6, includeScore: true });
33
+ console.log('\n宽松匹配 (threshold: 0.6) 搜索 "apl":');
34
+ looseFuse.search('apl').forEach(item => {
35
+ console.log(` - ${item.item} (分数: ${item.score?.toFixed(3)})`);
36
+ });
37
+ console.log('\n说明: threshold 越小,匹配越严格;越大,匹配越宽松');
38
+ }
39
+ // #endregion
40
+ // #region 示例2: location 和 distance 配置
41
+ function 位置距离配置() {
42
+ console.log('\n=== 示例2: location 和 distance 配置 ===');
43
+ const texts = [
44
+ 'The quick brown fox jumps over the lazy dog',
45
+ 'A quick brown fox',
46
+ 'The lazy dog sleeps'
47
+ ];
48
+ // 默认配置:在整个字符串中搜索
49
+ const defaultFuse = new fuse_js_1.default(texts, {
50
+ includeScore: true,
51
+ threshold: 0.3
52
+ });
53
+ console.log('默认配置搜索 "quick":');
54
+ defaultFuse.search('quick').forEach(item => {
55
+ console.log(` - "${item.item.substring(0, 30)}..." (分数: ${item.score?.toFixed(3)})`);
56
+ });
57
+ // 限制搜索位置和距离
58
+ const restrictedFuse = new fuse_js_1.default(texts, {
59
+ includeScore: true,
60
+ threshold: 0.3,
61
+ location: 0, // 从字符串开头开始
62
+ distance: 10 // 只在前 10 个字符内搜索
63
+ });
64
+ console.log('\n限制位置配置 (location: 0, distance: 10) 搜索 "quick":');
65
+ const result = restrictedFuse.search('quick');
66
+ if (result.length > 0) {
67
+ result.forEach(item => {
68
+ console.log(` - "${item.item.substring(0, 30)}..." (分数: ${item.score?.toFixed(3)})`);
69
+ });
70
+ }
71
+ else {
72
+ console.log(' - 无结果(因为 "quick" 不在前 10 个字符内)');
73
+ }
74
+ }
75
+ // #endregion
76
+ // #region 示例3: minMatchCharLength 最小匹配长度
77
+ function 最小匹配长度() {
78
+ console.log('\n=== 示例3: minMatchCharLength 最小匹配长度 ===');
79
+ const codes = [
80
+ 'JavaScript',
81
+ 'Java',
82
+ 'TypeScript',
83
+ 'Python',
84
+ 'Go'
85
+ ];
86
+ // 不限制最小匹配长度
87
+ const noMinFuse = new fuse_js_1.default(codes, {
88
+ minMatchCharLength: 1
89
+ });
90
+ console.log('最小匹配长度 1,搜索 "ja":');
91
+ noMinFuse.search('ja').forEach(item => {
92
+ console.log(` - ${item.item}`);
93
+ });
94
+ // 要求至少匹配 3 个字符
95
+ const minFuse = new fuse_js_1.default(codes, {
96
+ minMatchCharLength: 3
97
+ });
98
+ console.log('\n最小匹配长度 3,搜索 "ja":');
99
+ const result = minFuse.search('ja');
100
+ if (result.length > 0) {
101
+ result.forEach(item => {
102
+ console.log(` - ${item.item}`);
103
+ });
104
+ }
105
+ else {
106
+ console.log(' - 无结果(搜索词少于 3 个字符)');
107
+ }
108
+ }
109
+ // #endregion
110
+ // #region 示例4: shouldSort 和 sortFn 排序配置
111
+ function 排序配置() {
112
+ console.log('\n=== 示例4: shouldSort 和排序配置 ===');
113
+ const items = [
114
+ { name: 'React', stars: 200000 },
115
+ { name: 'Vue', stars: 180000 },
116
+ { name: 'Angular', stars: 85000 },
117
+ { name: 'Svelte', stars: 65000 },
118
+ { name: 'Preact', stars: 35000 }
119
+ ];
120
+ // 默认按匹配分数排序
121
+ const scoreSortFuse = new fuse_js_1.default(items, {
122
+ keys: ['name'],
123
+ includeScore: true,
124
+ shouldSort: true
125
+ });
126
+ console.log('按匹配分数排序,搜索 "react":');
127
+ scoreSortFuse.search('react').forEach(item => {
128
+ console.log(` - ${item.item.name} (分数: ${item.score?.toFixed(3)}, stars: ${item.item.stars})`);
129
+ });
130
+ // 禁用排序
131
+ const noSortFuse = new fuse_js_1.default(items, {
132
+ keys: ['name'],
133
+ includeScore: true,
134
+ shouldSort: false
135
+ });
136
+ console.log('\n禁用排序,搜索 "react":');
137
+ noSortFuse.search('react').forEach(item => {
138
+ console.log(` - ${item.item.name} (分数: ${item.score?.toFixed(3)}, stars: ${item.item.stars})`);
139
+ });
140
+ }
141
+ // #endregion
142
+ // #region 示例5: includeMatches 匹配详情
143
+ function 匹配详情配置() {
144
+ console.log('\n=== 示例5: includeMatches 匹配详情 ===');
145
+ const books = [
146
+ {
147
+ title: 'JavaScript 权威指南',
148
+ author: 'David Flanagan'
149
+ },
150
+ {
151
+ title: 'TypeScript 编程',
152
+ author: 'Boris Cherny'
153
+ }
154
+ ];
155
+ const fuse = new fuse_js_1.default(books, {
156
+ keys: ['title', 'author'],
157
+ includeMatches: true, // 包含匹配详情
158
+ includeScore: true
159
+ });
160
+ const result = fuse.search('script');
161
+ console.log('搜索 "script" 的匹配详情:');
162
+ result.forEach(item => {
163
+ console.log(`\n 书名: ${item.item.title}`);
164
+ console.log(` 作者: ${item.item.author}`);
165
+ console.log(` 分数: ${item.score?.toFixed(3)}`);
166
+ if (item.matches) {
167
+ console.log(' 匹配位置:');
168
+ item.matches.forEach(match => {
169
+ console.log(` - 字段: ${match.key}`);
170
+ console.log(` 值: ${match.value}`);
171
+ if (match.indices) {
172
+ console.log(` 索引: ${JSON.stringify(match.indices)}`);
173
+ }
174
+ });
175
+ }
176
+ });
177
+ }
178
+ // #endregion
179
+ // #region 示例6: 完整配置示例
180
+ function 完整配置示例() {
181
+ console.log('\n=== 示例6: 完整配置示例 ===');
182
+ const products = [
183
+ {
184
+ id: 1,
185
+ name: 'iPhone 15 Pro Max',
186
+ category: 'smartphone',
187
+ brand: 'Apple',
188
+ price: 1199
189
+ },
190
+ {
191
+ id: 2,
192
+ name: 'MacBook Pro 16',
193
+ category: 'laptop',
194
+ brand: 'Apple',
195
+ price: 2499
196
+ },
197
+ {
198
+ id: 3,
199
+ name: 'iPad Pro',
200
+ category: 'tablet',
201
+ brand: 'Apple',
202
+ price: 799
203
+ }
204
+ ];
205
+ const options = {
206
+ // 基础配置
207
+ isCaseSensitive: false, // 不区分大小写
208
+ includeScore: true, // 包含分数
209
+ includeMatches: false, // 不包含匹配详情
210
+ // 匹配配置
211
+ minMatchCharLength: 2, // 最小匹配 2 个字符
212
+ shouldSort: true, // 按分数排序
213
+ // 模糊匹配配置
214
+ threshold: 0.4, // 中等严格度
215
+ location: 0, // 从开头开始
216
+ distance: 100, // 搜索距离
217
+ // 搜索字段配置
218
+ keys: [
219
+ { name: 'name', weight: 0.5 },
220
+ { name: 'category', weight: 0.3 },
221
+ { name: 'brand', weight: 0.2 }
222
+ ]
223
+ };
224
+ const fuse = new fuse_js_1.default(products, options);
225
+ console.log('配置说明:');
226
+ console.log(' - 不区分大小写');
227
+ console.log(' - 中等匹配严格度 (threshold: 0.4)');
228
+ console.log(' - 权重: name(50%), category(30%), brand(20%)');
229
+ const result = fuse.search('pro');
230
+ console.log('\n搜索 "pro" 的结果:');
231
+ result.forEach(item => {
232
+ console.log(` - ${item.item.name}`);
233
+ console.log(` 类别: ${item.item.category}, 品牌: ${item.item.brand}`);
234
+ console.log(` 价格: $${item.item.price}, 分数: ${item.score?.toFixed(3)}`);
235
+ });
236
+ }
237
+ // #endregion
238
+ // #region 主程序入口
239
+ if (require.main === module) {
240
+ const args = process.argv.slice(2);
241
+ const exampleNumber = args[0] ? parseInt(args[0]) : 0;
242
+ const examples = [
243
+ 阈值配置对比,
244
+ 位置距离配置,
245
+ 最小匹配长度,
246
+ 排序配置,
247
+ 匹配详情配置,
248
+ 完整配置示例
249
+ ];
250
+ if (exampleNumber > 0 && exampleNumber <= examples.length) {
251
+ console.log(`\n运行示例 ${exampleNumber}:`);
252
+ examples[exampleNumber - 1]();
253
+ }
254
+ else {
255
+ console.log('Fuse.js 配置详解示例\n');
256
+ console.log('运行所有示例...\n');
257
+ examples.forEach(example => example());
258
+ console.log('\n\n提示: 使用 ts-node src/demo/fuse/03-配置详解.ts [1-6] 运行指定示例');
259
+ }
260
+ }
261
+ // #endregion
@@ -0,0 +1,354 @@
1
+ "use strict";
2
+ /**
3
+ * Fuse.js 实战案例
4
+ * ================
5
+ * 通过实际应用场景展示 Fuse.js 的使用
6
+ *
7
+ * 官方文档: https://www.fusejs.io/
8
+ * 适用版本: fuse.js 7.x
9
+ */
10
+ var __importDefault = (this && this.__importDefault) || function (mod) {
11
+ return (mod && mod.__esModule) ? mod : { "default": mod };
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ const fuse_js_1 = __importDefault(require("fuse.js"));
15
+ // #region 示例1: 用户搜索系统
16
+ function 用户搜索系统() {
17
+ console.log('\n=== 示例1: 用户搜索系统 ===');
18
+ const users = [
19
+ {
20
+ id: 1,
21
+ username: 'john_doe',
22
+ email: 'john@example.com',
23
+ fullName: 'John Doe',
24
+ bio: 'Full-stack developer specializing in React and Node.js',
25
+ tags: ['javascript', 'react', 'nodejs']
26
+ },
27
+ {
28
+ id: 2,
29
+ username: 'jane_smith',
30
+ email: 'jane@example.com',
31
+ fullName: 'Jane Smith',
32
+ bio: 'Frontend developer passionate about TypeScript and Vue',
33
+ tags: ['typescript', 'vue', 'css']
34
+ },
35
+ {
36
+ id: 3,
37
+ username: 'bob_wilson',
38
+ email: 'bob@example.com',
39
+ fullName: 'Bob Wilson',
40
+ bio: 'Backend engineer working with Python and Django',
41
+ tags: ['python', 'django', 'postgresql']
42
+ }
43
+ ];
44
+ const fuse = new fuse_js_1.default(users, {
45
+ keys: [
46
+ { name: 'username', weight: 0.3 },
47
+ { name: 'fullName', weight: 0.3 },
48
+ { name: 'email', weight: 0.1 },
49
+ { name: 'bio', weight: 0.2 },
50
+ { name: 'tags', weight: 0.1 }
51
+ ],
52
+ threshold: 0.4,
53
+ includeScore: true
54
+ });
55
+ const searchQuery = 'typescript';
56
+ console.log(`搜索用户: "${searchQuery}"\n`);
57
+ const results = fuse.search(searchQuery);
58
+ if (results.length === 0) {
59
+ console.log('未找到匹配的用户');
60
+ }
61
+ else {
62
+ results.forEach((result, index) => {
63
+ const user = result.item;
64
+ console.log(`${index + 1}. ${user.fullName} (@${user.username})`);
65
+ console.log(` 邮箱: ${user.email}`);
66
+ console.log(` 简介: ${user.bio}`);
67
+ console.log(` 标签: ${user.tags.join(', ')}`);
68
+ console.log(` 匹配度: ${((1 - (result.score || 0)) * 100).toFixed(1)}%\n`);
69
+ });
70
+ }
71
+ }
72
+ // #endregion
73
+ // #region 示例2: 商品搜索与过滤
74
+ function 商品搜索与过滤() {
75
+ console.log('\n=== 示例2: 商品搜索与过滤 ===');
76
+ const products = [
77
+ {
78
+ id: 1,
79
+ name: 'iPhone 15 Pro',
80
+ category: 'smartphone',
81
+ brand: 'Apple',
82
+ price: 999,
83
+ description: '最新款 iPhone,配备 A17 Pro 芯片',
84
+ inStock: true
85
+ },
86
+ {
87
+ id: 2,
88
+ name: 'Samsung Galaxy S24',
89
+ category: 'smartphone',
90
+ brand: 'Samsung',
91
+ price: 899,
92
+ description: '旗舰安卓手机,强大的拍照功能',
93
+ inStock: true
94
+ },
95
+ {
96
+ id: 3,
97
+ name: 'MacBook Pro 16',
98
+ category: 'laptop',
99
+ brand: 'Apple',
100
+ price: 2499,
101
+ description: '专业级笔记本电脑,M3 Max 芯片',
102
+ inStock: false
103
+ },
104
+ {
105
+ id: 4,
106
+ name: 'iPad Pro 12.9',
107
+ category: 'tablet',
108
+ brand: 'Apple',
109
+ price: 1099,
110
+ description: '大屏平板电脑,支持 Apple Pencil',
111
+ inStock: true
112
+ }
113
+ ];
114
+ // 创建搜索实例
115
+ const fuse = new fuse_js_1.default(products, {
116
+ keys: [
117
+ { name: 'name', weight: 0.4 },
118
+ { name: 'brand', weight: 0.2 },
119
+ { name: 'category', weight: 0.2 },
120
+ { name: 'description', weight: 0.2 }
121
+ ],
122
+ threshold: 0.3,
123
+ includeScore: true
124
+ });
125
+ // 搜索功能
126
+ function searchProducts(query, filters) {
127
+ let results = fuse.search(query);
128
+ // 应用过滤器
129
+ if (filters) {
130
+ results = results.filter(result => {
131
+ const product = result.item;
132
+ if (filters.inStock !== undefined && product.inStock !== filters.inStock) {
133
+ return false;
134
+ }
135
+ if (filters.maxPrice !== undefined && product.price > filters.maxPrice) {
136
+ return false;
137
+ }
138
+ return true;
139
+ });
140
+ }
141
+ return results;
142
+ }
143
+ // 示例搜索
144
+ console.log('搜索 "pro" 且价格 <= 1500 的商品:\n');
145
+ const results = searchProducts('pro', { maxPrice: 1500 });
146
+ results.forEach((result, index) => {
147
+ const product = result.item;
148
+ console.log(`${index + 1}. ${product.name} - $${product.price}`);
149
+ console.log(` 品牌: ${product.brand} | 类别: ${product.category}`);
150
+ console.log(` 库存: ${product.inStock ? '有货' : '缺货'}`);
151
+ console.log(` ${product.description}\n`);
152
+ });
153
+ }
154
+ // #endregion
155
+ // #region 示例3: 文档搜索引擎
156
+ function 文档搜索引擎() {
157
+ console.log('\n=== 示例3: 文档搜索引擎 ===');
158
+ const documents = [
159
+ {
160
+ id: 'doc1',
161
+ title: 'TypeScript 入门指南',
162
+ content: 'TypeScript 是 JavaScript 的超集,添加了静态类型系统。它可以帮助开发者在编译时发现错误。',
163
+ category: '教程',
164
+ tags: ['typescript', 'javascript', '入门'],
165
+ lastUpdated: '2024-01-15'
166
+ },
167
+ {
168
+ id: 'doc2',
169
+ title: 'React Hooks 最佳实践',
170
+ content: 'React Hooks 是 React 16.8 引入的新特性,让你在不编写 class 的情况下使用 state 和其他 React 特性。',
171
+ category: '最佳实践',
172
+ tags: ['react', 'hooks', 'javascript'],
173
+ lastUpdated: '2024-02-20'
174
+ },
175
+ {
176
+ id: 'doc3',
177
+ title: 'Node.js 性能优化',
178
+ content: '本文介绍 Node.js 应用的性能优化技巧,包括异步编程、缓存策略和数据库优化。',
179
+ category: '性能优化',
180
+ tags: ['nodejs', 'performance', 'optimization'],
181
+ lastUpdated: '2024-03-10'
182
+ }
183
+ ];
184
+ const fuse = new fuse_js_1.default(documents, {
185
+ keys: [
186
+ { name: 'title', weight: 0.5 },
187
+ { name: 'content', weight: 0.3 },
188
+ { name: 'tags', weight: 0.2 }
189
+ ],
190
+ threshold: 0.4,
191
+ includeScore: true,
192
+ includeMatches: true,
193
+ minMatchCharLength: 2
194
+ });
195
+ function searchDocuments(query) {
196
+ const results = fuse.search(query);
197
+ console.log(`搜索 "${query}" 找到 ${results.length} 个结果:\n`);
198
+ results.forEach((result, index) => {
199
+ const doc = result.item;
200
+ console.log(`${index + 1}. ${doc.title}`);
201
+ console.log(` 类别: ${doc.category} | 更新: ${doc.lastUpdated}`);
202
+ console.log(` 标签: ${doc.tags.join(', ')}`);
203
+ console.log(` 相关度: ${((1 - (result.score || 0)) * 100).toFixed(1)}%`);
204
+ // 显示内容摘要
205
+ const preview = doc.content.substring(0, 60) + '...';
206
+ console.log(` ${preview}\n`);
207
+ });
208
+ }
209
+ searchDocuments('react');
210
+ }
211
+ // #endregion
212
+ // #region 示例4: 命令行工具搜索
213
+ function 命令行工具搜索() {
214
+ console.log('\n=== 示例4: 命令行工具搜索 ===');
215
+ const commands = [
216
+ {
217
+ name: 'git commit',
218
+ description: '记录更改到仓库',
219
+ usage: 'git commit -m "message"',
220
+ aliases: ['commit', 'ci'],
221
+ category: 'git'
222
+ },
223
+ {
224
+ name: 'git push',
225
+ description: '推送本地更改到远程仓库',
226
+ usage: 'git push origin main',
227
+ aliases: ['push'],
228
+ category: 'git'
229
+ },
230
+ {
231
+ name: 'npm install',
232
+ description: '安装项目依赖',
233
+ usage: 'npm install [package]',
234
+ aliases: ['npm i', 'install'],
235
+ category: 'npm'
236
+ },
237
+ {
238
+ name: 'npm run',
239
+ description: '运行 package.json 中定义的脚本',
240
+ usage: 'npm run [script]',
241
+ aliases: ['run'],
242
+ category: 'npm'
243
+ }
244
+ ];
245
+ const fuse = new fuse_js_1.default(commands, {
246
+ keys: [
247
+ { name: 'name', weight: 0.4 },
248
+ { name: 'description', weight: 0.3 },
249
+ { name: 'aliases', weight: 0.3 }
250
+ ],
251
+ threshold: 0.3,
252
+ useExtendedSearch: true
253
+ });
254
+ function findCommand(query) {
255
+ const results = fuse.search(query);
256
+ if (results.length === 0) {
257
+ console.log(`未找到命令: "${query}"`);
258
+ return;
259
+ }
260
+ console.log(`搜索 "${query}" 的命令:\n`);
261
+ results.forEach((result, index) => {
262
+ const cmd = result.item;
263
+ console.log(`${index + 1}. ${cmd.name}`);
264
+ console.log(` ${cmd.description}`);
265
+ console.log(` 用法: ${cmd.usage}`);
266
+ if (cmd.aliases.length > 0) {
267
+ console.log(` 别名: ${cmd.aliases.join(', ')}`);
268
+ }
269
+ console.log();
270
+ });
271
+ }
272
+ findCommand('install');
273
+ }
274
+ // #endregion
275
+ // #region 示例5: 智能联系人搜索
276
+ function 智能联系人搜索() {
277
+ console.log('\n=== 示例5: 智能联系人搜索 ===');
278
+ const contacts = [
279
+ {
280
+ id: 1,
281
+ name: '张伟',
282
+ phone: '13800138000',
283
+ email: 'zhangwei@company.com',
284
+ company: '阿里巴巴',
285
+ notes: '技术总监,负责云计算业务'
286
+ },
287
+ {
288
+ id: 2,
289
+ name: '李娜',
290
+ phone: '13900139000',
291
+ email: 'lina@tech.com',
292
+ company: '腾讯',
293
+ notes: '产品经理,微信团队'
294
+ },
295
+ {
296
+ id: 3,
297
+ name: '王强',
298
+ phone: '13700137000',
299
+ email: 'wangqiang@startup.com',
300
+ company: '字节跳动',
301
+ notes: '前端工程师,抖音部门'
302
+ }
303
+ ];
304
+ const fuse = new fuse_js_1.default(contacts, {
305
+ keys: [
306
+ { name: 'name', weight: 0.4 },
307
+ { name: 'company', weight: 0.3 },
308
+ { name: 'notes', weight: 0.2 },
309
+ { name: 'email', weight: 0.1 }
310
+ ],
311
+ threshold: 0.4,
312
+ includeScore: true
313
+ });
314
+ function searchContacts(query) {
315
+ const results = fuse.search(query);
316
+ console.log(`搜索联系人: "${query}"\n`);
317
+ if (results.length === 0) {
318
+ console.log('未找到匹配的联系人');
319
+ return;
320
+ }
321
+ results.forEach((result, index) => {
322
+ const contact = result.item;
323
+ console.log(`${index + 1}. ${contact.name} - ${contact.company}`);
324
+ console.log(` 电话: ${contact.phone}`);
325
+ console.log(` 邮箱: ${contact.email}`);
326
+ console.log(` 备注: ${contact.notes}\n`);
327
+ });
328
+ }
329
+ searchContacts('腾讯');
330
+ }
331
+ // #endregion
332
+ // #region 主程序入口
333
+ if (require.main === module) {
334
+ const args = process.argv.slice(2);
335
+ const exampleNumber = args[0] ? parseInt(args[0]) : 0;
336
+ const examples = [
337
+ 用户搜索系统,
338
+ 商品搜索与过滤,
339
+ 文档搜索引擎,
340
+ 命令行工具搜索,
341
+ 智能联系人搜索
342
+ ];
343
+ if (exampleNumber > 0 && exampleNumber <= examples.length) {
344
+ console.log(`\n运行示例 ${exampleNumber}:`);
345
+ examples[exampleNumber - 1]();
346
+ }
347
+ else {
348
+ console.log('Fuse.js 实战案例示例\n');
349
+ console.log('运行所有示例...\n');
350
+ examples.forEach(example => example());
351
+ console.log('\n\n提示: 使用 ts-node src/demo/fuse/04-实战案例.ts [1-5] 运行指定示例');
352
+ }
353
+ }
354
+ // #endregion
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.1.4",
6
+ "version": "1.1.5",
7
7
  "description": "一个nodejs学习工具",
8
8
  "bin": {
9
9
  "nlearn": "dist/src/cli/index.js",