Comparing version 0.1.4 to 0.1.5
@@ -13,5 +13,5 @@ import { Query, QueryDto, TextQuery } from "./types"; | ||
export declare class Text implements Query { | ||
private value; | ||
private readonly value; | ||
constructor(value: TextQuery); | ||
toJSON(): QueryDto; | ||
} |
@@ -32,2 +32,3 @@ "use strict"; | ||
this.value = value; | ||
this.value = Object.assign(Object.assign({}, textQueryDefaults), this.value); | ||
} | ||
@@ -42,2 +43,9 @@ toJSON() { | ||
exports.Text = Text; | ||
const textQueryDefaults = { | ||
ignore: false, | ||
isRegex: false, | ||
searchBody: true, | ||
searchHeadline: true, | ||
text: "" | ||
}; | ||
//# sourceMappingURL=queries.js.map |
export interface Filter { | ||
query: Query; | ||
tickers: string[]; | ||
query?: Query; | ||
tickers?: string[]; | ||
} | ||
@@ -16,7 +16,7 @@ export interface News { | ||
export interface TextQuery { | ||
searchBody: boolean; | ||
searchHeadline: boolean; | ||
isRegex: boolean; | ||
searchBody?: boolean; | ||
searchHeadline?: boolean; | ||
isRegex?: boolean; | ||
text: string; | ||
ignore: boolean; | ||
ignore?: boolean; | ||
} | ||
@@ -23,0 +23,0 @@ export type QueryDto = { |
{ | ||
"name": "newsware", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "Typescript client for interacting with the Newsware API", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -31,4 +31,5 @@ import {Query, QueryDto, QueryType, TextQuery} from "./types"; | ||
constructor( | ||
private value: TextQuery | ||
private readonly value: TextQuery | ||
) { | ||
this.value = {... textQueryDefaults, ... this.value} | ||
} | ||
@@ -42,2 +43,10 @@ | ||
} | ||
} | ||
const textQueryDefaults: TextQuery = { | ||
ignore: false, | ||
isRegex: false, | ||
searchBody: true, | ||
searchHeadline: true, | ||
text: "" | ||
} |
export interface Filter { | ||
query: Query | ||
tickers: string[] | ||
query?: Query | ||
tickers?: string[] | ||
} | ||
@@ -18,7 +18,7 @@ | ||
export interface TextQuery { | ||
searchBody: boolean | ||
searchHeadline: boolean | ||
isRegex: boolean, | ||
searchBody?: boolean | ||
searchHeadline?: boolean | ||
isRegex?: boolean, | ||
text: string, | ||
ignore: boolean | ||
ignore?: boolean | ||
} | ||
@@ -25,0 +25,0 @@ |
Sorry, the diff of this file is not supported yet
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
12703
301