Skip to content

Commit

Permalink
fix: 🐛 [prisma-cilent-generate] files
Browse files Browse the repository at this point in the history
  • Loading branch information
meetqy committed Apr 2, 2023
1 parent 4338591 commit 986a90d
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 33 deletions.
27 changes: 0 additions & 27 deletions packages/plugin-nsfw/lib/nsfw.ts

This file was deleted.

8 changes: 8 additions & 0 deletions packages/prisma-client-generate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
"main": "index.js",
"types": "index.d.ts",
"browser": "index-browser.js",
"files": [
"runtime",
"index-browser.js",
"index.d.ts",
"index.js",
"libquery_engine-darwin.dylib.node",
"schema.prisma"
],
"exports": {
".": {
"import": "./index.js",
Expand Down
22 changes: 21 additions & 1 deletion packages/use/example/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
import raopics from "../lib";

/**
* 获取 NSFW MetaData
* @param metadata 文件读取的metadata
* @param file 文件地址
*/
// export const getNSFWMetadata = async (metadata: EagleUse.Image, file: string) => {
// if (process.env.PLUGIN_NSFW != "true") return metadata;

// const imageFile = file.replace("metadata.json", `${metadata.name}.${metadata.ext}`);
// const predictions = await getNSFW()(imageFile);
// predictions
// .filter((item) => item.probability > 0.35)
// .forEach((item) => metadata.tags.push(item.className as string));
// metadata.nsfw = true;

// return metadata;
// };

raopics({
library: "/Users/qymeet/Pictures/test.library",
port: 3456,
transform: {
// before: (data, database) => {},
},
});
10 changes: 5 additions & 5 deletions packages/use/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@ import TransformEagle, { Transform } from "@raopics/transform-eagle";
interface Options {
// library 地址
library: string;
// 端口号
port?: number;
// 开启转换 eagle,默认 true
transform_eagle?: boolean;
// 转换
transform?: Transform;
// 端口号
port?: number;
}

const raopics = (options?: Options) => {
const { transform_eagle = true, port = 0, transform } = options || {};
const { transform_eagle = true, port = 0, transform, library } = options || {};

if (transform_eagle) {
TransformEagle({
library: options.library,
library,
transform,
});
}

PLUGIN_API({
library: options.library,
library,
port,
});
};
Expand Down

0 comments on commit 986a90d

Please sign in to comment.