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

@scalecube/utils

Package Overview
Dependencies
Maintainers
6
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-snapshot.1560866824.0 to 0.0.2-snapshot.1561539622.1

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-snapshot.1560866824.0+1fcdf57",
"version": "0.0.2-snapshot.1561539622.1+fc8d88e",
"private": false,

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

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

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

},
"gitHead": "1fcdf57c97c351b715d5f1665e72f19ed1cf09df"
"gitHead": "fc8d88e1f6f7ce45cac2cf30c17b983cf74aa4d1"
}
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