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

@tldraw/tlvalidate

Package Overview
Dependencies
Maintainers
4
Versions
319
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tldraw/tlvalidate - npm Package Compare versions

Comparing version 2.0.0-alpha.7 to 2.0.0-alpha.8

4

dist/cjs/lib/index.js

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

var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,

@@ -23,0 +27,0 @@ mod

@@ -121,2 +121,7 @@ "use strict";

}
/**
* Asserts that the passed value is of the correct type and returns it. The
* returned value is guaranteed to be referentially equal to the passed
* value.
*/
validate(value) {

@@ -129,2 +134,6 @@ const validated = this.validationFn(value);

}
/**
* Returns a new validator that also accepts null or undefined. The
* resulting value will always be null.
*/
nullable() {

@@ -137,2 +146,6 @@ return new Validator((value) => {

}
/**
* Returns a new validator that also accepts null or undefined. The
* resulting value will always be null.
*/
optional() {

@@ -145,2 +158,7 @@ return new Validator((value) => {

}
/**
* Refine this validation to a new type. The passed-in validation function
* should throw an error if the value can't be converted to the new type, or
* return the new type otherwise.
*/
refine(otherValidationFn) {

@@ -218,2 +236,15 @@ return new Validator((value) => {

}
/**
* Extend an object validator by adding additional properties.
*
* @example
* ```ts
* const animalValidator = T.object({
* name: T.string,
* })
* const catValidator = animalValidator.extend({
* meowVolume: T.number,
* })
* ```
*/
extend(extension) {

@@ -220,0 +251,0 @@ return new ObjectValidator({ ...this.config, ...extension });

@@ -71,2 +71,7 @@ import { exhaustiveSwitchError, getOwnProperty, hasOwnProperty } from "@tldraw/utils";

}
/**
* Asserts that the passed value is of the correct type and returns it. The
* returned value is guaranteed to be referentially equal to the passed
* value.
*/
validate(value) {

@@ -79,2 +84,6 @@ const validated = this.validationFn(value);

}
/**
* Returns a new validator that also accepts null or undefined. The
* resulting value will always be null.
*/
nullable() {

@@ -87,2 +96,6 @@ return new Validator((value) => {

}
/**
* Returns a new validator that also accepts null or undefined. The
* resulting value will always be null.
*/
optional() {

@@ -95,2 +108,7 @@ return new Validator((value) => {

}
/**
* Refine this validation to a new type. The passed-in validation function
* should throw an error if the value can't be converted to the new type, or
* return the new type otherwise.
*/
refine(otherValidationFn) {

@@ -168,2 +186,15 @@ return new Validator((value) => {

}
/**
* Extend an object validator by adding additional properties.
*
* @example
* ```ts
* const animalValidator = T.object({
* name: T.string,
* })
* const catValidator = animalValidator.extend({
* meowVolume: T.number,
* })
* ```
*/
extend(extension) {

@@ -170,0 +201,0 @@ return new ObjectValidator({ ...this.config, ...extension });

37

package.json
{
"name": "@tldraw/tlvalidate",
"private": false,
"description": "A tiny little drawing app (validation).",
"version": "2.0.0-alpha.7",
"author": "tldraw GB Ltd.",
"version": "2.0.0-alpha.8",
"author": {
"name": "tldraw GB Ltd.",
"email": "hello@tldraw.com"
},
"homepage": "https://tldraw.dev",
"license": "Apache-2.0",
"repository": {

@@ -15,2 +18,11 @@ "type": "git",

},
"keywords": [
"tldraw",
"drawing",
"app",
"development",
"whiteboard",
"canvas",
"infinite"
],
"main": "dist/cjs/index.js",

@@ -23,18 +35,13 @@ "types": "index.d.ts",

"scripts": {
"test": "jest",
"test:coverage": "jest --coverage",
"typecheck": "tsc --build",
"build": "tsx ../../scripts/build-package.ts",
"prepack": "tsx ../../scripts/prepack.ts",
"test": "yarn run -T jest",
"test:coverage": "yarn run -T jest --coverage",
"typecheck": "yarn run -T tsc --build",
"build": "yarn run -T tsx ../../scripts/build-package.ts",
"prepack": "yarn run -T tsx ../../scripts/prepack.ts",
"postpack": "../../scripts/postpack.sh",
"lint": "tsx ../../scripts/lint.ts"
"lint": "yarn run -T tsx ../../scripts/lint.ts"
},
"dependencies": {
"@tldraw/utils": "2.0.0-alpha.7"
"@tldraw/utils": "workspace:*"
},
"devDependencies": {
"@swc/core": "^1.2.204",
"@swc/jest": "^0.2.21",
"ts-node-dev": "^1.1.8"
},
"jest": {

@@ -41,0 +48,0 @@ "preset": "config/jest/node",

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

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