Skip to content

Run prettier on TS and JSON files in packages folder #224

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

Closed
wants to merge 1 commit into from
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
50 changes: 25 additions & 25 deletions packages/abort-controller/package.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
{
"name": "@aws-sdk/abort-controller",
"version": "0.1.0-preview.3",
"description": "A simple abort controller library",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"scripts": {
"prepublishOnly": "tsc",
"pretest": "tsc -p tsconfig.test.json",
"test": "jest"
},
"author": {
"name": "AWS SDK for JavaScript Team",
"email": "[email protected]",
"url": "https://aws.amazon.com/javascript/"
},
"license": "Apache-2.0",
"dependencies": {
"@aws-sdk/types": "^0.1.0-preview.3",
"tslib": "^1.8.0"
},
"devDependencies": {
"@types/jest": "^20.0.2",
"jest": "^20.0.4",
"typescript": "^3.0.0"
}
"name": "@aws-sdk/abort-controller",
"version": "0.1.0-preview.3",
"description": "A simple abort controller library",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"scripts": {
"prepublishOnly": "tsc",
"pretest": "tsc -p tsconfig.test.json",
"test": "jest"
},
"author": {
"name": "AWS SDK for JavaScript Team",
"email": "[email protected]",
"url": "https://aws.amazon.com/javascript/"
},
"license": "Apache-2.0",
"dependencies": {
"@aws-sdk/types": "^0.1.0-preview.3",
"tslib": "^1.8.0"
},
"devDependencies": {
"@types/jest": "^20.0.2",
"jest": "^20.0.4",
"typescript": "^3.0.0"
}
}
22 changes: 11 additions & 11 deletions packages/abort-controller/src/AbortController.spec.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import {AbortController} from "./AbortController";
import {AbortSignal} from "./AbortSignal";
import { AbortController } from "./AbortController";
import { AbortSignal } from "./AbortSignal";

jest.useFakeTimers();

