@scalecube/utils
Advanced tools
Comparing version 0.0.2-snapshot.1560866824.0 to 0.0.2-snapshot.1561539622.1
@@ -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 }; |
@@ -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" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
28167
340