@ngx-pwa/local-storage
Version:
Efficient local storage module for Angular: simple API based on native localStorage API, but internally stored via the asynchronous IndexedDB API for performance, and wrapped in RxJS observables to be homogeneous with other Angular modules.
50 lines • 2.21 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.updateToV8 = updateToV8;
exports.updateToV9 = updateToV9;
exports.updateToV13 = updateToV13;
exports.updateToV15 = updateToV15;
const schematics_1 = require("@angular-devkit/schematics");
const config_1 = require("../utility/config");
const module_1 = require("../utility/module");
function updateToV8() {
return async (host) => {
/* Get config */
const mainPaths = await (0, config_1.getAllMainPaths)(host);
/* Update `AppModule` of all projects */
return (0, schematics_1.chain)(mainPaths.map((mainPath) => (0, module_1.updateModule)(mainPath)));
};
}
function updateToV9() {
return async (host) => {
/* Get config */
const mainPaths = await (0, config_1.getAllMainPaths)(host);
/* Update `AppModule` of all projects */
return (0, schematics_1.chain)(mainPaths.map((mainPath) => (0, module_1.updateModule)(mainPath)));
};
}
function updateToV13() {
return (host, context) => {
const rxjsMajorVersion = (0, config_1.getDependencyMajorVersion)("rxjs", host);
if (rxjsMajorVersion === undefined) {
context.logger.warn(`Not able to detect rxjs version. Be aware that rxjs version >= 7.4 is recommended for version 13 of this library.`);
}
if (rxjsMajorVersion !== undefined && (rxjsMajorVersion < 7)) {
context.logger.warn(`rxjs should be updated to version >= 7.4. Support for rxjs version 6 is not guaranteed.`);
}
return host;
};
}
function updateToV15() {
return (host, context) => {
const rxjsMajorVersion = (0, config_1.getDependencyMajorVersion)("rxjs", host);
if (rxjsMajorVersion === undefined) {
context.logger.warn(`Not able to detect rxjs version. Be aware that rxjs version >= 7.4 is required for version 15 of this lib, rxjs 6 is not supported.`);
}
if (rxjsMajorVersion !== undefined && (rxjsMajorVersion < 7)) {
throw new schematics_1.SchematicsException("rxjs >= 7.4 is required for this lib, rxjs 6 is not supported.");
}
return host;
};
}
//# sourceMappingURL=index.js.map