Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@openfn/language-common

Package Overview
Dependencies
Maintainers
5
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openfn/language-common - npm Package Compare versions

Comparing version
3.2.0
to
3.2.1
+82
-0
ast.json

@@ -1410,2 +1410,84 @@ {

{
"name": "validate",
"params": [
"schema",
"data"
],
"docs": {
"description": "Validate against a JSON schema. Any errors are written to an array at `state.validationErrors`.\nSchema can be passed directly, loaded as a JSON path from state, or loaded from a URL\nData can be passed directly or loaded as a JSON path from state.\nBy default, schema is loaded from `state.schema` and data from `state.data`.",
"tags": [
{
"title": "public",
"description": null,
"type": null
},
{
"title": "function",
"description": null,
"name": null
},
{
"title": "param",
"description": "The schema, path or URL to validate against",
"type": {
"type": "UnionType",
"elements": [
{
"type": "NameExpression",
"name": "string"
},
{
"type": "NameExpression",
"name": "object"
}
]
},
"name": "schema"
},
{
"title": "param",
"description": "The data or path to validate",
"type": {
"type": "UnionType",
"elements": [
{
"type": "NameExpression",
"name": "string"
},
{
"type": "NameExpression",
"name": "object"
}
]
},
"name": "data"
},
{
"title": "example",
"description": "validate()",
"caption": "Validate `state.data` with `state.schema`"
},
{
"title": "example",
"description": "validate(\"https://www.example.com/schema/record\", \"form\")",
"caption": "Validate form data at `state.form` with a schema from a URL"
},
{
"title": "example",
"description": "each(\"records[*]\", validate(\"https://www.example.com/schema/record\"))",
"caption": "Validate the each item in `state.records` with a schema from a URL"
},
{
"title": "returns",
"description": null,
"type": {
"type": "NameExpression",
"name": "Operation"
}
}
]
},
"valid": true
},
{
"name": "cursor",

@@ -1412,0 +1494,0 @@ "params": [

+1
-1

@@ -919,3 +919,3 @@ var __create = Object.create;

state[cursorKey] = (format2 == null ? void 0 : format2(date)) ?? date.toISOString();
const formatted = format2 ? state[cursorKey] : import_date_fns2.default.format(date, "HH:MM d MMM yyyy (OOO)");
const formatted = format2 ? state[cursorKey] : import_date_fns2.default.format(date, "HH:mm d MMM yyyy (OOO)");
console.log(`Setting ${cursorKey} "${cursor2}" to: ${formatted}`);

@@ -922,0 +922,0 @@ return state;

@@ -854,3 +854,3 @@ var __defProp = Object.defineProperty;

state[cursorKey] = (format2 == null ? void 0 : format2(date)) ?? date.toISOString();
const formatted = format2 ? state[cursorKey] : dateFns.format(date, "HH:MM d MMM yyyy (OOO)");
const formatted = format2 ? state[cursorKey] : dateFns.format(date, "HH:mm d MMM yyyy (OOO)");
console.log(`Setting ${cursorKey} "${cursor2}" to: ${formatted}`);

@@ -857,0 +857,0 @@ return state;

{
"name": "@openfn/language-common",
"label": "Common",
"version": "3.2.0",
"version": "3.2.1",
"description": "Common Expressions for OpenFn",

@@ -6,0 +6,0 @@ "homepage": "https://docs.openfn.org",

@@ -374,7 +374,7 @@ /**

/**
* Validate against a JSON schema. Any erors are written to an array at `state.validationErrors`.
* Validate against a JSON schema. Any errors are written to an array at `state.validationErrors`.
* Schema can be passed directly, loaded as a JSON path from state, or loaded from a URL
* Data can be passed directly or loaded as a JSON path from state.
* By default, schema is loaded from `state.schema` and data from `state.data`.
* @pubic
* @public
* @function

@@ -381,0 +381,0 @@ * @param {string|object} schema - The schema, path or URL to validate against