@bscotch/validation
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -10,2 +10,3 @@ import { default as chalk } from 'chalk'; | ||
export const blue = chalk.rgb(7, 123, 181); | ||
const prettyParserSymbol = Symbol('pretty-parser'); | ||
/** | ||
@@ -33,4 +34,4 @@ * Default file-path-replacer, for the @bscotch/tech | ||
const oldPrepareStackTrace = Error.prepareStackTrace; | ||
if (oldPrepareStackTrace) { | ||
Error.prepareStackTrace = (err, trace) => { | ||
if (oldPrepareStackTrace && !oldPrepareStackTrace[prettyParserSymbol]) { | ||
const newPrepare = (err, trace) => { | ||
const asString = oldPrepareStackTrace(err, trace); | ||
@@ -42,2 +43,4 @@ if (!asString || typeof asString != 'string') { | ||
}; | ||
newPrepare[prettyParserSymbol] = true; | ||
Error.prepareStackTrace = newPrepare; | ||
} | ||
@@ -44,0 +47,0 @@ } |
@@ -6,2 +6,3 @@ import type { JsonSchema } from './jsonSchema.js'; | ||
readonly 'case-camel': (value: any) => boolean; | ||
readonly regex: (value: any) => boolean; | ||
}; | ||
@@ -8,0 +9,0 @@ /** |
@@ -11,2 +11,5 @@ import { default as Ajv } from 'ajv'; | ||
}, | ||
regex(value) { | ||
return typeof value === 'string'; | ||
}, | ||
}; | ||
@@ -13,0 +16,0 @@ const keywords = ['modifier', 'kind']; |
{ | ||
"name": "@bscotch/validation", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"type": "module", | ||
@@ -17,7 +17,2 @@ "exports": { | ||
"types": "dist/index.d.ts", | ||
"scripts": { | ||
"build": "tsc --build", | ||
"test": "treb test", | ||
"watch": "tsc --build --watch" | ||
}, | ||
"dependencies": { | ||
@@ -31,7 +26,15 @@ "ajv": "^8.11.0", | ||
"devDependencies": { | ||
"ts-toolbelt": "^9.6.0" | ||
"@types/chalk": "^2.2.0", | ||
"@types/source-map-support": "^0.5.4", | ||
"ts-toolbelt": "^9.6.0", | ||
"typescript": "^4.8.0-beta" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"scripts": { | ||
"build": "tsc --build", | ||
"test": "treb test", | ||
"watch": "tsc --build --watch" | ||
} | ||
} | ||
} |
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
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
Sorry, the diff of this file is not supported yet
49888
747
4