Gathering detailed insights and metrics for typescript-lazy-get-decorator
Gathering detailed insights and metrics for typescript-lazy-get-decorator
Gathering detailed insights and metrics for typescript-lazy-get-decorator
Gathering detailed insights and metrics for typescript-lazy-get-decorator
Lazily evaluates a getter on an object and caches the returned value
npm install typescript-lazy-get-decorator
Typescript
Module System
Node Version
NPM Version
TypeScript (96.33%)
JavaScript (3.67%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
LGPL-3.0 License
32 Stars
430 Commits
1 Forks
3 Watchers
3 Branches
4 Contributors
Updated on Apr 17, 2025
Latest Version
1.2.2
Package Id
typescript-lazy-get-decorator@1.2.2
Unpacked Size
25.01 kB
Size
5.90 kB
File Count
13
NPM Version
6.4.1
Node Version
10.9.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
25
1/** 2 * Evaluate the getter function and cache the result 3 * @param {boolean} [setProto=false] Set the value on the class prototype as well. Only applies to non-static getters. 4 * @param {boolean} [makeNonConfigurable=false] Set to true to make the resolved property non-configurable 5 * @return {(target: any, key: string, descriptor: PropertyDescriptor) => void} A Typescript decorator function 6 */ 7function LazyGetter(setProto: boolean = false, makeNonConfigurable = false) {}
1import {LazyGetter} from 'typescript-lazy-get-decorator'; 2 3class AClass { 4 5 @LazyGetter() 6 get lazyNoProto():string { 7 console.log('Evaluating lazyNoProto'); 8 return 'lazyNoProtoValue'; 9 } 10 11 @LazyGetter(true) 12 get lazyWithProto():string { 13 console.log('Evaluating lazyWithProto'); 14 return 'lazyWithProtoValue'; 15 } 16} 17 18const inst1 = new AClass(); 19 20console.log('==== inst 1 ====\n'); 21 22console.log(inst1.lazyNoProto); 23console.log(inst1.lazyNoProto); 24console.log(inst1.lazyWithProto); 25console.log(inst1.lazyWithProto); 26 27const inst2 = new AClass(); 28 29console.log('\n\n==== inst 2 ====\n'); 30 31console.log(inst2.lazyNoProto); 32console.log(inst2.lazyNoProto); 33console.log(inst2.lazyWithProto); 34console.log(inst2.lazyWithProto);
Outputs:
==== inst 1 ====
Evaluating lazyNoProto
lazyNoProtoValue
lazyNoProtoValue
Evaluating lazyWithProto
lazyWithProtoValue
lazyWithProtoValue
==== inst 2 ====
Evaluating lazyNoProto
lazyNoProtoValue
lazyNoProtoValue
lazyWithProtoValue
lazyWithProtoValue
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
SAST tool detected but not run on all commits
Details
Reason
branch protection is not maximal on development and all release branches
Details
Reason
7 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 1
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/6 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More