Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@frui.ts/dirtycheck

Package Overview
Dependencies
Maintainers
5
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@frui.ts/dirtycheck - npm Package Compare versions

Comparing version 0.15.0-beta.6 to 0.15.0-rc.1

8

dist/automaticDirtyWatcher.d.ts

@@ -0,10 +1,16 @@

import { PropertyName } from "@frui.ts/helpers";
import { DirtyPropertiesList, IDirtyWatcher } from "./types";
export interface DirtyWatchConfig<TTarget> {
exclude?: PropertyName<TTarget>[];
}
export default class AutomaticDirtyWatcher<TTarget extends Record<string, any>> implements IDirtyWatcher<TTarget> {
private target;
private config?;
isDirtyFlagVisible: boolean;
dirtyProperties: DirtyPropertiesList<TTarget>;
private checkedProperties;
constructor(target: TTarget, isDirtyFlagVisible: boolean);
constructor(target: TTarget, isDirtyFlagVisible: boolean, config?: DirtyWatchConfig<TTarget> | undefined);
get isDirty(): boolean;
reset(): void;
private shouldWatchProperty;
}

@@ -15,4 +15,5 @@ "use strict";

var AutomaticDirtyWatcher = (function () {
function AutomaticDirtyWatcher(target, isDirtyFlagVisible) {
function AutomaticDirtyWatcher(target, isDirtyFlagVisible, config) {
this.target = target;
this.config = config;
this.isDirtyFlagVisible = isDirtyFlagVisible;

@@ -35,3 +36,3 @@ this.reset();

var _a;
if (target.hasOwnProperty(propertyName)) {
if (target.hasOwnProperty(propertyName) && this_1.shouldWatchProperty(propertyName)) {
var originalValue_1 = target[propertyName];

@@ -56,2 +57,9 @@ helpers_1.ensureObservableProperty(target, propertyName, originalValue_1);

};
AutomaticDirtyWatcher.prototype.shouldWatchProperty = function (propertyName) {
var _a, _b;
if ((_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.exclude) === null || _b === void 0 ? void 0 : _b.includes(propertyName)) {
return false;
}
return true;
};
__decorate([

@@ -58,0 +66,0 @@ mobx_1.observable,

6

package.json

@@ -6,3 +6,3 @@ {

},
"version": "0.15.0-beta.6",
"version": "0.15.0-rc.1",
"description": "Observable dirty checking",

@@ -39,3 +39,3 @@ "keywords": [

"dependencies": {
"@frui.ts/helpers": "^0.15.0-beta.6"
"@frui.ts/helpers": "^0.15.0-rc.1"
},

@@ -45,3 +45,3 @@ "peerDependencies": {

},
"gitHead": "80cf5a737f5eb5403a155fd4a2e2f36d81c50264"
"gitHead": "94f63f6550f4893c2bbf0ca038560fb2f4b6f2aa"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc