Socket
Socket
Sign inDemoInstall

@flatfile/hooks

Package Overview
Dependencies
Maintainers
25
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flatfile/hooks - npm Package Compare versions

Comparing version 1.2.4 to 1.3.0

3

dist/index.d.ts

@@ -69,2 +69,5 @@ type TPrimitive = string | boolean | number | null;

pushInfoMessage(fields: string | string[], message: string, level: IRecordInfo['level'], stage: TRecordStageLevel): this;
compute(field: string, transformation: (value: TPrimitive, record: FlatfileRecord<M>) => TPrimitive, message?: string): this;
computeIfPresent(field: string, transformation: (value: TPrimitive, record: FlatfileRecord<M>) => TPrimitive, message?: string): this;
validate(field: string, validator: (value: TPrimitive, record: FlatfileRecord<M>) => boolean, message: string): this;
toJSON(): IRawRecordWithInfo<M>;

@@ -71,0 +74,0 @@ }

@@ -161,2 +161,21 @@ "use strict";

}
compute(field, transformation, message) {
this.set(field, transformation(this.get(field), this));
if (message) {
this.addComment(field, message);
}
return this;
}
computeIfPresent(field, transformation, message) {
if (this.get(field)) {
this.compute(field, transformation, message);
}
return this;
}
validate(field, validator, message) {
if (!validator(this.get(field), this)) {
this.addError(field, message);
}
return this;
}
toJSON() {

@@ -163,0 +182,0 @@ return {

2

package.json
{
"name": "@flatfile/hooks",
"version": "1.2.4",
"version": "1.3.0",
"description": "",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

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