@frui.ts/helpers
Advanced tools
Comparing version 1.0.0-alpha.1 to 1.0.0-alpha.2
@@ -1,3 +0,3 @@ | ||
import { BindingTarget } from "./types"; | ||
import type { BindingTarget } from "./types"; | ||
export declare function ensureObservableProperty<K, V>(target: Map<K, V>, property: K, value: V): void; | ||
export declare function ensureObservableProperty(target: BindingTarget, property: string, value: any): void; |
@@ -6,8 +6,8 @@ "use strict"; | ||
function ensureObservableProperty(target, property, value) { | ||
if (!mobx_1.isObservable(target)) { | ||
mobx_1.extendObservable(target, {}); | ||
if (!(0, mobx_1.isObservable)(target)) { | ||
(0, mobx_1.extendObservable)(target, {}); | ||
} | ||
mobx_1.set(target, property, value); | ||
(0, mobx_1.set)(target, property, value); | ||
} | ||
exports.ensureObservableProperty = ensureObservableProperty; | ||
//# sourceMappingURL=observableHelpers.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isMap = exports.isSet = void 0; | ||
var mobx_1 = require("mobx"); | ||
function isSet(item) { | ||
return !!item && typeof item.add === "function" && typeof item.has === "function" && typeof item.delete === "function"; | ||
return !!item && (item instanceof Set || (0, mobx_1.isObservableSet)(item)); | ||
} | ||
exports.isSet = isSet; | ||
function isMap(item) { | ||
return !!item && typeof item.add === "function" && typeof item.has === "function" && typeof item.delete === "function"; | ||
return !!item && (item instanceof Map || (0, mobx_1.isObservableMap)(item)); | ||
} | ||
exports.isMap = isMap; | ||
//# sourceMappingURL=typeHelpers.js.map |
export declare type BindingTarget = Map<any, any> | Record<string, any>; | ||
export declare type PropertyName<TTarget> = keyof TTarget & string; | ||
export declare type BindingProperty<TTarget> = TTarget extends Map<infer K, any> ? K : PropertyName<TTarget>; | ||
export declare type PropertyType<TTarget extends BindingTarget, TProperty extends BindingProperty<TTarget>, TRestrict = any> = (TTarget extends Map<any, infer V> ? V : TTarget[TProperty]) & TRestrict; | ||
export declare type PropertyType<TTarget extends BindingTarget, TProperty extends BindingProperty<TTarget>, TRestrict = unknown> = (TTarget extends Map<any, infer V> ? V : TTarget[TProperty]) & TRestrict; |
@@ -6,3 +6,3 @@ { | ||
}, | ||
"version": "1.0.0-alpha.1", | ||
"version": "1.0.0-alpha.2", | ||
"description": "Frui.ts helper functions", | ||
@@ -40,3 +40,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "debcc8b7993b1b0708853dddb9d29dc2a5727477" | ||
"gitHead": "99546362efd91f923e743ed07477bb6ef0b1caa3" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
255
26462