Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sttm/banidb",
"version": "3.0.0",
"version": "3.0.1",
"description": "JavaScript API wrapper for BaniDB REST API",
"main": "index.js",
"scripts": {
Expand Down
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ export const TYPES = [
"Romanized Gurmukhi (English)",
"Ang",
"Main Letters (Gurmukhi)",
"Romanized first letter anywhere (English)"
"Romanized first letter anywhere (English)",
"Auto Detect"
];

export const SOURCES = {
Expand Down Expand Up @@ -45,6 +46,7 @@ export const buildApiUrl = options => {
randomid = false, // Boolean: Pass true to get random shabad id only.
API_URL = "https://api.banidb.com/v2/", // String: API_URL to hit. (Prod: api.banidb.com, Dev: devapi.khajana.org).
livesearch = false,
isGurmukhi = false,
} = options;

let url = API_URL;
Expand All @@ -68,6 +70,8 @@ export const buildApiUrl = options => {

if (livesearch) params.push(`livesearch=1`);

if (isGurmukhi) params.push(`isGurmukhi=1`);

url += `search/${q}?${params.join("&")}`;
} else if (id !== false) {
url += `shabads/${id}`;
Expand Down