gotiny
Advanced tools
Comparing version 1.5.2 to 1.5.3
declare const _default: { | ||
set: (input: import("./main/set").InputObject | Pick<import("./main/set").InputObject, "long">) => Promise<import("./main/set").ReturnObject[]>; | ||
get: (input: string, opt?: import("./main/get").Options) => Promise<any>; | ||
set: (input: string | import("./main/set").InputObject) => Promise<import("./main/set").ReturnObject[]>; | ||
get: (input: string, opt?: import("./main/get").Options) => Promise<string | import("./main/get").ReturnObject>; | ||
}; | ||
export = _default; |
export interface Options { | ||
extended?: boolean; | ||
} | ||
declare const get: (input: string, opt?: Options) => Promise<any>; | ||
export interface ReturnObject { | ||
code: string; | ||
long: string; | ||
} | ||
declare const get: (input: string, opt?: Options) => Promise<string | ReturnObject>; | ||
export default get; |
@@ -14,3 +14,3 @@ interface GoTinyObject { | ||
} | ||
declare const set: (input: InputObject | Pick<InputObject, "long">) => Promise<ReturnObject[]>; | ||
declare const set: (input: InputObject | InputObject["long"]) => Promise<ReturnObject[]>; | ||
export default set; |
{ | ||
"name": "gotiny", | ||
"version": "1.5.2", | ||
"version": "1.5.3", | ||
"description": "SDK for GoTiny: A lightweight link shortener API", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -7,3 +7,8 @@ import axios from "axios"; | ||
const get = async (input: string, opt: Options = {}) => { | ||
export interface ReturnObject { | ||
code: string; | ||
long: string; | ||
} | ||
const get = async (input: string, opt: Options = {}): Promise<string | ReturnObject> => { | ||
// If full link is provided, filter code out of it | ||
@@ -10,0 +15,0 @@ const fullLinkRegex = /gotiny.cc\/(.{4,32})/; |
@@ -19,3 +19,3 @@ import axios from "axios"; | ||
const set = async (input: InputObject | InputObject["long"]) => { | ||
const set = async (input: InputObject | InputObject["long"]): Promise<ReturnObject[]> => { | ||
// Throw error if no input is provided | ||
@@ -22,0 +22,0 @@ if (!input) { |
25960
58
319