num-client
Advanced tools
Comparing version 0.1.21 to 0.1.22
@@ -113,6 +113,6 @@ "use strict"; | ||
if (name) { | ||
return chalk_1.default.gray("[" + timestamp.toString() + "]") + " " + colouredLevel + " " + chalk_1.default.green(name + ":"); | ||
return chalk_1.default.gray(timestamp.toString()) + " " + colouredLevel + " " + chalk_1.default.green(name + ':'); | ||
} | ||
else { | ||
return chalk_1.default.gray("[" + timestamp.toString() + "]") + " " + colouredLevel; | ||
return chalk_1.default.gray(timestamp.toString()) + " " + colouredLevel; | ||
} | ||
@@ -312,22 +312,15 @@ }, | ||
query = function () { return __awaiter(_this, void 0, void 0, function () { | ||
var _a; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
_a = ctx.location; | ||
switch (_a) { | ||
case context_1.NumLocation.independent: return [3, 1]; | ||
case context_1.NumLocation.hosted: return [3, 3]; | ||
case context_1.NumLocation.populator: return [3, 5]; | ||
case context_1.NumLocation.none: return [3, 7]; | ||
} | ||
return [3, 7]; | ||
case 1: return [4, this.dnsQuery(ctx.queries.independentRecordLocation, ctx)]; | ||
case 2: return [2, _b.sent()]; | ||
case 3: return [4, this.dnsQuery(ctx.queries.hostedRecordLocation, ctx)]; | ||
case 4: return [2, _b.sent()]; | ||
case 5: return [4, this.populatorQuery(ctx)]; | ||
case 6: return [2, _b.sent()]; | ||
case 7: return [2, false]; | ||
return __generator(this, function (_a) { | ||
switch (ctx.location) { | ||
case context_1.NumLocation.independent: | ||
return [2, this.dnsQuery(ctx.queries.independentRecordLocation, ctx)]; | ||
case context_1.NumLocation.hosted: | ||
return [2, this.dnsQuery(ctx.queries.hostedRecordLocation, ctx)]; | ||
case context_1.NumLocation.populator: | ||
return [2, this.populatorQuery(ctx)]; | ||
case context_1.NumLocation.none: | ||
default: | ||
return [2, false]; | ||
} | ||
return [2]; | ||
}); | ||
@@ -487,3 +480,3 @@ }); }; | ||
if (schema) { | ||
existingSchema = ajv.compile(schema); | ||
existingSchema = ajv.getSchema(schemaUrl) ? ajv.getSchema(schemaUrl) : ajv.compile(schema); | ||
} | ||
@@ -490,0 +483,0 @@ else { |
@@ -49,3 +49,3 @@ "use strict"; | ||
function ResourceLoaderImpl() { | ||
this.cache = new lrucache_1.LruCache(); | ||
ResourceLoaderImpl.cache = new lrucache_1.LruCache(); | ||
this.env = null; | ||
@@ -65,3 +65,3 @@ } | ||
url = this.env ? url.replace('modules.numprotocol.com', this.env + ".modules.numprotocol.com") : url; | ||
cached = this.cache.get(url); | ||
cached = ResourceLoaderImpl.cache.get(url); | ||
if (!cached) return [3, 1]; | ||
@@ -73,3 +73,3 @@ return [2, cached]; | ||
result = loadedResource.data; | ||
this.cache.put(url, result); | ||
ResourceLoaderImpl.cache.put(url, result); | ||
return [2, result]; | ||
@@ -76,0 +76,0 @@ case 3: return [3, 5]; |
{ | ||
"name": "num-client", | ||
"version": "0.1.21", | ||
"version": "0.1.22", | ||
"description": "A NUM Protocol Client in TypeScript", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
468009
2534