
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@trycatch/types-extensions
Advanced tools
This lib provide some useful functions to extend core types and some of the Angular Types
This lib provide some useful functions to extend core types and some of the Angular Types
npm install --save @trycatch/types-extensions
in your .ts file where you want to use types extensions
import "@trycatch/types-extensions";
padZero(length: number)
let str = "trycatch";
str = str.padZero(10);
console.log("padZero string :", str);
// above will log to console - "00trycatch"
in Module
import { ReactiveFormsModule } from "@angular/forms";
@NgModule({
imports: [
....,
ReactiveFormsModule,
....
]
....
})
export class AppModule {}
in Component
import { FormGroup, FormBuilder, Validators } from "@angular/forms";
import "@trycatch/types-extensions";
@Component()
export class AppComponent {
form: FormGroup;
constructor(private fb: FormBuilder) {}
buildForm() {
this.form = this.fb.group({
firstName: ["", Validators.required],
lastName: ["", Validators.required],
address: this.fb.group({
streetNo: ["", Validators.required],
streetName: ["", Validators.required],
suburb: ["", Validators.required]
})
});
}
someOtherMethod() {
// below should get control: form -> firstName
const firstNameControl = this.form.control("firstName");
// below should get control: form -> address -> suburb
const suburb = this.form.control("address.suburb");
}
}
in Module
import { ReactiveFormsModule } from "@angular/forms";
@NgModule({
imports: [
....,
ReactiveFormsModule,
....
]
....
})
export class AppModule {}
in Component
import { FormGroup, FormBuilder, Validators } from "@angular/forms";
import "@trycatch/types-extensions";
@Component()
export class AppComponent {
form: FormGroup;
constructor(private fb: FormBuilder) {}
buildForm() {
this.form = this.fb.group({
firstName: ["", Validators.required],
lastName: ["", Validators.required],
address: this.fb.group({
streetNo: ["", Validators.required],
streetName: ["", Validators.required],
suburb: ["", Validators.required]
})
});
this.form.controls["firstName"].setValue("TryCatch");
(<FormGroup>this.form.controls["address"]).controls[
"streetName"
].setValue("Bourke");
(<FormGroup>this.form.controls["address"]).controls["suburb"].setValue({
name: "Melbourne",
postcode: 3000,
state: "VIC"
});
}
someOtherMethod() {
// below should get control: form -> firstName
const firstNameControl = this.form.controlValue("firstName");
// below should get control: form -> address -> streetName
const streetName = this.form.controlValue("address.streetName");
// below should get control: form -> address -> suburb
// this will return { name: "Melbourne", postcode: 3000, state: "VIC" }
const suburb = this.form.controlValue("address.suburb");
// below should get control: form -> address -> suburb -> postcode
// this will return 3000
const suburb = this.form.controlValue("address.suburb", "postcode");
}
}
FAQs
This lib provide some useful functions to extend core types and some of the Angular Types
We found that @trycatch/types-extensions demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.