You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

whasome-interview-api

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

whasome-interview-api

fake location api for interview testing

1.0.1
latest
Source
npmnpm
Version published
Weekly downloads
1
-85.71%
Maintainers
1
Weekly downloads
 
Created
Source

Location API

Fake Location API used for interviews

API Documentation

Data Types

POINT_OBJECT = { lat: NUMBER, lon: NUMBER }
LOCATION_OBJECT = {
    address: STRING,
    point: POINT_OBJECT
}
DATA_OBJECT = {
    name: STRING,
    practices: [LOCATION_OBJECT]
}

fetchDoctors

Fetch multiple people with location information and name

  • Input Params: None
  • Returns Promise <[DATA_OBJECT]>

getDistance

Determines distance between two coordinate object points, returns distance in miles

  • Input Params: (POINT_OBJECT, POINT_OBJECT)
  • Returns NUMBER

Example

const pointA = { lat: 38.6093425, lon: -121.5148304}
const pointB = { lat: 38.5769468, lon: -121.48017379999999 }
const distance = getDistance(pointA, pointB);
console.log(distance); // Prints 2.92

getCurrentLocation

Gets the user's current location

  • Input Params: None
  • Returns Promise <PointObject>

testSort

Returns an array of sorted doctors for testing that sort works

  • Input Params: None
  • Returns:
[
    {
        name: STRING,
        practices: [
            point: POINT_OBJECT,
            distance: NUMBER,
            address: STRING
        ]
    }
]

FAQs

Package last updated on 14 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts