Scaleway images may not be able to upgrade due to changes in the packages format, you will need to install pacman-static (resources here and here)
cd /tmp/| import { AbstractControl, ValidationErrors } from '@angular/forms'; | |
| const luhnArr = [0, 2, 4, 6, 8, 1, 3, 5, 7, 9]; | |
| // https://portal.hardis-group.com/pages/viewpage.action?pageId=120357227 | |
| export function checkSIRET(control: AbstractControl): ValidationErrors { | |
| if (!control.value) { | |
| return null; | |
| } |
| { | |
| "tabWidth": 2, | |
| "useTabs": false, | |
| "singleQuote": true, | |
| "trailingComma": "none", | |
| "endOfLine": "lf", | |
| "arrowParens": "always", | |
| "printWidth": 120 | |
| } |
| import { Injectable } from '@angular/core'; | |
| import { Observable } from 'rxjs'; | |
| import { Router, ActivatedRoute, Event, NavigationEnd } from '@angular/router'; | |
| import { filter, map, mergeMap, shareReplay } from 'rxjs/operators'; | |
| import { IRouteData } from '~/app/interfaces/route-data'; | |
| @Injectable({ providedIn: 'root' }) | |
| export class RouterDataService { | |
| public readonly data$: Observable<IRouteData>; |
| import { Observable, merge, mergeMap, shareReplay } from 'rxjs'; | |
| interface ICacheElement<T> { | |
| res$: Observable<T>; | |
| exp: number; | |
| } | |
| const DEFAULT_KEY = Symbol('default_cache_key'); | |
| type CacheKey = string | number | symbol; |
| import { HttpClient } from '@angular/common/http'; | |
| import { Resolve, ActivatedRouteSnapshot } from '@angular/router'; | |
| import { first, Observable } from 'rxjs'; | |
| export abstract class CRUDService<T, C, U extends { id: string }> implements Resolve<T> { | |
| constructor(protected http: HttpClient, protected base: string) { | |
| console.log(`Instantiating ${this.base.slice(0, -1)} service`); | |
| } | |
| public findAll(): Observable<T[]> { |
| enum LEVELS { | |
| trace, | |
| debug, | |
| info, | |
| warn, | |
| error | |
| } | |
| type Levels = keyof typeof LEVELS; |
| addEventListener('scheduled', event => { | |
| event.waitUntil( | |
| handleSchedule(event.scheduledTime) | |
| ) | |
| }) | |
| function sendMessage(chat_id, text, options = { }) { | |
| return fetch(`https://api.telegram.org/bot${BOT_TOKEN}/sendMessage`, { | |
| method: "POST", | |
| headers: { 'Content-Type': 'application/json' }, |
| addEventListener("fetch", (event) => { | |
| event.respondWith( | |
| handleRequest(event.request).catch( | |
| (err) => new Response(err.stack, { status: 500 }) | |
| ) | |
| ); | |
| }) | |
| function sendMessage(chat_id, text) { | |
| return fetch(`https://api.telegram.org/bot${BOT_TOKEN}/sendMessage`, { |
| /** | |
| * @type [[[number], [[string]]]] | |
| */ | |
| const tests = [ | |
| [[0, 1, 0], [['tea', 'aba', 'obj'], ['eat', 'aaa', 'job']]], | |
| [[3], [['zzz'], ['aaa']]], | |
| [[0], [['zzx'], ['xzz']]], | |
| [[1, 1], [['zzx', 'xza'], ['xza', 'zzx']]], | |
| [[0, 1], [['azx', 'xza'], ['xza', 'zzx']]], | |
| [[-1, 0], [['azzz', 'xza'], ['xza', 'zax']]], |