fix(all): Formatting code and unit test.
This commit is contained in:
		
							parent
							
								
									faa21438fa
								
							
						
					
					
						commit
						dcf20934cb
					
				
					 69 changed files with 235 additions and 224 deletions
				
			
		| 
						 | 
					@ -1,11 +1,9 @@
 | 
				
			||||||
/*****************************************************************************\
 | 
					/*****************************************************************************\
 | 
				
			||||||
|                                               ( )_  _                       |
 | 
					|  █████  █████ ██    █ █████ █████   ████  ██      ████   █████ █████  ███ ® |
 | 
				
			||||||
|    _ _    _ __   _ _    __    ___ ___     _ _ | ,_)(_)  ___   ___     _     |
 | 
					| ██      █     ███   █ █     ██  ██ ██  ██ ██      ██  █ ██   ██  █   █      |
 | 
				
			||||||
|   ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| |  | |/',__)/' v `\ /'_`\   |
 | 
					| ██  ███ ████  █ ██  █ ████  █████  ██████ ██      ████   █   █   █    ██    |
 | 
				
			||||||
|   | (_) )| |  ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__,\| (˅) |( (_) )  |
 | 
					| ██   ██ █     █  ██ █ █     ██  ██ ██  ██ ██      ██  █ ██   ██  █      █   |
 | 
				
			||||||
|   | ,__/'(_)  `\__,_)`\__  |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_)`\___/'  |
 | 
					|  █████  █████ █   ███ █████ ██  ██ ██  ██ █████   ████   █████   █   ███    |
 | 
				
			||||||
|   | |                ( )_) |                                                |
 | 
					 | 
				
			||||||
|   (_)                 \___/'                                                |
 | 
					 | 
				
			||||||
|                                                                             |
 | 
					|                                                                             |
 | 
				
			||||||
| General Bots Copyright (c) pragmatismo.cloud. All rights reserved.          |
 | 
					| General Bots Copyright (c) pragmatismo.cloud. All rights reserved.          |
 | 
				
			||||||
| Licensed under the AGPL-3.0.                                                |
 | 
					| Licensed under the AGPL-3.0.                                                |
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,11 +1,9 @@
 | 
				
			||||||
/*****************************************************************************\
 | 
					/*****************************************************************************\
 | 
				
			||||||
|                                               ( )_  _                       |
 | 
					|  █████  █████ ██    █ █████ █████   ████  ██      ████   █████ █████  ███ ® |
 | 
				
			||||||
|    _ _    _ __   _ _    __    ___ ___     _ _ | ,_)(_)  ___   ___     _     |
 | 
					| ██      █     ███   █ █     ██  ██ ██  ██ ██      ██  █ ██   ██  █   █      |
 | 
				
			||||||
|   ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| |  | |/',__)/' v `\ /'_`\   |
 | 
					| ██  ███ ████  █ ██  █ ████  █████  ██████ ██      ████   █   █   █    ██    |
 | 
				
			||||||
|   | (_) )| |  ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__,\| (˅) |( (_) )  |
 | 
					| ██   ██ █     █  ██ █ █     ██  ██ ██  ██ ██      ██  █ ██   ██  █      █   |
 | 
				
			||||||
|   | ,__/'(_)  `\__,_)`\__  |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_)`\___/'  |
 | 
					|  █████  █████ █   ███ █████ ██  ██ ██  ██ █████   ████   █████   █   ███    |
 | 
				
			||||||
|   | |                ( )_) |                                                |
 | 
					 | 
				
			||||||
|   (_)                 \___/'                                                |
 | 
					 | 
				
			||||||
|                                                                             |
 | 
					|                                                                             |
 | 
				
			||||||
| General Bots Copyright (c) pragmatismo.cloud. All rights reserved.          |
 | 
					| General Bots Copyright (c) pragmatismo.cloud. All rights reserved.          |
 | 
				
			||||||
| Licensed under the AGPL-3.0.                                                |
 | 
					| Licensed under the AGPL-3.0.                                                |
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,3 +17,27 @@ test('Default', () => {
 | 
				
			||||||
    expect(args.length).toBe(5);
 | 
					    expect(args.length).toBe(5);
 | 
				
			||||||
   
 | 
					   
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test('Compare', () => {
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					    expect(GBVMService.compare(1,1)).toBeTruthy();
 | 
				
			||||||
 | 
					    expect(GBVMService.compare({a:1},{a:1})).toBeTruthy();
 | 
				
			||||||
 | 
					    expect(GBVMService.compare({a:1},{a:2})).toBeFalsy();
 | 
				
			||||||
 | 
					    expect(GBVMService.compare({a:1, b:2},{a:1, b:2})).toBeTruthy();
 | 
				
			||||||
 | 
					   
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test('Parse Storage Field', async () => {
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    const s = new GBVMService();
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    expect(await s.parseField('name STRING(30)')).toStrictEqual({name: 'name', definition: {
 | 
				
			||||||
 | 
					        allowNull: true,
 | 
				
			||||||
 | 
					        unique: false, primaryKey: false,
 | 
				
			||||||
 | 
					        size: 30,
 | 
				
			||||||
 | 
					        autoIncrement: false,
 | 
				
			||||||
 | 
					        type:"STRING"
 | 
				
			||||||
 | 
					      }});      
 | 
				
			||||||
 | 
					   
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -756,6 +756,7 @@ export class GBVMService extends GBService {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return results;
 | 
					    return results;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
  private async getTextFromWord(folder: string, filename: string) {
 | 
					  private async getTextFromWord(folder: string, filename: string) {
 | 
				
			||||||
    return new Promise<string>(async (resolve, reject) => {
 | 
					    return new Promise<string>(async (resolve, reject) => {
 | 
				
			||||||
      const path = urlJoin(folder, filename);
 | 
					      const path = urlJoin(folder, filename);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,11 +1,9 @@
 | 
				
			||||||
/*****************************************************************************\
 | 
					/*****************************************************************************\
 | 
				
			||||||
|                                               ( )_  _                       |
 | 
					|  █████  █████ ██    █ █████ █████   ████  ██      ████   █████ █████  ███ ® |
 | 
				
			||||||
|    _ _    _ __   _ _    __    ___ ___     _ _ | ,_)(_)  ___   ___     _     |
 | 
					| ██      █     ███   █ █     ██  ██ ██  ██ ██      ██  █ ██   ██  █   █      |
 | 
				
			||||||
|   ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| |  | |/',__)/' v `\ /'_`\   |
 | 
					| ██  ███ ████  █ ██  █ ████  █████  ██████ ██      ████   █   █   █    ██    |
 | 
				
			||||||
|   | (_) )| |  ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__,\| (˅) |( (_) )  |
 | 
					| ██   ██ █     █  ██ █ █     ██  ██ ██  ██ ██      ██  █ ██   ██  █      █   |
 | 
				
			||||||
|   | ,__/'(_)  `\__,_)`\__  |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_)`\___/'  |
 | 
					|  █████  █████ █   ███ █████ ██  ██ ██  ██ █████   ████   █████   █   ███    |
 | 
				
			||||||
|   | |                ( )_) |                                                |
 | 
					 | 
				
			||||||
|   (_)                 \___/'                                                |
 | 
					 | 
				
			||||||
|                                                                             |
 | 
					|                                                                             |
 | 
				
			||||||
| General Bots Copyright (c) pragmatismo.cloud. All rights reserved.          |
 | 
					| General Bots Copyright (c) pragmatismo.cloud. All rights reserved.          |
 | 
				
			||||||
| Licensed under the AGPL-3.0.                                                |
 | 
					| Licensed under the AGPL-3.0.                                                |
 | 
				
			||||||
| 
						 | 
					@ -35,7 +33,6 @@
 | 
				
			||||||
import Path from 'path';
 | 
					import Path from 'path';
 | 
				
			||||||
import { GBLog, GBMinInstance } from 'botlib';
 | 
					import { GBLog, GBMinInstance } from 'botlib';
 | 
				
			||||||
import { DialogKeywords } from './DialogKeywords.js';
 | 
					import { DialogKeywords } from './DialogKeywords.js';
 | 
				
			||||||
import sharp from 'sharp';
 | 
					 | 
				
			||||||
import joinImages from 'join-images-updated';
 | 
					import joinImages from 'join-images-updated';
 | 
				
			||||||
import { CollectionUtil } from 'pragmatismo-io-framework';
 | 
					import { CollectionUtil } from 'pragmatismo-io-framework';
 | 
				
			||||||
import { GBAdminService } from '../../admin.gbapp/services/GBAdminService.js';
 | 
					import { GBAdminService } from '../../admin.gbapp/services/GBAdminService.js';
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,11 +1,9 @@
 | 
				
			||||||
/*****************************************************************************\
 | 
					/*****************************************************************************\
 | 
				
			||||||
|                                               ( )_  _                       |
 | 
					|  █████  █████ ██    █ █████ █████   ████  ██      ████   █████ █████  ███ ® |
 | 
				
			||||||
|    _ _    _ __   _ _    __    __ __     _ _ | ,_)(_)  __   __     _     |
 | 
					| ██      █     ███   █ █     ██  ██ ██  ██ ██      ██  █ ██   ██  █   █      |
 | 
				
			||||||
|   ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| |  | |/',__)/' v `\ /'_`\   |
 | 
					| ██  ███ ████  █ ██  █ ████  █████  ██████ ██      ████   █   █   █    ██    |
 | 
				
			||||||
|   | (_) )| |  ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__,\| (˅) |( (_) )  |
 | 
					| ██   ██ █     █  ██ █ █     ██  ██ ██  ██ ██      ██  █ ██   ██  █      █   |
 | 
				
			||||||
|   | ,__/'(_)  `\__,_)`\__  |(_) (_) (_)`\__,_)`\__)(_)(___/(_) (_)`\__/'  |
 | 
					|  █████  █████ █   ███ █████ ██  ██ ██  ██ █████   ████   █████   █   ███    |
 | 
				
			||||||
|   | |                ( )_) |                                                |
 | 
					 | 
				
			||||||
|   (_)                 \__/'                                                |
 | 
					 | 
				
			||||||
|                                                                             |
 | 
					|                                                                             |
 | 
				
			||||||
| General Bots Copyright (c) pragmatismo.cloud. All rights reserved.          |
 | 
					| General Bots Copyright (c) pragmatismo.cloud. All rights reserved.          |
 | 
				
			||||||
| Licensed under the AGPL-3.0.                                                |
 | 
					| Licensed under the AGPL-3.0.                                                |
 | 
				
			||||||
| 
						 | 
					@ -30,6 +28,7 @@
 | 
				
			||||||
|                                                                             |
 | 
					|                                                                             |
 | 
				
			||||||
\*****************************************************************************/
 | 
					\*****************************************************************************/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
'use strict';
 | 
					'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import { GBAdminService } from '../../admin.gbapp/services/GBAdminService.js';
 | 
					import { GBAdminService } from '../../admin.gbapp/services/GBAdminService.js';
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,11 +1,9 @@
 | 
				
			||||||
/*****************************************************************************\
 | 
					/*****************************************************************************\
 | 
				
			||||||
|                                               ( )_  _                       |
 | 
					|  █████  █████ ██    █ █████ █████   ████  ██      ████   █████ █████  ███ ® |
 | 
				
			||||||
|    _ _    _ __   _ _    __    ___ ___     _ _ | ,_)(_)  ___   ___     _     |
 | 
					| ██      █     ███   █ █     ██  ██ ██  ██ ██      ██  █ ██   ██  █   █      |
 | 
				
			||||||
|   ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| |  | |/',__)/' v `\ /'_`\   |
 | 
					| ██  ███ ████  █ ██  █ ████  █████  ██████ ██      ████   █   █   █    ██    |
 | 
				
			||||||
|   | (_) )| |  ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__,\| (˅) |( (_) )  |
 | 
					| ██   ██ █     █  ██ █ █     ██  ██ ██  ██ ██      ██  █ ██   ██  █      █   |
 | 
				
			||||||
|   | ,__/'(_)  `\__,_)`\__  |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_)`\___/'  |
 | 
					|  █████  █████ █   ███ █████ ██  ██ ██  ██ █████   ████   █████   █   ███    |
 | 
				
			||||||
|   | |                ( )_) |                                                |
 | 
					 | 
				
			||||||
|   (_)                 \___/'                                                |
 | 
					 | 
				
			||||||
|                                                                             |
 | 
					|                                                                             |
 | 
				
			||||||
| General Bots Copyright (c) pragmatismo.cloud. All rights reserved.          |
 | 
					| General Bots Copyright (c) pragmatismo.cloud. All rights reserved.          |
 | 
				
			||||||
| Licensed under the AGPL-3.0.                                                |
 | 
					| Licensed under the AGPL-3.0.                                                |
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,11 +1,9 @@
 | 
				
			||||||
/*****************************************************************************\
 | 
					/*****************************************************************************\
 | 
				
			||||||
|                                               ( )_  _                       |
 | 
					|  █████  █████ ██    █ █████ █████   ████  ██      ████   █████ █████  ███ ® |
 | 
				
			||||||
|    _ _    _ __   _ _    __    ___ ___     _ _ | ,_)(_)  ___  _   _    _     |
 | 
					| ██      █     ███   █ █     ██  ██ ██  ██ ██      ██  █ ██   ██  █   █      |
 | 
				
			||||||
|   ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| |  | |/',__)/ \ /`\ /'_`\   |
 | 
					| ██  ███ ████  █ ██  █ ████  █████  ██████ ██      ████   █   █   █    ██    |
 | 
				
			||||||
|   | (_) )| |  ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__, \| |*| |( (_) )  |
 | 
					| ██   ██ █     █  ██ █ █     ██  ██ ██  ██ ██      ██  █ ██   ██  █      █   |
 | 
				
			||||||
|   | ,__/'(_)  `\__,_)`\__  |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_)`\___/'  |
 | 
					|  █████  █████ █   ███ █████ ██  ██ ██  ██ █████   ████   █████   █   ███    |
 | 
				
			||||||
|   | |                ( )_) |                                                |
 | 
					 | 
				
			||||||
|   (_)                 \___/'                                                |
 | 
					 | 
				
			||||||
|                                                                             |
 | 
					|                                                                             |
 | 
				
			||||||
| General Bots Copyright (c) pragmatismo.cloud. All rights reserved.          |
 | 
					| General Bots Copyright (c) pragmatismo.cloud. All rights reserved.          |
 | 
				
			||||||
| Licensed under the AGPL-3.0.                                                |
 | 
					| Licensed under the AGPL-3.0.                                                |
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,11 +1,10 @@
 | 
				
			||||||
<!--
 | 
					<!--
 | 
				
			||||||
|                                               ( )_  _                       |
 | 
					/*****************************************************************************\
 | 
				
			||||||
|    _ _    _ __   _ _    __    ___ ___     _ _ | ,_)(_)  ___   ___     _     |
 | 
					|  █████  █████ ██    █ █████ █████   ████  ██      ████   █████ █████  ███ ® |
 | 
				
			||||||
|   ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| |  | |/',__)/' v `\ /'_`\   |
 | 
					| ██      █     ███   █ █     ██  ██ ██  ██ ██      ██  █ ██   ██  █   █      |
 | 
				
			||||||
|   | (_) )| |  ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__, \| (˅) |( (_) )  |
 | 
					| ██  ███ ████  █ ██  █ ████  █████  ██████ ██      ████   █   █   █    ██    |
 | 
				
			||||||
|   | ,__/'(_)  `\__,_)`\__  |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_)`\___/'  |
 | 
					| ██   ██ █     █  ██ █ █     ██  ██ ██  ██ ██      ██  █ ██   ██  █      █   |
 | 
				
			||||||
|   | |                ( )_) |                                                |
 | 
					|  █████  █████ █   ███ █████ ██  ██ ██  ██ █████   ████   █████   █   ███    |
 | 
				
			||||||
|   (_)                 \___/'                                                |
 | 
					 | 
				
			||||||
|                                                                             |
 | 
					|                                                                             |
 | 
				
			||||||
| General Bots Copyright (c) pragmatismo.cloud. All rights reserved.          |
 | 
					| General Bots Copyright (c) pragmatismo.cloud. All rights reserved.          |
 | 
				
			||||||
| Licensed under the AGPL-3.0.                                                |
 | 
					| Licensed under the AGPL-3.0.                                                |
 | 
				
			||||||
| 
						 | 
					@ -19,7 +18,7 @@
 | 
				
			||||||
| in the LICENSE file you have received along with this program.              |
 | 
					| in the LICENSE file you have received along with this program.              |
 | 
				
			||||||
|                                                                             |
 | 
					|                                                                             |
 | 
				
			||||||
| This program is distributed in the hope that it will be useful,             |
 | 
					| This program is distributed in the hope that it will be useful,             |
 | 
				
			||||||
| but WITHOUT ANY WARRANTY; without even the implied warranty of              |
 | 
					| but WITHOUT ANY WARRANTY, without even the implied warranty of              |
 | 
				
			||||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the                |
 | 
					| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the                |
 | 
				
			||||||
| GNU Affero General Public License for more details.                         |
 | 
					| GNU Affero General Public License for more details.                         |
 | 
				
			||||||
|                                                                             |
 | 
					|                                                                             |
 | 
				
			||||||
| 
						 | 
					@ -28,6 +27,7 @@
 | 
				
			||||||
| trademark license. Therefore any rights, title and interest in              |
 | 
					| trademark license. Therefore any rights, title and interest in              |
 | 
				
			||||||
| our trademarks remain entirely with us.                                     |
 | 
					| our trademarks remain entirely with us.                                     |
 | 
				
			||||||
|                                                                             |
 | 
					|                                                                             |
 | 
				
			||||||
 | 
					\*****************************************************************************/
 | 
				
			||||||
