Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade dependencies #2

Merged
merged 1 commit into from
Jul 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Dictionary.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { DictionaryEntry } from './DictionaryEntry';
import { IDictionary } from "./IDictionary";
import { DictionaryEntry } from "./DictionaryEntry";

export class Dictionary<T> implements IDictionary<T> {
constructor(private readonly store: DictionaryEntry<T>[] = []) {}
constructor(private readonly store: DictionaryEntry<T>[] = []) { }

public get Entries(): DictionaryEntry<T>[] {
return this.store;
Expand All @@ -12,7 +12,7 @@ export class Dictionary<T> implements IDictionary<T> {
return this.store.map(entry => entry.key);
}

public get Items(): any[] {
public get Items() {
return this.store.map(entry => entry.value);
}

Expand All @@ -33,14 +33,14 @@ export class Dictionary<T> implements IDictionary<T> {
return true;
}

public add(key: T, value: any): void {
public add(key: T, value: string): void {
if (this.exists(key)) {
throw new Error("An entry with this key already exists.");
}
this.store.push(new DictionaryEntry(key, value));
}

public forceAdd(key: T, value: any): void {
public forceAdd(key: T, value: string | number): void {
const index = this.getIndex(key);
if (index === -1) {
this.store.push(new DictionaryEntry(key, value));
Expand Down
42 changes: 22 additions & 20 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
{
"compilerOptions": {
"target":
"es2016" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */,
"module":
"commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
"sourceMap": true /* Generates corresponding '.map' file. */,
"outDir": "./lib" /* Redirect output structure to the directory. */,
"strict": true /* Enable all strict type-checking options. */,
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
"sourceRoot":
"./src" /* Specify the location where debugger should locate TypeScript files instead of source locations. */,
"pretty": true,
"removeComments": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"declaration": true
"target": "es2016" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */,
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
"sourceMap": true /* Generates corresponding '.map' file. */,
"outDir": "./lib" /* Redirect output structure to the directory. */,
"strict": true /* Enable all strict type-checking options. */,
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
"sourceRoot": "./src" /* Specify the location where debugger should locate TypeScript files instead of source locations. */,
"pretty": true,
"removeComments": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"declaration": true,
"noImplicitAny": true,
"skipLibCheck": true
},
"exclude": ["node_modules", "lib"]
}
"exclude": [
"node_modules",
"lib"
]
}
Loading