New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@smartthings/cli-lib

Package Overview
Dependencies
Maintainers
8
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@smartthings/cli-lib - npm Package Compare versions

Comparing version
2.3.1
to
2.3.2
+16
-0
dist/validate-util.d.ts

@@ -28,2 +28,17 @@ import { ValidateFunction } from './user-query';

export declare const integerValidateFn: (options?: IntegerValidationOptions) => ValidateFunction;
declare type URLValidateFnOptions = {
httpsRequired?: boolean;
/**
* Setting this to true (along with httpsRequired) will allow http protocol for localhost
* and 127.0.0.1.
*/
allowLocalhostHTTP?: boolean;
/**
* Required by default.
*/
required?: boolean;
minPort?: number;
maxPort?: number;
};
export declare const urlValidateFn: (options?: URLValidateFnOptions) => ValidateFunction;
export declare const emailValidate: (input: string) => true | string;

@@ -33,1 +48,2 @@ export declare const urlValidate: ValidateFunction;

export declare const localhostOrHTTPSValidate: ValidateFunction;
export {};
+14
-4
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.localhostOrHTTPSValidate = exports.httpsURLValidate = exports.urlValidate = exports.emailValidate = exports.integerValidateFn = exports.stringValidateFn = void 0;
exports.localhostOrHTTPSValidate = exports.httpsURLValidate = exports.urlValidate = exports.emailValidate = exports.urlValidateFn = exports.integerValidateFn = exports.stringValidateFn = void 0;
/**

@@ -52,4 +52,13 @@ * Builds a function that conforms to `ValidateFunction` that requires a string to match the given

return (input) => {
var _a, _b;
try {
const url = new URL(input);
const minPort = (_a = options === null || options === void 0 ? void 0 : options.minPort) !== null && _a !== void 0 ? _a : 1;
const maxPort = (_b = options === null || options === void 0 ? void 0 : options.maxPort) !== null && _b !== void 0 ? _b : 65535;
if (url.port) {
const portNum = parseInt(url.port);
if (portNum < minPort || portNum > maxPort) {
return `Port must be between ${minPort} and ${maxPort} inclusive.`;
}
}
if (options === null || options === void 0 ? void 0 : options.httpsRequired) {

@@ -75,2 +84,3 @@ if (options.allowLocalhostHTTP) {

};
exports.urlValidateFn = urlValidateFn;
// Email regex found on Stack Overflow:

@@ -82,4 +92,4 @@ // https://stackoverflow.com/questions/201323/how-can-i-validate-an-email-address-using-a-regular-expression

exports.emailValidate = emailValidate;
exports.urlValidate = urlValidateFn();
exports.httpsURLValidate = urlValidateFn({ httpsRequired: true });
exports.localhostOrHTTPSValidate = urlValidateFn({ httpsRequired: true, allowLocalhostHTTP: true });
exports.urlValidate = (0, exports.urlValidateFn)();
exports.httpsURLValidate = (0, exports.urlValidateFn)({ httpsRequired: true });
exports.localhostOrHTTPSValidate = (0, exports.urlValidateFn)({ httpsRequired: true, allowLocalhostHTTP: true });
{
"name": "@smartthings/cli-lib",
"version": "2.3.1",
"version": "2.3.2",
"description": "SmartThings CLI utility library",

@@ -5,0 +5,0 @@ "author": "Samsung Electronics Co., LTD.",