Socket
Socket
Sign inDemoInstall

@scalecube/utils

Package Overview
Dependencies
Maintainers
7
Versions
188
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@scalecube/utils - npm Package Compare versions

Comparing version 0.0.2-alpha.1 to 0.0.2-alpha.2

1

es/address.d.ts

@@ -7,1 +7,2 @@ import { Address } from '@scalecube/api';

export declare const getFullAddress: (address: Address) => string;
export declare const getAddress: (address: string) => Address;

4

es/index.d.ts
import * as check from './check';
import { getFullAddress, validateAddress } from './address';
import { getFullAddress, validateAddress, getAddress } from './address';
import * as constants from './constants';
export { check, getFullAddress, validateAddress, constants };
export { check, getFullAddress, validateAddress, constants, getAddress };

@@ -116,3 +116,21 @@ var assert = function (predicate, msg) {

};
var getAddress = function (address) {
var newAddress = {};
address = buildAddress({ key: 'protocol', optionalValue: 'pm', delimiter: '://', str: address, newAddress: newAddress });
address = buildAddress({ key: 'host', optionalValue: 'defaultHost', delimiter: ':', str: address, newAddress: newAddress });
address = buildAddress({ key: 'port', optionalValue: 8080, delimiter: '/', str: address, newAddress: newAddress });
newAddress.path = address;
return newAddress;
};
var buildAddress = function (_a) {
var key = _a.key, optionalValue = _a.optionalValue, delimiter = _a.delimiter, newAddress = _a.newAddress, str = _a.str;
var _b = str.split(delimiter), v1 = _b[0], rest = _b[1];
if (!rest) {
rest = v1;
v1 = optionalValue;
}
newAddress[key] = v1;
return rest;
};
export { check, constants, getFullAddress, validateAddress };
export { check, constants, getAddress, getFullAddress, validateAddress };

@@ -7,1 +7,2 @@ import { Address } from '@scalecube/api';

export declare const getFullAddress: (address: Address) => string;
export declare const getAddress: (address: string) => Address;
import * as check from './check';
import { getFullAddress, validateAddress } from './address';
import { getFullAddress, validateAddress, getAddress } from './address';
import * as constants from './constants';
export { check, getFullAddress, validateAddress, constants };
export { check, getFullAddress, validateAddress, constants, getAddress };

@@ -120,6 +120,25 @@ 'use strict';

};
var getAddress = function (address) {
var newAddress = {};
address = buildAddress({ key: 'protocol', optionalValue: 'pm', delimiter: '://', str: address, newAddress: newAddress });
address = buildAddress({ key: 'host', optionalValue: 'defaultHost', delimiter: ':', str: address, newAddress: newAddress });
address = buildAddress({ key: 'port', optionalValue: 8080, delimiter: '/', str: address, newAddress: newAddress });
newAddress.path = address;
return newAddress;
};
var buildAddress = function (_a) {
var key = _a.key, optionalValue = _a.optionalValue, delimiter = _a.delimiter, newAddress = _a.newAddress, str = _a.str;
var _b = str.split(delimiter), v1 = _b[0], rest = _b[1];
if (!rest) {
rest = v1;
v1 = optionalValue;
}
newAddress[key] = v1;
return rest;
};
exports.check = check;
exports.constants = constants;
exports.getAddress = getAddress;
exports.getFullAddress = getFullAddress;
exports.validateAddress = validateAddress;
{
"name": "@scalecube/utils",
"version": "0.0.2-alpha.1",
"version": "0.0.2-alpha.2",
"private": false,

@@ -24,3 +24,2 @@ "main": "lib/index.js",

"devDependencies": {
"@scalecube/api": "^0.0.2-alpha.1",
"@types/jest": "^23.3.13",

@@ -37,3 +36,6 @@ "@types/node": "10.1.4",

},
"gitHead": "08b41bd48cbe83e31c9074e9d92d1afeccf812e9"
"dependencies": {
"@scalecube/api": "^0.0.2-alpha.2"
},
"gitHead": "918404795f587340814c7edd45e442d4a4814227"
}
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