describe('AbortController', () => {
it('should communicate cancellation via its signal', () => {
const source = new AbortController();
const {signal} = source;
expect(signal).toBeInstanceOf(AbortSignal);
expect(signal.aborted).toBe(false);
describe("AbortController", () => {
it("should communicate cancellation via its signal", () => {
const source = new AbortController();
const { signal } = source;
expect(signal).toBeInstanceOf(AbortSignal);
expect(signal.aborted).toBe(false);

source.abort();
expect(signal.aborted).toBe(true);
});
source.abort();
expect(signal.aborted).toBe(true);
});
});
12 changes: 6 additions & 6 deletions packages/abort-controller/src/AbortController.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {AbortController as IAbortController} from "@aws-sdk/types";
import {AbortSignal} from "./AbortSignal";
import { AbortController as IAbortController } from "@aws-sdk/types";
import { AbortSignal } from "./AbortSignal";

export class AbortController implements IAbortController {
public readonly signal: AbortSignal = new AbortSignal();
public readonly signal: AbortSignal = new AbortSignal();

abort(): void {
this.signal.abort();
}
abort(): void {
this.signal.abort();
}
}
60 changes: 30 additions & 30 deletions packages/abort-controller/src/AbortSignal.spec.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
import {AbortController} from "./AbortController";
import {AbortSignal} from "./AbortSignal";
import { AbortController } from "./AbortController";
import { AbortSignal } from "./AbortSignal";

describe('AbortSignal', () => {
it('should report aborted to be false until the signal is aborted', () => {
const controller = new AbortController();
const {signal} = controller;
expect(signal.aborted).toBe(false);
describe("AbortSignal", () => {
it("should report aborted to be false until the signal is aborted", () => {
const controller = new AbortController();
const { signal } = controller;
expect(signal.aborted).toBe(false);

controller.abort();
expect(signal.aborted).toBe(true);
});
controller.abort();
expect(signal.aborted).toBe(true);
});

it('should invoke the onabort handler when the signal is aborted', () => {
const controller = new AbortController();
const {signal} = controller;
const abortHandler = jest.fn();
signal.onabort = abortHandler;
expect(abortHandler.mock.calls.length).toBe(0);
controller.abort();
expect(abortHandler.mock.calls.length).toBe(1);
});
it("should invoke the onabort handler when the signal is aborted", () => {
const controller = new AbortController();
const { signal } = controller;
const abortHandler = jest.fn();
signal.onabort = abortHandler;
expect(abortHandler.mock.calls.length).toBe(0);
controller.abort();
expect(abortHandler.mock.calls.length).toBe(1);
});

it('should not invoke the onabort handler multiple time', () => {
const controller = new AbortController();
const {signal} = controller;
const abortHandler = jest.fn();
signal.onabort = abortHandler;
expect(abortHandler.mock.calls.length).toBe(0);
controller.abort();
expect(abortHandler.mock.calls.length).toBe(1);
controller.abort();
expect(abortHandler.mock.calls.length).toBe(1);
});
it("should not invoke the onabort handler multiple time", () => {
const controller = new AbortController();
const { signal } = controller;
const abortHandler = jest.fn();
signal.onabort = abortHandler;
expect(abortHandler.mock.calls.length).toBe(0);
controller.abort();
expect(abortHandler.mock.calls.length).toBe(1);
controller.abort();
expect(abortHandler.mock.calls.length).toBe(1);
});
});
51 changes: 24 additions & 27 deletions packages/abort-controller/src/AbortSignal.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,31 @@
import {
AbortSignal as IAbortSignal,
AbortHandler,
} from '@aws-sdk/types';
import { AbortSignal as IAbortSignal, AbortHandler } from "@aws-sdk/types";

export class AbortSignal implements IAbortSignal {
public onabort?: AbortHandler;
private _aborted!: boolean;
public onabort?: AbortHandler;
private _aborted!: boolean;

constructor() {
Object.defineProperty(this, '_aborted', {
value: false,
writable: true,
});
}
constructor() {
Object.defineProperty(this, "_aborted", {
value: false,
writable: true
});
}

/**
* Whether the associated operation has already been cancelled.
*/
get aborted(): boolean {
return this._aborted;
}
/**
* Whether the associated operation has already been cancelled.
*/
get aborted(): boolean {
return this._aborted;
}

/**
* @internal
*/
abort(): void {
this._aborted = true;
if (this.onabort) {
this.onabort();
this.onabort = undefined;
}
/**
* @internal
*/
abort(): void {
this._aborted = true;
if (this.onabort) {
this.onabort();
this.onabort = undefined;
}
}
}
31 changes: 14 additions & 17 deletions packages/abort-controller/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"lib": [
"es5",
"es2015.collection"
],
"strict": true,
"sourceMap": true,
"declaration": true,
"stripInternal": true,
"rootDir": "./src",
"outDir": "./build",
"importHelpers": true,
"noEmitHelpers": true
}
}
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"lib": ["es5", "es2015.collection"],
"strict": true,
"sourceMap": true,
"declaration": true,
"stripInternal": true,
"rootDir": "./src",
"outDir": "./build",
"importHelpers": true,
"noEmitHelpers": true
}
}
74 changes: 37 additions & 37 deletions packages/add-glacier-checksum-headers-browser/package.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
{
"name": "@aws-sdk/add-glacier-checksum-headers-browser",
"version": "0.1.0-preview.4",
"scripts": {
"prepublishOnly": "tsc",
"pretest": "tsc -p tsconfig.test.json",
"test": "karma start karma.conf.js"
},
"main": "./build/index.js",
"types": "./build/index.d.ts",
"author": {
"name": "AWS SDK for JavaScript Team",
"email": "[email protected]",
"url": "https://aws.amazon.com/javascript/"
},
"license": "Apache-2.0",
"dependencies": {
"@aws-sdk/chunked-blob-reader": "^0.1.0-preview.1",
"@aws-sdk/is-array-buffer": "^0.1.0-preview.1",
"@aws-sdk/sha256-tree-hash": "^0.1.0-preview.4",
"@aws-sdk/stream-collector-browser": "^0.1.0-preview.3",
"@aws-sdk/types": "^0.1.0-preview.3",
"@aws-sdk/util-hex-encoding": "^0.1.0-preview.1",
"tslib": "^1.8.0"
},
"devDependencies": {
"@aws-crypto/sha256-browser": "^0.1.0-preview.1",
"@aws-sdk/util-utf8-browser": "^0.1.0-preview.1",
"@types/jest": "^20.0.2",
"jasmine-core": "^2.8.0",
"jest": "^20.0.4",
"karma": "^2.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-jasmine": "^1.1.1",
"karma-typescript": "3.0.8",
"puppeteer": "^1.0.0",
"typescript": "^3.0.0"
}
"name": "@aws-sdk/add-glacier-checksum-headers-browser",
"version": "0.1.0-preview.4",
"scripts": {
"prepublishOnly": "tsc",
"pretest": "tsc -p tsconfig.test.json",
"test": "karma start karma.conf.js"
},
"main": "./build/index.js",
"types": "./build/index.d.ts",
"author": {
"name": "AWS SDK for JavaScript Team",
"email": "[email protected]",
"url": "https://aws.amazon.com/javascript/"
},
"license": "Apache-2.0",
"dependencies": {
"@aws-sdk/chunked-blob-reader": "^0.1.0-preview.1",
"@aws-sdk/is-array-buffer": "^0.1.0-preview.1",
"@aws-sdk/sha256-tree-hash": "^0.1.0-preview.4",
"@aws-sdk/stream-collector-browser": "^0.1.0-preview.3",
"@aws-sdk/types": "^0.1.0-preview.3",
"@aws-sdk/util-hex-encoding": "^0.1.0-preview.1",
"tslib": "^1.8.0"
},
"devDependencies": {
"@aws-crypto/sha256-browser": "^0.1.0-preview.1",
"@aws-sdk/util-utf8-browser": "^0.1.0-preview.1",
"@types/jest": "^20.0.2",
"jasmine-core": "^2.8.0",
"jest": "^20.0.4",
"karma": "^2.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-jasmine": "^1.1.1",
"karma-typescript": "3.0.8",
"puppeteer": "^1.0.0",
"typescript": "^3.0.0"
}
}
Loading