-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #612 from ClarityCafe/sr229/cjs
Fix CJS support
- Loading branch information
Showing
16 changed files
with
92 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,6 @@ docsbuild/ | |
# Lock files | ||
package-lock.json | ||
yarn.lock | ||
|
||
# nyc test coverage | ||
.nyc_output/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
{ | ||
"name": "@clarity/sagiri", | ||
"version": "4.1.0", | ||
"exports": "./lib/sagiri.ts" | ||
"exports": "./src/sagiri.ts", | ||
"publish": { | ||
"include": [ | ||
"LICENSE", | ||
"README.md", | ||
"src/**/*.ts" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
console.log(` | ||
************************************************** | ||
* * | ||
* Thank you for using Sagiri <3! * | ||
* * | ||
* If you find this library useful, please * | ||
* consider supporting its maintenance by * | ||
* contributing or donating. * | ||
* * | ||
************************************************** | ||
Support this project financially at: https://ko-fi.com/capuccino | ||
Contribute to this project at: https://github.com/ClarityCafe/Sagiri | ||
`); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
/* eslint-disable @typescript-eslint/no-require-imports */ | ||
const process = require("process"); | ||
// this is so arbitrary holy shit | ||
const sagiriOnCjs = require("../../dist/sagiri.cjs"); | ||
/* eslint-disable no-undef */ | ||
const assert = require('assert'); | ||
const sagiri = require('../../dist/sagiri.cjs'); | ||
const describe = require('mocha').describe; | ||
const it = require('mocha').it; | ||
|
||
test("Resolve using Commonjs", async() => { | ||
const result = await sagiriOnCjs(process.env.SAUCENAO_TOKEN, { results: 5 })("https://i.imgur.com/F9QSgPx.jpeg"); | ||
console.log(result); | ||
describe('Sagiri#client', function() { | ||
it('should be a function', function() { | ||
assert.strictEqual(typeof sagiri, 'function'); | ||
}); | ||
|
||
expect(sagiriOnCjs).toBeDefined(); | ||
expect(result).toBeDefined(); | ||
it('should throw on invalid characters', function () { | ||
assert.throws(() => sagiri("!!!!!*&#@(!)")); | ||
}) | ||
}) |