MCPcopy
hub / github.com/refly-ai/refly / get

Function get

apps/api/src/modules/config/config.decorator.ts:33–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31 return function (target: any, propertyKey: string) {
32 Object.defineProperty(target, propertyKey, {
33 get() {
34 const config: ConfigService = this.config;
35 if (!config) {
36 throw new Error(
37 `Config.integer decorator requires 'config: ConfigService' to be injected in ${target.constructor.name}`,
38 );
39 }
40 const raw = config.get<unknown>(path);
41 if (raw === undefined || raw === null) return defaultValue;
42 if (typeof raw === 'number') return Math.floor(raw);
43 if (typeof raw === 'string') {
44 const parsed = Number.parseInt(raw, 10);
45 return Number.isNaN(parsed) ? defaultValue : parsed;
46 }
47 return defaultValue;
48 },
49 enumerable: true,
50 configurable: true,
51 });

Callers 7

theme.tsFile · 0.85
handleChangeFunction · 0.85
action-result.tsFile · 0.85
front-page.tsFile · 0.85
safeGetFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected