@gibme/ipinfo 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +15 -0
- package/dist/index.js +52 -0
- package/dist/index.js.map +1 -0
- package/dist/ipinfo.min.js +3 -0
- package/dist/ipinfo.min.js.LICENSE.txt +105 -0
- package/dist/ipinfo.min.js.map +1 -0
- package/dist/web.d.ts +10 -0
- package/dist/{ipinfo.js → web.js} +2 -17
- package/dist/web.js.map +1 -0
- package/package.json +13 -5
- package/dist/ipinfo.d.ts +0 -22
- package/dist/ipinfo.js.map +0 -1
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PrefixInfo } from './types';
|
|
2
|
+
import { CheckIP } from './web';
|
|
3
|
+
export { CheckIP };
|
|
4
|
+
/**
|
|
5
|
+
* Looks up information regarding the IP address supplied
|
|
6
|
+
*
|
|
7
|
+
* @param address
|
|
8
|
+
* @param max_retries
|
|
9
|
+
*/
|
|
10
|
+
export declare const IPInfo: (address: string, max_retries?: number) => Promise<PrefixInfo | undefined>;
|
|
11
|
+
declare const _default: {
|
|
12
|
+
IPInfo: (address: string, max_retries?: number) => Promise<PrefixInfo | undefined>;
|
|
13
|
+
CheckIP: (address?: string) => Promise<import("./types").CheckIPResponse | undefined>;
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) 2016-2024, Brandon Lehmann <brandonlehmann@gmail.com>
|
|
3
|
+
//
|
|
4
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
// of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
// in the Software without restriction, including without limitation the rights
|
|
7
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
// copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
// furnished to do so, subject to the following conditions:
|
|
10
|
+
//
|
|
11
|
+
// The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
// copies or substantial portions of the Software.
|
|
13
|
+
//
|
|
14
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
// SOFTWARE.
|
|
21
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
31
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
32
|
+
};
|
|
33
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
|
+
exports.IPInfo = exports.CheckIP = void 0;
|
|
35
|
+
const helpers_1 = __importDefault(require("./helpers"));
|
|
36
|
+
const web_1 = require("./web");
|
|
37
|
+
Object.defineProperty(exports, "CheckIP", { enumerable: true, get: function () { return web_1.CheckIP; } });
|
|
38
|
+
/**
|
|
39
|
+
* Looks up information regarding the IP address supplied
|
|
40
|
+
*
|
|
41
|
+
* @param address
|
|
42
|
+
* @param max_retries
|
|
43
|
+
*/
|
|
44
|
+
const IPInfo = (address_1, ...args_1) => __awaiter(void 0, [address_1, ...args_1], void 0, function* (address, max_retries = 3) {
|
|
45
|
+
return helpers_1.default.getPrefix(address, max_retries);
|
|
46
|
+
});
|
|
47
|
+
exports.IPInfo = IPInfo;
|
|
48
|
+
exports.default = {
|
|
49
|
+
IPInfo: exports.IPInfo,
|
|
50
|
+
CheckIP: web_1.CheckIP
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;AAChF,+EAA+E;AAC/E,4EAA4E;AAC5E,wEAAwE;AACxE,2DAA2D;AAC3D,EAAE;AACF,iFAAiF;AACjF,kDAAkD;AAClD,EAAE;AACF,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,yEAAyE;AACzE,gFAAgF;AAChF,gFAAgF;AAChF,YAAY;;;;;;;;;;;;;;;AAGZ,wDAAgC;AAChC,+BAAgC;AACvB,wFADA,aAAO,OACA;AAEhB;;;;;GAKG;AACI,MAAM,MAAM,GAAG,uBAGa,EAAE,8DAFjC,OAAe,EACf,WAAW,GAAG,CAAC;IAEf,OAAO,iBAAO,CAAC,SAAS,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;AACnD,CAAC,CAAA,CAAC;AALW,QAAA,MAAM,UAKjB;AAEF,kBAAe;IACX,MAAM,EAAN,cAAM;IACN,OAAO,EAAP,aAAO;CACV,CAAC"}
|