-->
 | 
					-->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<!doctype html>
 | 
					<!doctype html>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,11 +1,9 @@
 | 
				
			||||||
/*****************************************************************************\
 | 
					/*****************************************************************************\
 | 
				
			||||||
|                                               ( )_  _                       |
 | 
					|  █████  █████ ██    █ █████ █████   ████  ██      ████   █████ █████  ███ ® |
 | 
				
			||||||
|    _ _    _ __   _ _    __    ___ ___     _ _ | ,_)(_)  ___   ___     _     |
 | 
					| ██      █     ███   █ █     ██  ██ ██  ██ ██      ██  █ ██   ██  █   █      |
 | 
				
			||||||
|   ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| |  | |/',__)/' v `\ /'_`\   |
 | 
					| ██  ███ ████  █ ██  █ ████  █████  ██████ ██      ████   █   █   █    ██    |
 | 
				
			||||||
|   | (_) )| |  ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__,\| (˅) |( (_) )  |
 | 
					| ██   ██ █     █  ██ █ █     ██  ██ ██  ██ ██      ██  █ ██   ██  █      █   |
 | 
				
			||||||
|   | ,__/'(_)  `\__,_)`\__  |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_)`\___/'  |
 | 
					|  █████  █████ █   ███ █████ ██  ██ ██  ██ █████   ████   █████   █   ███    |
 | 
				
			||||||
|   | |                ( )_) |                                                |
 | 
					 | 
				
			||||||
|   (_)                 \___/'                                                |
 | 
					 | 
				
			||||||
|                                                                             |
 | 
					|                                                                             |
 | 
				
			||||||
| General Bots Copyright (c) pragmatismo.cloud. All rights reserved.          |
 | 
					| General Bots Copyright (c) pragmatismo.cloud. All rights reserved.          |
 | 
				
			||||||
| Licensed under the AGPL-3.0.                                                |
 | 
					| Licensed under the AGPL-3.0.                                                |
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue