style: apply prettier
This commit is contained in:
parent
c74ab67ccf
commit
03632f1507
24 changed files with 2321 additions and 1958 deletions
ts_src/payments
|
@ -1,28 +1,28 @@
|
|||
export function prop (object: Object, name: string, f: ()=>any): void {
|
||||
export function prop(object: Object, name: string, f: () => any): void {
|
||||
Object.defineProperty(object, name, {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
let value = f.call(this)
|
||||
this[name] = value
|
||||
return value
|
||||
get: function() {
|
||||
let value = f.call(this);
|
||||
this[name] = value;
|
||||
return value;
|
||||
},
|
||||
set: function (value) {
|
||||
set: function(value) {
|
||||
Object.defineProperty(this, name, {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
value: value,
|
||||
writable: true
|
||||
})
|
||||
}
|
||||
})
|
||||
writable: true,
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export function value <T> (f: ()=>T): ()=>T {
|
||||
let value: T
|
||||
return function (): T {
|
||||
if (value !== undefined) return value
|
||||
value = f()
|
||||
return value
|
||||
}
|
||||
export function value<T>(f: () => T): () => T {
|
||||
let value: T;
|
||||
return function(): T {
|
||||
if (value !== undefined) return value;
|
||||
value = f();
|
||||
return value;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue