From 48b91c745293748894314e5c3ac50069206337eb Mon Sep 17 00:00:00 2001 From: Joshua Harms Date: Thu, 31 Aug 2017 18:25:37 -0500 Subject: [PATCH] Compile to es2015. --- package.json | 2 ++ tests/index.ts | 9 +++++---- tsconfig.json | 9 ++++++--- yarn.lock | 6 +++++- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 9ffe5da..3c7cc7a 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,9 @@ "logspect": "^1.0.2" }, "devDependencies": { + "@types/lodash": "^4.14.74", "alsatian": "^1.3.1", + "lodash": "^4.17.4", "rimraf": "^2.5.4", "tap-bark": "^1.0.0", "typescript": "^2.3.3", diff --git a/tests/index.ts b/tests/index.ts index e8f3f79..238389e 100644 --- a/tests/index.ts +++ b/tests/index.ts @@ -23,6 +23,7 @@ import { Timeout } from 'alsatian'; import { DavenportError } from '../index'; +import range = require("lodash/range"); const DB_URL = "http://localhost:5984"; const DB_NAME = "davenport_tests"; @@ -519,7 +520,7 @@ export class DavenportTestFixture { @AsyncTest("Davenport.bulk insert with auto-generated ids.") @Timeout(5000) public async bulkTest() { - const docs = [...Array(100).keys()].map(i => ({ + const docs = range(0, 100).map(i => ({ bar: i, foo: i * 3, hello: "world" @@ -537,7 +538,7 @@ export class DavenportTestFixture { @Timeout(5000) public async bulkWithCustomIdsTest() { const generatedIds: string[] = []; - const docs = [...Array(100).keys()].map(i => { + const docs = range(0, 100).map(i => { const id = this.guid(); generatedIds.push(id); @@ -562,12 +563,12 @@ export class DavenportTestFixture { const client = getClient(); const totalExisting = 10; const totalOperations = 100; - const existingDocs = await client.bulk([...Array(totalExisting).keys()].map(i => ({ + const existingDocs = await client.bulk(range(0, totalExisting).map(i => ({ bar: i, foo: i * 5, hello: "I'm an existing doc, used with the bulkWithConflicts test." }))); - const result = await client.bulk([...Array(totalOperations).keys()].map(i => { + const result = await client.bulk(range(0, totalOperations).map(i => { const existingDoc = existingDocs[i]; const id = existingDoc ? existingDoc.id : undefined; diff --git a/tsconfig.json b/tsconfig.json index 4e64ff6..2f2e511 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,13 +1,16 @@ { "compilerOptions": { "module": "commonjs", - "target": "es2015", + "target": "es5", "noImplicitAny": false, "sourceMap": true, "outDir": "bin", "experimentalDecorators": true, - "declaration": true - }, + "declaration": true, + "lib": [ + "es2015" + ] + }, "exclude": [ "node_modules", "bin" diff --git a/yarn.lock b/yarn.lock index ed8c26d..b66dbe5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9,6 +9,10 @@ "@types/minimatch" "*" "@types/node" "*" +"@types/lodash@^4.14.74": + version "4.14.74" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.74.tgz#ac3bd8db988e7f7038e5d22bd76a7ba13f876168" + "@types/minimatch@*": version "2.0.29" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-2.0.29.tgz#5002e14f75e2d71e564281df0431c8c1b4a2a36a" @@ -1039,7 +1043,7 @@ loader-utils@^0.2.16: json5 "^0.5.0" object-assign "^4.0.1" -lodash@^4.14.0: +lodash@^4.14.0, lodash@^4.17.4: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"