Socket
Socket
Sign inDemoInstall

reddit-ts

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reddit-ts - npm Package Compare versions

Comparing version 0.5.0 to 0.6.0

2

dist/package.json
{
"name": "reddit-ts",
"version": "0.5.0",
"version": "0.6.0",
"description": "Reddit API written in Typescript",

@@ -5,0 +5,0 @@ "author": "aelesia",

@@ -174,3 +174,4 @@ "use strict";

};
RedditAPI.prototype.search_all = function (username) {
RedditAPI.prototype.search_all = function (username, max_results) {
if (max_results === void 0) { max_results = 999; }
return __awaiter(this, void 0, void 0, function () {

@@ -195,3 +196,3 @@ var _this = this;

case 3:
if (data.data.after) return [3, 1];
if (data.data.after && all_posts.length < max_results) return [3, 1];
_c.label = 4;

@@ -198,0 +199,0 @@ case 4: return [2, all_posts];

@@ -198,3 +198,15 @@ "use strict";

}); });
test('Search Max Posts 100', function () { return __awaiter(void 0, void 0, void 0, function () {
var results;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, Reddit.search_all('aelesia-', 100)];
case 1:
results = _a.sent();
expect(results.length).toBeLessThanOrEqual(100);
return [2];
}
});
}); });
});
//# sourceMappingURL=RedditAPI.test.js.map
{
"name": "reddit-ts",
"version": "0.5.0",
"version": "0.6.0",
"description": "Reddit API written in Typescript",

@@ -5,0 +5,0 @@ "author": "aelesia",

@@ -93,3 +93,3 @@ import { Comments } from './types/Comments.type'

async search_all(username: string): Promise<Post[]> {
async search_all(username: string, max_results = 999): Promise<Post[]> {
return await this.trycatch<Post[]>(async () => {

@@ -102,3 +102,3 @@ let data: Search | undefined

all_posts = all_posts.concat(map)
} while (data.data.after)
} while (data.data.after && all_posts.length < max_results)

@@ -105,0 +105,0 @@ return all_posts

@@ -110,2 +110,7 @@ import RedditAPI from '../src/RedditAPI'

test('Search Max Posts 100', async () => {
let results = await Reddit.search_all('aelesia-', 100)
expect(results.length).toBeLessThanOrEqual(100)
})
// describe('reply search delete', () => {

@@ -112,0 +117,0 @@ // let id = ''

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc