ngx-face-api-js
Version:
Angular directives for face detection and face recognition in the browser. It is a wrapper for face-api.js, so it is not dependent on the browser implementation.
35 lines • 1.71 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const config_1 = require("@schematics/angular/utility/config");
const schematics_1 = require("@angular/cdk/schematics");
const terminal_1 = require("@angular-devkit/core/src/terminal");
function addCdkOverlayPrebuiltCssToAppStyles(options) {
return (host, _) => {
const workspace = config_1.getWorkspace(host);
const project = schematics_1.getProjectFromWorkspace(workspace, options.project);
const styleFilePath = schematics_1.getProjectStyleFile(project);
if (!styleFilePath) {
console.warn(terminal_1.red(`Could not find the default style file for this project.`));
console.warn(terminal_1.red(`Please consider manually setting up the Roboto font in your CSS.`));
return;
}
const buffer = host.read(styleFilePath);
if (!buffer) {
console.warn(terminal_1.red(`Could not read the default style file within the project ` +
`(${terminal_1.italic(styleFilePath)})`));
console.warn(terminal_1.red(`Please consider manually setting up the Robot font.`));
return;
}
const content = buffer.toString();
const insertion = `\n@import '~@angular/cdk/overlay-prebuilt.css';`;
if (content.includes(insertion)) {
return;
}
const recorder = host.beginUpdate(styleFilePath);
recorder.insertLeft(content.length, insertion);
host.commitUpdate(recorder);
return host;
};
}
exports.addCdkOverlayPrebuiltCssToAppStyles = addCdkOverlayPrebuiltCssToAppStyles;
//# sourceMappingURL=addCdkOverlayPrebuiltCssToAppStyles.js.map