Debug Modern JavaScript with VSCode. Part of VSCode Course.
npm init -y| async function createUser(userData: any): Promise<Document> { | |
| const user = plainToClass(User, userData, { excludeExtraneousValues: true }); | |
| const errors = await validate(user); | |
| if (errors.length > 0) { | |
| throw new Error(`Validation failed: ${JSON.stringify(errors)}`); | |
| } | |
| const createdUser = await model('User').create(user); |
| <?xml version="1.0"?> | |
| <document type="freeswitch/xml"> | |
| <X-PRE-PROCESS cmd="set" data="local_address=$${local_ip_v4}"/> | |
| <X-PRE-PROCESS cmd="set" data="sipnet_proxy=sipnet.ru"/> | |
| <X-PRE-PROCESS cmd="set" data="sipnet_login=..."/> | |
| <X-PRE-PROCESS cmd="set" data="sipnet_password=..."/> | |
| <X-PRE-PROCESS cmd="set" data="sound_prefix=$${sounds_dir}/en/us/callie"/> |
Debug Modern JavaScript with VSCode. Part of VSCode Course.
npm init -y| Index: src/app/interceptor/in-memory-data.spec.ts | |
| IDEA additional info: | |
| Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
| <+>UTF-8 | |
| =================================================================== | |
| --- src/app/interceptor/in-memory-data.spec.ts (revision 7e638c32329b38126ad578cb9fb0b68c86df4a76) | |
| +++ src/app/interceptor/in-memory-data.spec.ts (revision 7e638c32329b38126ad578cb9fb0b68c86df4a76) | |
| @@ -0,0 +1,40 @@ | |
| +import {HTTP_INTERCEPTORS, HttpClient, HttpParams} from '@angular/common/http'; | |
| +import {HttpClientTestingModule} from '@angular/common/http/testing'; |
| module.exports = { | |
| mode: 'development', | |
| module: { | |
| rules: [ | |
| { | |
| test: /\.js$/, | |
| exclude: /node_modules/, | |
| use: { | |
| loader: 'babel-loader', | |
| options: { |
| volumes: | |
| web_app: | |
| driver: local | |
| driver_opts: | |
| type: none | |
| device: $PWD/${WEB_APP_PATH} | |
| o: bind |
| async function getListBridge(config) { | |
| const client = new AmiClient(); | |
| await client.connect(config.login, config.password, {host: 'localhost', port: 5038}); | |
| let bridgeList = []; | |
| return new Promise((resolve, reject) => { | |
| // Start. | |
| client.on('resp_Bridge_List_A', data => { | |
| bridgeList = []; | |
| }); |
| const net = require('net'); | |
| const lib = require('./lib'); | |
| const server = net.createServer(); | |
| server.on('connection', async socket => { | |
| const variables = await lib.dataAwaiting(socket); | |
| console.log('variables', variables.toString()); | |
| const data1= await lib.request(socket, Buffer.from('ANSWER\n')); | |
| const data2 = await lib.request(socket, Buffer.from('SAY DIGITS 321 X\n')); | |
| const data3 = await lib.request(socket, Buffer.from('Hangup\n')); |
| import { | |
| ChangeDetectionStrategy, | |
| ChangeDetectorRef, | |
| Component, ComponentFactoryResolver, ComponentRef, | |
| Directive, ElementRef, Host, Inject, | |
| InjectionToken, | |
| Input, OnDestroy, OnInit, Optional, ViewContainerRef | |
| } from '@angular/core'; | |
| import {NgControl} from '@angular/forms'; | |
| import {EMPTY, fromEvent, merge, Observable} from 'rxjs'; |
| @injectable() | |
| export class MigrationManagerContainer implements IMigrationManagerContainer { | |
| @inject(ContainerType.CurrentVersion) | |
| private currentVersionContainer: ICurrentVersionContainer; | |
| @multiInject(ContainerType.Migration) | |
| private migrations: MigrationContainerBase[]; | |
| public getMigrations() { |