@cyberalien/redundancy
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -48,2 +48,1 @@ /** | ||
export declare const defaultConfig: RedundancyConfig; | ||
//# sourceMappingURL=config.d.ts.map |
@@ -1,9 +0,7 @@ | ||
"use strict"; | ||
// Allow <any> type because resource can be anything | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* Default RedundancyConfig for API calls | ||
*/ | ||
exports.defaultConfig = { | ||
export const defaultConfig = { | ||
resources: [], | ||
@@ -10,0 +8,0 @@ index: 0, |
@@ -122,2 +122,1 @@ import { RedundancyConfig } from './config'; | ||
export {}; | ||
//# sourceMappingURL=query.d.ts.map |
@@ -1,9 +0,7 @@ | ||
"use strict"; | ||
// Allow <any> type because query and resource can be anything | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* Query class | ||
*/ | ||
class Query { | ||
export class Query { | ||
constructor(parent, config, payload, queryCallback, doneCallback = null) { | ||
@@ -265,2 +263,1 @@ this.status = 'pending'; // Query status | ||
} | ||
exports.Query = Query; |
@@ -1,9 +0,3 @@ | ||
import { RedundancyConfig } from './config'; | ||
import { Query, QueryCallback, OptionalDoneCallback, PendingItem } from './query'; | ||
import { Query, QueryCallback, OptionalDoneCallback } from './query'; | ||
/** | ||
* Export imported interfaces | ||
*/ | ||
export { RedundancyConfig, QueryCallback as RedundancyQueryCallback, OptionalDoneCallback as RedundancyOptionalDoneCallback, PendingItem as RedundancyPendingItem, }; | ||
export declare type RedundancyQuery = typeof Query; | ||
/** | ||
* Function to filter item | ||
@@ -49,2 +43,1 @@ */ | ||
} | ||
//# sourceMappingURL=redundancy.d.ts.map |
@@ -1,11 +0,9 @@ | ||
"use strict"; | ||
// Allow <any> type because query and resource can be anything | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const config_1 = require("./config"); | ||
const query_1 = require("./query"); | ||
import { defaultConfig } from './config'; | ||
import { Query } from './query'; | ||
/** | ||
* Redundancy class | ||
*/ | ||
class Redundancy { | ||
export class Redundancy { | ||
/** | ||
@@ -22,3 +20,3 @@ * Constructor. Accepts partial RedundancyConfig object as parameter, merges with defaults | ||
} | ||
this.config = Object.assign({}, config_1.defaultConfig, config); | ||
this.config = Object.assign({}, defaultConfig, config); | ||
this.cleanup = this.cleanup.bind(this); | ||
@@ -30,3 +28,3 @@ } | ||
query(payload, queryCallback, doneCallback = null) { | ||
const query = new query_1.Query(this, this.config, payload, queryCallback, doneCallback); | ||
const query = new Query(this, this.config, payload, queryCallback, doneCallback); | ||
this.queries.push(query); | ||
@@ -69,2 +67,1 @@ return query; | ||
} | ||
exports.Redundancy = Redundancy; |
{ | ||
"name": "@cyberalien/redundancy", | ||
"description": "Reusable redundancy library for API queries", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"author": "Vjacheslav Trushkin", | ||
"license": "(Apache-2.0 OR GPL-2.0)", | ||
"main": "lib/code/redundancy.js", | ||
"types": "lib/code/types.d.ts", | ||
"scripts": { | ||
@@ -9,0 +10,0 @@ "cleanup": "rm -rf lib", |
@@ -6,3 +6,3 @@ { | ||
"target": "ES2019" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */, | ||
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */, | ||
"module": "ESNext" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */, | ||
// "lib": [], /* Specify library files to be included in the compilation. */ | ||
@@ -13,3 +13,3 @@ // "allowJs": true, /* Allow javascript files to be compiled. */ | ||
"declaration": true /* Generates corresponding '.d.ts' file. */, | ||
"declarationMap": true /* Generates a sourcemap for each corresponding '.d.ts' file. */, | ||
// "declarationMap": true /* Generates a sourcemap for each corresponding '.d.ts' file. */, | ||
"sourceMap": false /* Generates corresponding '.map' file. */, | ||
@@ -16,0 +16,0 @@ // "outFile": "./", /* Concatenate and emit output to single file. */ |
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
660
49479
17