npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

irisa-helpers

v0.0.8

Published

rxjs pipe: changeRouteOnSuccess(router: Router, route: ActivatedRoute, path: string) handleErrors(n: UntypedFormGroup) recordErrors(n: BusinessError[]) streamErrors(n: Subject<BusinessError>) recordState(n: ObservableState)

Downloads

192

Readme

rxjs pipe: changeRouteOnSuccess(router: Router, route: ActivatedRoute, path: string) handleErrors(n: UntypedFormGroup) recordErrors(n: BusinessError[]) streamErrors(n: Subject) recordState(n: ObservableState)

example of ObservableState loadState = new ObservableState(); this.loadState.Wait(); this.service.getDate() .pipe(this.recordState()) .subscrbe()

if(this.loadState.IsWait){ //do something }


functions:

toFormData(obj: any, form: FormData = null, namespace: string = null, ignoreList: boolean = false); toHttpParams(obj: any, params: HttpParams = null, namespace: string = null, ignoreList: boolean = false); makeAllControlsTouched(formGroup: UntypedFormGroup);

function wordifyfa(input: string | number, level: number = 0): string function wordifyRials(num: string | number): string function wordifyRialsInTomans(num: string | number): string function wordifyMomentApprox(date: Date | string | null, baseDate?: Date | string | null, suffixBefore: string = "پیش", suffixAfter: string = "بعد", doWordify: boolean = true): string function momentPrecise(date: Date | string | null, baseDate?: Date | string | null, suffixBefore: string = "پیش", suffixAfter: string = "بعد"): string function wordifyMomentPrecise(date: Date | string | null, baseDate?: Date | string | null, suffixBefore: string = "پیش", suffixAfter: string = "بعد", doWordify: boolean = true): string


import { Injectable } from '@angular/core'; import jwt_decode from 'jwt-decode'; import { CookieService } from 'ngx-cookie-service'; import { UserModel } from 'irisa-common-models';

@Injectable({ providedIn: 'root', }) export class SecurityHelper {

static access_token_key = 'access_token'; static refresh_token_key = 'refresh_token'; static exp_time_key = 'exp'; static role_claim_key = 'roles'; static username_claim_key = 'username'; static displayname_claim_key = 'displayname'; public domain: string;

saveAccessToken(token: string): void saveRefreshToken(token: string): void getAccessToken(): string getRefreshToken(): string clearAccessToken() isAuthenticated(): boolean getUserPayload() getUserRoles(): string[] getUserName(): string getDisplayName(): string getUserExpTime(): number getExpTime(token: string): number getPayload(token: string) isUserInRole(rolename: string): boolean hasUserAnyRoles(rolenames: string[]): boolean getUserInfo(): UserModel

}


EncryptionService: {

// ENCRYPTION USING CBC TRIPLE DES encryptUsingTripleDES(res: any, key: string, typeObj: boolean): string

// DECRYPTION USING CBC TRIPLE DES decryptUsingTripleDES(encrypted: string, key: string): string

// ENCRYPTION USING CBC DES encryptUsingDES(res: any, key: string, typeObj: boolean): string

// DECRYPTION USING CBC DES decryptUsingDES(encrypted: string, key: string): string

// ENCRYPTION USING AES encryptUsingAES(res: any, key: string, typeObj: boolean): string

// DECRYPTION USING AES decryptUsingAES(encrypted: string, key: string): string

}