@bochilteam/scraper-bmkg
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -39,3 +39,3 @@ "use strict"; | ||
}); | ||
return index_js_1.GempaSchema.parse(results); | ||
return results.map((v) => index_js_1.GempaSchema.parse(v)); | ||
} | ||
@@ -67,3 +67,3 @@ exports.gempa = gempa; | ||
}); | ||
return index_js_1.GempaNowSchema.parse(results); | ||
return results.map((v) => index_js_1.GempaNowSchema.parse(v)); | ||
} | ||
@@ -98,4 +98,4 @@ exports.gempaNow = gempaNow; | ||
}); | ||
return index_js_1.GempaRealtimeSchema.parse(results); | ||
return results.map((v) => index_js_1.GempaRealtimeSchema.parse(v)); | ||
} | ||
exports.gempaRealtime = gempaRealtime; |
@@ -35,4 +35,4 @@ "use strict"; | ||
}); | ||
return index_js_1.TsunamiSchema.parse(results); | ||
return results.map((v) => index_js_1.TsunamiSchema.parse(v)); | ||
} | ||
exports.default = tsunami; |
@@ -13,16 +13,16 @@ "use strict"; | ||
}); | ||
exports.GempaSchema = zod_1.z.array(zod_1.z.object({ | ||
exports.GempaSchema = zod_1.z.object({ | ||
location: zod_1.z.string(), | ||
warning: zod_1.z.array(zod_1.z.string()) | ||
}).merge(exports.GempaBaseSchema)); | ||
exports.GempaNowSchema = zod_1.z.array(zod_1.z.object({ | ||
}).merge(exports.GempaBaseSchema); | ||
exports.GempaNowSchema = zod_1.z.object({ | ||
location: zod_1.z.string(), | ||
}).merge(exports.GempaBaseSchema)); | ||
exports.GempaRealtimeSchema = zod_1.z.array(zod_1.z.object({ | ||
}).merge(exports.GempaBaseSchema); | ||
exports.GempaRealtimeSchema = zod_1.z.object({ | ||
location: zod_1.z.array(zod_1.z.string()), | ||
isConfirmed: zod_1.z.boolean() | ||
}).merge(exports.GempaBaseSchema)); | ||
exports.TsunamiSchema = zod_1.z.array(zod_1.z.object({ | ||
}).merge(exports.GempaBaseSchema); | ||
exports.TsunamiSchema = zod_1.z.object({ | ||
location: zod_1.z.string(), | ||
info: zod_1.z.string() | ||
}).merge(exports.GempaBaseSchema)); | ||
}).merge(exports.GempaBaseSchema); |
@@ -33,3 +33,3 @@ import got from 'got'; | ||
}); | ||
return GempaSchema.parse(results); | ||
return results.map((v) => GempaSchema.parse(v)); | ||
} | ||
@@ -60,3 +60,3 @@ export async function gempaNow() { | ||
}); | ||
return GempaNowSchema.parse(results); | ||
return results.map((v) => GempaNowSchema.parse(v)); | ||
} | ||
@@ -90,3 +90,3 @@ export async function gempaRealtime() { | ||
}); | ||
return GempaRealtimeSchema.parse(results); | ||
return results.map((v) => GempaRealtimeSchema.parse(v)); | ||
} |
@@ -30,3 +30,3 @@ import got from 'got'; | ||
}); | ||
return TsunamiSchema.parse(results); | ||
return results.map((v) => TsunamiSchema.parse(v)); | ||
} |
@@ -10,16 +10,16 @@ import { z } from 'zod'; | ||
}); | ||
export const GempaSchema = z.array(z.object({ | ||
export const GempaSchema = z.object({ | ||
location: z.string(), | ||
warning: z.array(z.string()) | ||
}).merge(GempaBaseSchema)); | ||
export const GempaNowSchema = z.array(z.object({ | ||
}).merge(GempaBaseSchema); | ||
export const GempaNowSchema = z.object({ | ||
location: z.string(), | ||
}).merge(GempaBaseSchema)); | ||
export const GempaRealtimeSchema = z.array(z.object({ | ||
}).merge(GempaBaseSchema); | ||
export const GempaRealtimeSchema = z.object({ | ||
location: z.array(z.string()), | ||
isConfirmed: z.boolean() | ||
}).merge(GempaBaseSchema)); | ||
export const TsunamiSchema = z.array(z.object({ | ||
}).merge(GempaBaseSchema); | ||
export const TsunamiSchema = z.object({ | ||
location: z.string(), | ||
info: z.string() | ||
}).merge(GempaBaseSchema)); | ||
}).merge(GempaBaseSchema); |
{ | ||
"name": "@bochilteam/scraper-bmkg", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "BMKG scraper module", | ||
@@ -35,5 +35,7 @@ "main": "lib/cjs/index.js", | ||
}, | ||
"homepage": "https://github.com/BochilTeam/scraper#readme", | ||
"homepage": "https://github.com/BochilTeam/scraper/tree/master/packages/scraper-bmkg#readme", | ||
"files": [ | ||
"./lib/**/*.js" | ||
"lib/**/*.js", | ||
"lib/**/**.d.ts", | ||
"lib/**/package.json" | ||
], | ||
@@ -40,0 +42,0 @@ "dependencies": { |
@@ -7,2 +7,13 @@ # BMKG Scraper | ||
npm i @bochilteam/scraper-bmkg | ||
``` | ||
``` | ||
## Usage | ||
Example get data gempa (earthquake): | ||
```ts | ||
// Import module | ||
import { gempa } from '@bochilteam/scraper-bmkg' | ||
const data = await gempa() | ||
console.log(data) // JSON | ||
``` | ||
[Documentation](https://bochilteam.github.io/scraper/modules/_bochilteam_scraper_bmkg.html) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
20581
19
544
0
18