Socket
Socket
Sign inDemoInstall

@orion-js/schema

Package Overview
Dependencies
Maintainers
3
Versions
110
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@orion-js/schema - npm Package Compare versions

Comparing version 3.1.13 to 3.1.27

4

lib/clean/index.d.ts

@@ -1,2 +0,2 @@

import { CurrentNodeInfoOptions, Schema } from '../types/schema';
export default function clean(schema: Schema | Function, doc?: {}, opts?: CurrentNodeInfoOptions, ...args: any[]): Promise<Schema>;
import { Blackbox, CurrentNodeInfoOptions, Schema } from '../types/schema';
export default function clean<TDoc = Blackbox>(schema: Schema | Function, doc: TDoc, opts?: CurrentNodeInfoOptions, ...args: any[]): Promise<TDoc>;

@@ -14,3 +14,5 @@ "use strict";

};
async function clean(schema, doc = {}, opts = {}, ...args) {
async function clean(schema, doc, opts = {}, ...args) {
if (!doc)
return doc;
schema = (0, getSchemaFromTypedModel_1.getSchemaFromTypedModel)(schema);

@@ -17,0 +19,0 @@ const options = { ...defaultOptions, ...opts };

@@ -146,3 +146,3 @@ "use strict";

type: String,
autoValue(values) {
autoValue() {
return 'a value';

@@ -270,3 +270,3 @@ }

};
// @ts-ignore TODO: Check why the __clean method is being used here instead of clean
// TODO: Check why the __clean method is being used here instead of clean
const cleaned = await (0, index_1.default)(schema, {

@@ -293,3 +293,3 @@ persons: [{ name: 'Nicolás' }, { name: 'Joaquin' }]

};
// @ts-ignore TODO: Check why the __clean method is being used here instead of clean
// TODO: Check why the __clean method is being used here instead of clean
const cleaned = await (0, index_1.default)(schema, { name: 'Joaquin' });

@@ -302,3 +302,3 @@ expect(cleaned).toEqual({ name: 'Roberto' });

type: String,
async autoValue(value) {
async autoValue() {
throw new Error('an error');

@@ -354,3 +354,3 @@ }

};
// @ts-ignore TODO: Check why the __clean method is being used here instead of clean
// TODO: Check why the __clean method is being used here instead of clean
const result = await (0, index_1.default)(schema, doc);

@@ -380,3 +380,3 @@ expect(result).toEqual({ items: [] });

type: null,
autoValue(name, info, arg1, arg2) {
autoValue() {
return 'Nicolás';

@@ -388,3 +388,3 @@ }

try {
await (0, index_1.default)(schema);
await (0, index_1.default)(schema, {});
}

@@ -399,3 +399,3 @@ catch (error) {

type: String,
autoValue(name, info, arg1, arg2) {
autoValue() {
return 'Nicolás';

@@ -405,3 +405,3 @@ }

};
const result = await (0, index_1.default)(schema);
const result = await (0, index_1.default)(schema, {});
expect(result).toEqual({ name: 'Nicolás' });

@@ -440,3 +440,3 @@ });

type: car,
async autoValue(value, { currentDoc, doc }) {
async autoValue(value, { currentDoc }) {
expect(value).toEqual(aMom.car);

@@ -477,3 +477,3 @@ expect(currentDoc).toEqual(aMom);

expect.assertions(14);
// @ts-ignore TODO: Check why the __clean method is being used here instead of clean
// TODO: Check why the __clean method is being used here instead of clean
await (0, index_1.default)(schema, doc);

@@ -486,3 +486,3 @@ });

optional: true,
async clean(info, { doc }) {
async clean() {
return { hello: 'world' };

@@ -489,0 +489,0 @@ }

{
"name": "@orion-js/schema",
"version": "3.1.13",
"version": "3.1.27",
"main": "lib/index.js",

@@ -39,3 +39,3 @@ "types": "lib/index.d.ts",

},
"gitHead": "36bea59a571b605e85c27d1bf4f69676b127d53e"
"gitHead": "c06da218f6f386d088a36f0a34f2a8194e065ac0"
}
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