Skip to content

Commit 12ba676

Browse files
fix to single quote
1 parent 89ed02a commit 12ba676

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

packages/core/image-asset/image-asset-common.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function getRequestedImageSize(src: { width: number; height: number }, op
5757
}
5858

5959
return {
60-
width: reqWidth,
61-
height: reqHeight,
60+
width: Number(reqWidth),
61+
height: Number(reqHeight),
6262
};
6363
}

packages/core/image-asset/index.android.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import { ImageAssetBase, getRequestedImageSize } from "./image-asset-common";
2-
import { path as fsPath, knownFolders } from "../file-system";
3-
import { ad } from "../utils";
4-
import { Screen } from "../platform";
5-
export * from "./image-asset-common";
1+
import { ImageAssetBase, getRequestedImageSize } from './image-asset-common';
2+
import { path as fsPath, knownFolders } from '../file-system';
3+
import { ad } from '../utils';
4+
import { Screen } from '../platform';
5+
export * from './image-asset-common';
66

77
export class ImageAsset extends ImageAssetBase {
88
private _android: string; //file name of the image
99

1010
constructor(asset: string) {
1111
super();
12-
let fileName = typeof asset === "string" ? asset.trim() : "";
13-
if (fileName.indexOf("~/") === 0) {
14-
fileName = fsPath.join(knownFolders.currentApp().path, fileName.replace("~/", ""));
12+
let fileName = typeof asset === 'string' ? asset.trim() : '';
13+
if (fileName.indexOf('~/') === 0) {
14+
fileName = fsPath.join(knownFolders.currentApp().path, fileName.replace('~/', ''));
1515
}
1616
this.android = fileName;
1717
}
@@ -40,7 +40,7 @@ export class ImageAsset extends ImageAssetBase {
4040
*/
4141
private _validateDimensions(width: number | string, height: number | string): { width: number; height: number } {
4242
const parseSize = (size: number | string): number => {
43-
return typeof size === "string" ? parseInt(size, 10) : size;
43+
return typeof size === 'string' ? parseInt(size, 10) : size;
4444
};
4545

4646
let w = parseSize(width);

packages/core/image-asset/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Observable } from "../data/observable";
1+
import { Observable } from '../data/observable';
22

33
export class ImageAsset extends Observable {
44
constructor(asset: any);

packages/core/image-asset/index.ios.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import { ImageAssetBase, getRequestedImageSize } from "./image-asset-common";
2-
import { path as fsPath, knownFolders } from "../file-system";
3-
import { queueGC } from "../utils";
1+
import { ImageAssetBase, getRequestedImageSize } from './image-asset-common';
2+
import { path as fsPath, knownFolders } from '../file-system';
3+
import { queueGC } from '../utils';
44

5-
export * from "./image-asset-common";
5+
export * from './image-asset-common';
66

77
export class ImageAsset extends ImageAssetBase {
88
private _ios: PHAsset;
99

1010
constructor(asset: string | PHAsset | UIImage) {
1111
super();
12-
if (typeof asset === "string") {
13-
if (asset.indexOf("~/") === 0) {
14-
asset = fsPath.join(knownFolders.currentApp().path, asset.replace("~/", ""));
12+
if (typeof asset === 'string') {
13+
if (asset.indexOf('~/') === 0) {
14+
asset = fsPath.join(knownFolders.currentApp().path, asset.replace('~/', ''));
1515
}
1616

1717
this.nativeImage = UIImage.imageWithContentsOfFile(asset);
@@ -40,16 +40,16 @@ export class ImageAsset extends ImageAssetBase {
4040
*/
4141
public getImageAsync(callback: (image, error) => void, options?: { width?: number | string; height?: number | string }) {
4242
if (options) {
43-
if (typeof options.width === "string") {
43+
if (typeof options.width === 'string') {
4444
options.width = parseInt(options.width, 10);
4545
}
46-
if (typeof options.height === "string") {
46+
if (typeof options.height === 'string') {
4747
options.height = parseInt(options.height, 10);
4848
}
4949
}
5050

5151
if (!this.ios && !this.nativeImage) {
52-
callback(null, "Asset cannot be found.");
52+
callback(null, 'Asset cannot be found.');
5353
}
5454

5555
const srcWidth = this.nativeImage ? this.nativeImage.size.width : this.ios.pixelWidth;

0 commit comments

Comments
 (0)