diff --git a/package.json b/package.json index 67da676..99793b7 100644 --- a/package.json +++ b/package.json @@ -45,8 +45,10 @@ "typescript": "^4.9.5" }, "exports": { - ".": "./dist/index.js", - "./": "./dist/" + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js" + } }, "jest": { "preset": "./jest.preset.cjs", diff --git a/src/engines/Pixiv.ts b/src/engines/Pixiv.ts index afdac74..f6a0230 100644 --- a/src/engines/Pixiv.ts +++ b/src/engines/Pixiv.ts @@ -70,6 +70,9 @@ export default class Pixiv extends ScrapeEngineBase { post.contentType = guessContentType(post.contentUrl); post.referrer = document.location.origin; result.tryAddPost(post); + if (document.querySelector('a[href*="/tags/R-18/artworks"]')) { + post.rating = "unsafe"; + } } return result; diff --git a/tsconfig.json b/tsconfig.json index 25a76c8..50acf7d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,12 +5,13 @@ "DOM", "DOM.Iterable" ], + "rootDir": "./src/", "outDir": "./dist/", "sourceMap": true, "strict": true, - "module": "ES2020", - "moduleResolution": "NodeNext", - "target": "ES2020", + "module": "node16", + "moduleResolution": "node16", + "target": "es2020", "skipLibCheck": true, "esModuleInterop": true, "removeComments": true,