did-resolver
Advanced tools
Comparing version 0.0.6-alpha1 to 0.0.6-alpha2
@@ -38,3 +38,21 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var REGISTRY = {}; | ||
var globalObject; | ||
var REGISTRY; | ||
if (window) { | ||
globalObject = window; | ||
} | ||
else if (typeof global === 'object') { | ||
globalObject = global; | ||
} | ||
else { | ||
globalObject = { | ||
DID_REGISTRY: {} | ||
}; | ||
} | ||
if (globalObject.DID_REGISTRY) { | ||
REGISTRY = globalObject.DID_REGISTRY; | ||
} | ||
else { | ||
REGISTRY = globalObject.DID_REGISTRY = {}; | ||
} | ||
function registerMethod(method, resolver) { | ||
@@ -41,0 +59,0 @@ REGISTRY[method] = resolver; |
{ | ||
"name": "did-resolver", | ||
"version": "0.0.6-alpha1", | ||
"version": "0.0.6-alpha2", | ||
"description": "Resolve DID documents", | ||
@@ -26,2 +26,3 @@ "main": "lib/resolver.js", | ||
"@types/jest": "^23.3.10", | ||
"@types/node": "^10.12.18", | ||
"jest": "^23.6.0", | ||
@@ -28,0 +29,0 @@ "prettier": "^1.15.3", |
@@ -36,5 +36,24 @@ export interface DIDDocument { | ||
} | ||
let globalObject : { | ||
DID_REGISTRY: ResolverRegistry | ||
} | ||
const REGISTRY : ResolverRegistry = {} | ||
var REGISTRY : ResolverRegistry | ||
if (window) { | ||
globalObject = window | ||
} else if (typeof global === 'object') { | ||
globalObject = global | ||
} else { | ||
globalObject = { | ||
DID_REGISTRY: {} | ||
} | ||
} | ||
if (globalObject.DID_REGISTRY) { | ||
REGISTRY = globalObject.DID_REGISTRY | ||
} else { | ||
REGISTRY = globalObject.DID_REGISTRY = {} | ||
} | ||
export function registerMethod (method: string, resolver: DIDResolver) { | ||
@@ -41,0 +60,0 @@ REGISTRY[method] = resolver |
Sorry, the diff of this file is not supported yet
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
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
20763
341
0
10