Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@paxperscientiam/national-weather-service-api.ts

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@paxperscientiam/national-weather-service-api.ts - npm Package Compare versions

Comparing version 0.3.1-beta.0 to 0.3.1-beta.1

dist/.tern-port

16

bin/generate-services.ts

@@ -106,9 +106,7 @@ // tslint:disable:no-console

`)
file.write(`import { stringify } from "query-string"
file.write(`import {format} from "url"
`)
file.write(`import {URL} from "url"
`)
file.write(`export class NWS {
private domain: string = "https://api.weather.gov"
private hostname: string = "api.weather.gov"
private query = {}

@@ -186,6 +184,8 @@ private pathString: string = ""

file.write(`buildURI(): string {
const URI = new URL(this.domain)
URI.pathname = this.pathString
URI.search = stringify(this.query)
return URI.href
return format({
hostname: this.hostname,
pathname: this.pathString,
protocol: "https",
query: this.query,
})
}

@@ -192,0 +192,0 @@ `)

/// <reference path="../src/@types/nwsapi/index.d.ts" />
export declare class NWS {
private domain;
private hostname;
private query;

@@ -5,0 +5,0 @@ private pathString;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const query_string_1 = require("query-string");
const url_1 = require("url");
class NWS {
constructor() {
this.domain = "https://api.weather.gov";
this.hostname = "api.weather.gov";
this.query = {};

@@ -148,6 +147,8 @@ this.pathString = "";

buildURI() {
const URI = new url_1.URL(this.domain);
URI.pathname = this.pathString;
URI.search = query_string_1.stringify(this.query);
return URI.href;
return url_1.format({
hostname: this.hostname,
pathname: this.pathString,
protocol: "https",
query: this.query,
});
}

@@ -154,0 +155,0 @@ setPath(pathString) {

{
"name": "@paxperscientiam/national-weather-service-api.ts",
"version": "0.3.1-beta.0",
"version": "0.3.1-beta.1",
"description": "Provides types for the US National Weather Service's forecast API and a helpful URI builder.",

@@ -40,3 +40,4 @@ "homepage": "https://github.com/paxperscientiam/national-weather-service-types",

"dependencies": {
"query-string": "^6.8.3"
"query-string": "^6.8.3",
"url": "^0.11.0"
},

@@ -43,0 +44,0 @@ "files": [

/// <reference path="./@types/nwsapi/index.d.ts" />
/// <reference types="node" />
import { stringify } from "query-string"
import {URL} from "url"
import {format} from "url"
export class NWS {
private domain: string = "https://api.weather.gov"
private hostname: string = "api.weather.gov"
private query = {}

@@ -194,6 +193,8 @@ private pathString: string = ""

buildURI(): string {
const URI = new URL(this.domain)
URI.pathname = this.pathString
URI.search = stringify(this.query)
return URI.href
return format({
hostname: this.hostname,
pathname: this.pathString,
protocol: "https",
query: this.query,
})
}

@@ -200,0 +201,0 @@ private setPath(pathString: string): this {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc