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

escss-estest

Package Overview
Dependencies
Maintainers
0
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

escss-estest - npm Package Compare versions

Comparing version 1.4.21 to 1.4.22

57

lib/index.js
/**
* escss-estest v1.4.21
* escss-estest v1.4.22
* (c) 2024 Mike Lee

@@ -86,3 +86,3 @@ * @license AGPL-3.0-only OR Commercial (https://github.com/ESCSS-labs)

`
🚫 Production hides details for security. View them in development.
🚫 Production hides details for security. Viewable in development.
❗ ${errMsg}

@@ -93,3 +93,3 @@ `,

/**
* 100% function coverage for easier life. demo: https://demo-estest-log-not-visible.netlify.app/
* A runtime testing library inspired by TDD and TypeScript to achieve 100% coverage
* @param {*} input

@@ -99,30 +99,33 @@ * @param { 'undefined' | 'null' | 'array' | 'object' | 'boolean' | 'NaN' | 'number' | 'bigint' | 'string' | 'symbol' | 'function' } type

*/
function ESTest(input, type, errMsg = 'undefined error message') {
if (!TYPES.includes(type)) {
if (process.env.NODE_ENV === 'production') getError(errMsg)
else {
throw new Error(
`
function ESTest(input, type, errMsg = 'undefined default error message') {
try {
if (process.env.NODE_ENV === 'test') _testToken = type
if (!TYPES.includes(type)) {
if (process.env.NODE_ENV === 'production') getError(errMsg)
else {
throw new Error(
`
✅ Expected 2nd Argument Type: 'undefined' | 'null' | 'array' | 'object' | 'boolean' | 'NaN' | 'number' | 'bigint' | 'string' | 'symbol' | 'function'
❌ Received 2nd Argument: ${fixTextInLog(type)}
`,
)
)
}
}
}
else if (!['undefined', 'string'].includes(typeof errMsg)) {
if (process.env.NODE_ENV === 'production') getError(errMsg)
else {
throw new Error(
`
else if (!['undefined', 'string'].includes(typeof errMsg)) {
if (process.env.NODE_ENV === 'production') getError(errMsg)
else {
throw new Error(
`
✅ Expected Error Message Type: 'string'
❌ Received Error Message Type: '${fixType(errMsg)}' --> ${fixTextInLog(errMsg)}
`,
)
)
}
}
}
else if (fixType(input) !== type) {
if (process.env.NODE_ENV === 'production') getError(errMsg)
else {
throw new Error(
`
else if (fixType(input) !== type) {
if (process.env.NODE_ENV === 'production') getError(errMsg)
else {
throw new Error(
`
✅ Expected Type: ${fixTextInLog(type)}

@@ -132,10 +135,10 @@ ❌ Received Type: '${fixType(input)}' --> ${fixTextInLog(input)}

`,
)
)
}
}
} catch(error) {
console.error(error)
}
// internal testing purpose
if (process.env.NODE_ENV === 'test') _testToken = type
}
export { _testToken, ESTest }
{
"name": "escss-estest",
"version": "1.4.21",
"version": "1.4.22",
"description": "A runtime testing library inspired by TDD and TypeScript to achieve 100% coverage.",

@@ -5,0 +5,0 @@ "keywords": [

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