UNPKG

dcard

Version:

👫 Unofficial Dcard API wrapper for Node.js developers.

39 lines (34 loc) • 897 B
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.sendDarsysEvent = exports.listDarsysPosts = undefined; var _request = require('../request'); /** * "You may also like these posts" based on a post id * @param {Number} id posd id * @example * const id = 225688036; * listDarsysPosts(id).then((res) => { * console.log(res); * }); */ var listDarsysPosts = exports.listDarsysPosts = function listDarsysPosts(id) { if (typeof window === 'undefined') { return { uuid: '', posts: [] }; } return (0, _request.api)('darsys/' + id).then(_request.filterError).then(_request.parseJSON); }; /** * @ignore * unknown */ var sendDarsysEvent = exports.sendDarsysEvent = function sendDarsysEvent(body) { return (0, _request.api)('darsys/bilanx', { method: 'post', body: body }).then(_request.filterError).then(_request.parseJSON); };