diff --git a/notNeededPackages.json b/notNeededPackages.json index b8a48cefa0..975cba9b6a 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1098,6 +1098,12 @@ "sourceRepoURL": "https://github.com/sindresorhus/filenamify-url", "asOfVersion": "2.0.0" }, + { + "libraryName": "filesize", + "typingsPackageName": "filesize", + "sourceRepoURL": "https://github.com/avoidwork/filesize.js", + "asOfVersion": "5.0.0" + }, { "libraryName": "filter-console", "typingsPackageName": "filter-console", diff --git a/types/filesize/filesize-tests.ts b/types/filesize/filesize-tests.ts deleted file mode 100644 index aadc0542fa..0000000000 --- a/types/filesize/filesize-tests.ts +++ /dev/null @@ -1,21 +0,0 @@ -import filesize = require("filesize"); - -filesize(500); // "500 B" -filesize(500, {bits: true}); // "4 Kb" -filesize(265318, {base: 10}); // "265.32 kB" -filesize(265318); // "259.1 KB" -filesize(265318, {round: 0}); // "259 KB" -filesize(265318, {output: "array"}); // [259.1, "KB"] -filesize(265318, {output: "object"}); // {value: 259.1, suffix: "KB", symbol: "KB"} -filesize(1, {symbols: {B: "Б"}}); // "1 Б" -filesize(1024); // "1 KB" -filesize(1024, {exponent: 0}); // "1024 B" -filesize(1024, {output: "exponent"}); // 1 -filesize(265318, {standard: "iec"}); // "259.1 KiB" -filesize(265318, {standard: "iec", fullform: true}); // "259.1 kibibytes" -filesize(12, {fullform: true, fullforms: ["байтов"]}); // "12 байтов" -filesize(265318, {separator: ","}); // "259,1 KB" -filesize(265318, {locale: 'de-DE'}); // "259,1 KB" - -const size = filesize.partial({standard: "iec"}); -size(265318); diff --git a/types/filesize/index.d.ts b/types/filesize/index.d.ts deleted file mode 100644 index 95547f2897..0000000000 --- a/types/filesize/index.d.ts +++ /dev/null @@ -1,103 +0,0 @@ -// Type definitions for filesize 4.2 -// Project: https://github.com/avoidwork/filesize.js, https://filesizejs.com -// Definitions by: Giedrius Grabauskas -// Renaud Chaput -// Roman Nuritdinov -// Sam Hulick -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare var fileSize: Filesize.Filesize; -export = fileSize; -export as namespace filesize; - -declare namespace Filesize { - interface SiJedecBits { - b?: string; - Kb?: string; - Mb?: string; - Gb?: string; - Tb?: string; - Pb?: string; - Eb?: string; - Zb?: string; - Yb?: string; - } - - interface SiJedecBytes { - B?: string; - KB?: string; - MB?: string; - GB?: string; - TB?: string; - PB?: string; - EB?: string; - ZB?: string; - YB?: string; - } - - type SiJedec = SiJedecBits & SiJedecBytes & { [name: string]: string }; - - interface Options { - /** - * Number base, default is 2 - */ - base?: number; - /** - * Enables bit sizes, default is false - */ - bits?: boolean; - /** - * Specifies the SI suffix via exponent, e.g. 2 is MB for bytes, default is -1 - */ - exponent?: number; - /** - * Enables full form of unit of measure, default is false - */ - fullform?: boolean; - /** - * Array of full form overrides, default is [] - */ - fullforms?: string[]; - /** - * BCP 47 language tag to specify a locale, or true to use default locale, default is "" - */ - locale?: string | boolean; - /** - * ECMA-402 number format option overrides, default is "{}" - */ - localeOptions?: Intl.NumberFormatOptions; - /** - * Output of function (array, exponent, object, or string), default is string - */ - output?: "array" | "exponent" | "object" | "string"; - /** - * Decimal place, default is 2 - */ - round?: number; - /** - * Decimal separator character, default is `.` - */ - separator?: string; - /** - * Character between the result and suffix, default is ` ` - */ - spacer?: string; - /** - * Standard unit of measure, can be iec or jedec, default is jedec; can be overruled by base - */ - standard?: "iec" | "jedec"; - /** - * Dictionary of SI/JEDEC symbols to replace for localization, defaults to english if no match is found - */ - symbols?: SiJedec; - /** - * Enables unix style human readable output, e.g ls -lh, default is false - */ - unix?: boolean; - } - - interface Filesize { - (bytes: number, options?: Options): string; - partial: (options: Options) => ((bytes: number) => string); - } -} diff --git a/types/filesize/tsconfig.json b/types/filesize/tsconfig.json deleted file mode 100644 index 350e88d4ad..0000000000 --- a/types/filesize/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "filesize-tests.ts" - ] -} \ No newline at end of file diff --git a/types/filesize/tslint.json b/types/filesize/tslint.json deleted file mode 100644 index f93cf8562a..0000000000 --- a/types/filesize/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "dtslint/dt.json" -}