@openclaw/google-meet 2026.7.2-beta.7 → 2026.7.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chrome-create-DMKruRFW.js → .setup/chrome-create-CFNlY-qH.mjs} +153 -132
- package/dist/{cli-DCcRyaMf.js → .setup/cli-DfOl5mwt.mjs} +707 -716
- package/dist/{config-BcaS1BDr.js → .setup/config-DeJhjNWQ.mjs} +95 -76
- package/dist/{create-af1MDlus.js → .setup/create-BVsTTJt1.mjs} +3 -21
- package/dist/{google-api-errors-CDUYkIcK.js → .setup/google-api-errors-BDYXfKRa.mjs} +1 -1
- package/dist/{oauth-DOfMKlGp.js → .setup/oauth-CtVbvmvR.mjs} +4 -3
- package/dist/doctor-contract-api.js +3 -1
- package/dist/index.js +3868 -1818
- package/node_modules/{jszip/node_modules/setimmediate/LICENSE.txt → commander/LICENSE} +10 -8
- package/node_modules/commander/Readme.md +1172 -0
- package/node_modules/commander/index.js +21 -0
- package/node_modules/commander/lib/argument.js +147 -0
- package/node_modules/commander/lib/command.js +2790 -0
- package/node_modules/commander/lib/error.js +36 -0
- package/node_modules/commander/lib/help.js +731 -0
- package/node_modules/commander/lib/option.js +377 -0
- package/node_modules/commander/lib/suggestSimilar.js +99 -0
- package/node_modules/commander/package-support.json +19 -0
- package/node_modules/commander/package.json +64 -0
- package/node_modules/commander/typings/index.d.ts +1113 -0
- package/node_modules/typebox/build/compile/validator.d.mts +4 -1
- package/node_modules/typebox/build/guard/guard.d.mts +1 -1
- package/node_modules/typebox/build/guard/guard.mjs +2 -5
- package/node_modules/typebox/build/guard/string.mjs +4 -16
- package/node_modules/typebox/build/schema/engine/_functions.mjs +15 -34
- package/node_modules/typebox/build/type/action/readonly_object.d.mts +0 -5
- package/node_modules/typebox/build/type/action/readonly_object.mjs +0 -8
- package/node_modules/typebox/build/typebox.d.mts +1 -1
- package/node_modules/typebox/build/typebox.mjs +1 -1
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +32 -29
- package/openclaw.plugin.json +3 -4
- package/package.json +7 -9
- package/dist/cli-metadata.js +0 -13
- package/dist/cli-output-mode-BwH_6tH8.js +0 -28
- package/node_modules/jszip/.codeclimate.yml +0 -16
- package/node_modules/jszip/.editorconfig +0 -8
- package/node_modules/jszip/.eslintrc.js +0 -43
- package/node_modules/jszip/.github/workflows/pr.yaml +0 -58
- package/node_modules/jszip/.jekyll-metadata +0 -0
- package/node_modules/jszip/.travis.yml +0 -17
- package/node_modules/jszip/CHANGES.md +0 -204
- package/node_modules/jszip/LICENSE.markdown +0 -651
- package/node_modules/jszip/README.markdown +0 -33
- package/node_modules/jszip/deps.js +0 -37
- package/node_modules/jszip/dist/jszip.js +0 -11577
- package/node_modules/jszip/dist/jszip.min.js +0 -13
- package/node_modules/jszip/graph.svg +0 -601
- package/node_modules/jszip/index.d.ts +0 -330
- package/node_modules/jszip/lib/base64.js +0 -106
- package/node_modules/jszip/lib/compressedObject.js +0 -74
- package/node_modules/jszip/lib/compressions.js +0 -14
- package/node_modules/jszip/lib/crc32.js +0 -77
- package/node_modules/jszip/lib/defaults.js +0 -11
- package/node_modules/jszip/lib/external.js +0 -18
- package/node_modules/jszip/lib/flate.js +0 -85
- package/node_modules/jszip/lib/generate/ZipFileWorker.js +0 -539
- package/node_modules/jszip/lib/generate/index.js +0 -57
- package/node_modules/jszip/lib/index.js +0 -55
- package/node_modules/jszip/lib/license_header.js +0 -11
- package/node_modules/jszip/lib/load.js +0 -88
- package/node_modules/jszip/lib/nodejs/NodejsStreamInputAdapter.js +0 -74
- package/node_modules/jszip/lib/nodejs/NodejsStreamOutputAdapter.js +0 -42
- package/node_modules/jszip/lib/nodejsUtils.js +0 -57
- package/node_modules/jszip/lib/object.js +0 -384
- package/node_modules/jszip/lib/readable-stream-browser.js +0 -10
- package/node_modules/jszip/lib/reader/ArrayReader.js +0 -57
- package/node_modules/jszip/lib/reader/DataReader.js +0 -116
- package/node_modules/jszip/lib/reader/NodeBufferReader.js +0 -19
- package/node_modules/jszip/lib/reader/StringReader.js +0 -38
- package/node_modules/jszip/lib/reader/Uint8ArrayReader.js +0 -22
- package/node_modules/jszip/lib/reader/readerFor.js +0 -28
- package/node_modules/jszip/lib/signature.js +0 -7
- package/node_modules/jszip/lib/stream/ConvertWorker.js +0 -26
- package/node_modules/jszip/lib/stream/Crc32Probe.js +0 -24
- package/node_modules/jszip/lib/stream/DataLengthProbe.js +0 -29
- package/node_modules/jszip/lib/stream/DataWorker.js +0 -116
- package/node_modules/jszip/lib/stream/GenericWorker.js +0 -263
- package/node_modules/jszip/lib/stream/StreamHelper.js +0 -214
- package/node_modules/jszip/lib/support.js +0 -38
- package/node_modules/jszip/lib/utf8.js +0 -275
- package/node_modules/jszip/lib/utils.js +0 -501
- package/node_modules/jszip/lib/zipEntries.js +0 -261
- package/node_modules/jszip/lib/zipEntry.js +0 -293
- package/node_modules/jszip/lib/zipObject.js +0 -133
- package/node_modules/jszip/node_modules/core-util-is/LICENSE +0 -19
- package/node_modules/jszip/node_modules/core-util-is/README.md +0 -3
- package/node_modules/jszip/node_modules/core-util-is/lib/util.js +0 -107
- package/node_modules/jszip/node_modules/core-util-is/package.json +0 -38
- package/node_modules/jszip/node_modules/immediate/LICENSE.txt +0 -20
- package/node_modules/jszip/node_modules/immediate/README.md +0 -93
- package/node_modules/jszip/node_modules/immediate/dist/immediate.js +0 -75
- package/node_modules/jszip/node_modules/immediate/dist/immediate.min.js +0 -1
- package/node_modules/jszip/node_modules/immediate/lib/browser.js +0 -69
- package/node_modules/jszip/node_modules/immediate/lib/index.js +0 -73
- package/node_modules/jszip/node_modules/immediate/package.json +0 -42
- package/node_modules/jszip/node_modules/inherits/LICENSE +0 -16
- package/node_modules/jszip/node_modules/inherits/README.md +0 -42
- package/node_modules/jszip/node_modules/inherits/inherits.js +0 -9
- package/node_modules/jszip/node_modules/inherits/inherits_browser.js +0 -27
- package/node_modules/jszip/node_modules/inherits/package.json +0 -29
- package/node_modules/jszip/node_modules/isarray/.npmignore +0 -1
- package/node_modules/jszip/node_modules/isarray/.travis.yml +0 -4
- package/node_modules/jszip/node_modules/isarray/Makefile +0 -6
- package/node_modules/jszip/node_modules/isarray/README.md +0 -60
- package/node_modules/jszip/node_modules/isarray/component.json +0 -19
- package/node_modules/jszip/node_modules/isarray/index.js +0 -5
- package/node_modules/jszip/node_modules/isarray/package.json +0 -45
- package/node_modules/jszip/node_modules/isarray/test.js +0 -20
- package/node_modules/jszip/node_modules/lie/README.md +0 -62
- package/node_modules/jszip/node_modules/lie/dist/lie.js +0 -350
- package/node_modules/jszip/node_modules/lie/dist/lie.min.js +0 -1
- package/node_modules/jszip/node_modules/lie/dist/lie.polyfill.js +0 -358
- package/node_modules/jszip/node_modules/lie/dist/lie.polyfill.min.js +0 -1
- package/node_modules/jszip/node_modules/lie/lib/browser.js +0 -273
- package/node_modules/jszip/node_modules/lie/lib/index.js +0 -298
- package/node_modules/jszip/node_modules/lie/license.md +0 -7
- package/node_modules/jszip/node_modules/lie/lie.d.ts +0 -244
- package/node_modules/jszip/node_modules/lie/package.json +0 -69
- package/node_modules/jszip/node_modules/lie/polyfill.js +0 -4
- package/node_modules/jszip/node_modules/pako/CHANGELOG.md +0 -164
- package/node_modules/jszip/node_modules/pako/LICENSE +0 -21
- package/node_modules/jszip/node_modules/pako/README.md +0 -191
- package/node_modules/jszip/node_modules/pako/dist/pako.js +0 -6818
- package/node_modules/jszip/node_modules/pako/dist/pako.min.js +0 -1
- package/node_modules/jszip/node_modules/pako/dist/pako_deflate.js +0 -3997
- package/node_modules/jszip/node_modules/pako/dist/pako_deflate.min.js +0 -1
- package/node_modules/jszip/node_modules/pako/dist/pako_inflate.js +0 -3300
- package/node_modules/jszip/node_modules/pako/dist/pako_inflate.min.js +0 -1
- package/node_modules/jszip/node_modules/pako/index.js +0 -14
- package/node_modules/jszip/node_modules/pako/lib/deflate.js +0 -400
- package/node_modules/jszip/node_modules/pako/lib/inflate.js +0 -423
- package/node_modules/jszip/node_modules/pako/lib/utils/common.js +0 -105
- package/node_modules/jszip/node_modules/pako/lib/utils/strings.js +0 -187
- package/node_modules/jszip/node_modules/pako/lib/zlib/README +0 -59
- package/node_modules/jszip/node_modules/pako/lib/zlib/adler32.js +0 -51
- package/node_modules/jszip/node_modules/pako/lib/zlib/constants.js +0 -68
- package/node_modules/jszip/node_modules/pako/lib/zlib/crc32.js +0 -59
- package/node_modules/jszip/node_modules/pako/lib/zlib/deflate.js +0 -1874
- package/node_modules/jszip/node_modules/pako/lib/zlib/gzheader.js +0 -58
- package/node_modules/jszip/node_modules/pako/lib/zlib/inffast.js +0 -345
- package/node_modules/jszip/node_modules/pako/lib/zlib/inflate.js +0 -1556
- package/node_modules/jszip/node_modules/pako/lib/zlib/inftrees.js +0 -343
- package/node_modules/jszip/node_modules/pako/lib/zlib/messages.js +0 -32
- package/node_modules/jszip/node_modules/pako/lib/zlib/trees.js +0 -1222
- package/node_modules/jszip/node_modules/pako/lib/zlib/zstream.js +0 -47
- package/node_modules/jszip/node_modules/pako/package.json +0 -44
- package/node_modules/jszip/node_modules/process-nextick-args/index.js +0 -45
- package/node_modules/jszip/node_modules/process-nextick-args/license.md +0 -19
- package/node_modules/jszip/node_modules/process-nextick-args/package.json +0 -25
- package/node_modules/jszip/node_modules/process-nextick-args/readme.md +0 -18
- package/node_modules/jszip/node_modules/readable-stream/.travis.yml +0 -34
- package/node_modules/jszip/node_modules/readable-stream/CONTRIBUTING.md +0 -38
- package/node_modules/jszip/node_modules/readable-stream/GOVERNANCE.md +0 -136
- package/node_modules/jszip/node_modules/readable-stream/LICENSE +0 -47
- package/node_modules/jszip/node_modules/readable-stream/README.md +0 -58
- package/node_modules/jszip/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +0 -60
- package/node_modules/jszip/node_modules/readable-stream/duplex-browser.js +0 -1
- package/node_modules/jszip/node_modules/readable-stream/duplex.js +0 -1
- package/node_modules/jszip/node_modules/readable-stream/lib/_stream_duplex.js +0 -131
- package/node_modules/jszip/node_modules/readable-stream/lib/_stream_passthrough.js +0 -47
- package/node_modules/jszip/node_modules/readable-stream/lib/_stream_readable.js +0 -1019
- package/node_modules/jszip/node_modules/readable-stream/lib/_stream_transform.js +0 -214
- package/node_modules/jszip/node_modules/readable-stream/lib/_stream_writable.js +0 -685
- package/node_modules/jszip/node_modules/readable-stream/lib/internal/streams/BufferList.js +0 -78
- package/node_modules/jszip/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -84
- package/node_modules/jszip/node_modules/readable-stream/lib/internal/streams/stream-browser.js +0 -1
- package/node_modules/jszip/node_modules/readable-stream/lib/internal/streams/stream.js +0 -1
- package/node_modules/jszip/node_modules/readable-stream/package.json +0 -52
- package/node_modules/jszip/node_modules/readable-stream/passthrough.js +0 -1
- package/node_modules/jszip/node_modules/readable-stream/readable-browser.js +0 -7
- package/node_modules/jszip/node_modules/readable-stream/readable.js +0 -19
- package/node_modules/jszip/node_modules/readable-stream/transform.js +0 -1
- package/node_modules/jszip/node_modules/readable-stream/writable-browser.js +0 -1
- package/node_modules/jszip/node_modules/readable-stream/writable.js +0 -8
- package/node_modules/jszip/node_modules/safe-buffer/LICENSE +0 -21
- package/node_modules/jszip/node_modules/safe-buffer/README.md +0 -584
- package/node_modules/jszip/node_modules/safe-buffer/index.d.ts +0 -187
- package/node_modules/jszip/node_modules/safe-buffer/index.js +0 -62
- package/node_modules/jszip/node_modules/safe-buffer/package.json +0 -37
- package/node_modules/jszip/node_modules/setimmediate/package.json +0 -30
- package/node_modules/jszip/node_modules/setimmediate/setImmediate.js +0 -186
- package/node_modules/jszip/node_modules/string_decoder/.travis.yml +0 -50
- package/node_modules/jszip/node_modules/string_decoder/LICENSE +0 -48
- package/node_modules/jszip/node_modules/string_decoder/README.md +0 -47
- package/node_modules/jszip/node_modules/string_decoder/lib/string_decoder.js +0 -296
- package/node_modules/jszip/node_modules/string_decoder/package.json +0 -31
- package/node_modules/jszip/node_modules/util-deprecate/History.md +0 -16
- package/node_modules/jszip/node_modules/util-deprecate/LICENSE +0 -24
- package/node_modules/jszip/node_modules/util-deprecate/README.md +0 -53
- package/node_modules/jszip/node_modules/util-deprecate/browser.js +0 -67
- package/node_modules/jszip/node_modules/util-deprecate/node.js +0 -6
- package/node_modules/jszip/node_modules/util-deprecate/package.json +0 -27
- package/node_modules/jszip/package.json +0 -67
- package/node_modules/jszip/sponsors.md +0 -21
- package/node_modules/jszip/tsconfig.json +0 -101
- package/node_modules/jszip/vendor/FileSaver.js +0 -247
- package/node_modules/pretty-ms/index.d.ts +0 -157
- package/node_modules/pretty-ms/index.js +0 -149
- package/node_modules/pretty-ms/license +0 -9
- package/node_modules/pretty-ms/node_modules/parse-ms/index.d.ts +0 -30
- package/node_modules/pretty-ms/node_modules/parse-ms/index.js +0 -45
- package/node_modules/pretty-ms/node_modules/parse-ms/license +0 -9
- package/node_modules/pretty-ms/node_modules/parse-ms/package.json +0 -47
- package/node_modules/pretty-ms/node_modules/parse-ms/readme.md +0 -46
- package/node_modules/pretty-ms/package.json +0 -55
- package/node_modules/pretty-ms/readme.md +0 -179
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
|
4
|
-
|
|
5
|
-
/* Projects */
|
|
6
|
-
// "incremental": true, /* Enable incremental compilation */
|
|
7
|
-
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
|
8
|
-
// "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */
|
|
9
|
-
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */
|
|
10
|
-
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
|
11
|
-
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
|
12
|
-
|
|
13
|
-
/* Language and Environment */
|
|
14
|
-
"target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
|
15
|
-
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
|
16
|
-
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
|
17
|
-
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
|
|
18
|
-
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
|
19
|
-
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */
|
|
20
|
-
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
|
21
|
-
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */
|
|
22
|
-
// "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */
|
|
23
|
-
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
|
24
|
-
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
|
25
|
-
|
|
26
|
-
/* Modules */
|
|
27
|
-
"module": "commonjs", /* Specify what module code is generated. */
|
|
28
|
-
// "rootDir": "./", /* Specify the root folder within your source files. */
|
|
29
|
-
// "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
|
|
30
|
-
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
|
31
|
-
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
32
|
-
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
33
|
-
// "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */
|
|
34
|
-
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
|
35
|
-
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
36
|
-
// "resolveJsonModule": true, /* Enable importing .json files */
|
|
37
|
-
// "noResolve": true, /* Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project. */
|
|
38
|
-
|
|
39
|
-
/* JavaScript Support */
|
|
40
|
-
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */
|
|
41
|
-
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
|
42
|
-
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */
|
|
43
|
-
|
|
44
|
-
/* Emit */
|
|
45
|
-
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
|
46
|
-
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
47
|
-
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
48
|
-
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
|
49
|
-
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
|
|
50
|
-
// "outDir": "./", /* Specify an output folder for all emitted files. */
|
|
51
|
-
// "removeComments": true, /* Disable emitting comments. */
|
|
52
|
-
"noEmit": true, /* Disable emitting files from a compilation. */
|
|
53
|
-
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
54
|
-
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
|
|
55
|
-
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
|
56
|
-
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
|
57
|
-
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
58
|
-
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
|
59
|
-
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
|
60
|
-
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
|
61
|
-
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
|
62
|
-
// "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */
|
|
63
|
-
// "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */
|
|
64
|
-
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
|
65
|
-
// "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */
|
|
66
|
-
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
|
67
|
-
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
|
68
|
-
|
|
69
|
-
/* Interop Constraints */
|
|
70
|
-
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
|
71
|
-
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
72
|
-
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */
|
|
73
|
-
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
74
|
-
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
|
75
|
-
|
|
76
|
-
/* Type Checking */
|
|
77
|
-
"strict": true, /* Enable all strict type-checking options. */
|
|
78
|
-
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */
|
|
79
|
-
// "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */
|
|
80
|
-
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
|
81
|
-
// "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */
|
|
82
|
-
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
|
83
|
-
// "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */
|
|
84
|
-
// "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */
|
|
85
|
-
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
|
86
|
-
// "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */
|
|
87
|
-
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */
|
|
88
|
-
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
|
89
|
-
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
|
90
|
-
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
|
91
|
-
// "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
|
|
92
|
-
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
|
93
|
-
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */
|
|
94
|
-
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
|
95
|
-
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
|
96
|
-
|
|
97
|
-
/* Completeness */
|
|
98
|
-
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
99
|
-
// "skipLibCheck": true /* Skip type checking all .d.ts files. */
|
|
100
|
-
}
|
|
101
|
-
}
|
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
/*! FileSaver.js
|
|
2
|
-
* A saveAs() FileSaver implementation.
|
|
3
|
-
* 2014-01-24
|
|
4
|
-
*
|
|
5
|
-
* By Eli Grey, http://eligrey.com
|
|
6
|
-
* License: X11/MIT
|
|
7
|
-
* See LICENSE.md
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/*global self */
|
|
11
|
-
/*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */
|
|
12
|
-
|
|
13
|
-
/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/main/FileSaver.js */
|
|
14
|
-
|
|
15
|
-
var saveAs = saveAs
|
|
16
|
-
// IE 10+ (native saveAs)
|
|
17
|
-
|| (typeof navigator !== "undefined" &&
|
|
18
|
-
navigator.msSaveOrOpenBlob && navigator.msSaveOrOpenBlob.bind(navigator))
|
|
19
|
-
// Everyone else
|
|
20
|
-
|| (function(view) {
|
|
21
|
-
"use strict";
|
|
22
|
-
// IE <10 is explicitly unsupported
|
|
23
|
-
if (typeof navigator !== "undefined" &&
|
|
24
|
-
/MSIE [1-9]\./.test(navigator.userAgent)) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
var
|
|
28
|
-
doc = view.document
|
|
29
|
-
// only get URL when necessary in case BlobBuilder.js hasn't overridden it yet
|
|
30
|
-
, get_URL = function() {
|
|
31
|
-
return view.URL || view.webkitURL || view;
|
|
32
|
-
}
|
|
33
|
-
, URL = view.URL || view.webkitURL || view
|
|
34
|
-
, save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a")
|
|
35
|
-
, can_use_save_link = !view.externalHost && "download" in save_link
|
|
36
|
-
, click = function(node) {
|
|
37
|
-
var event = doc.createEvent("MouseEvents");
|
|
38
|
-
event.initMouseEvent(
|
|
39
|
-
"click", true, false, view, 0, 0, 0, 0, 0
|
|
40
|
-
, false, false, false, false, 0, null
|
|
41
|
-
);
|
|
42
|
-
node.dispatchEvent(event);
|
|
43
|
-
}
|
|
44
|
-
, webkit_req_fs = view.webkitRequestFileSystem
|
|
45
|
-
, req_fs = view.requestFileSystem || webkit_req_fs || view.mozRequestFileSystem
|
|
46
|
-
, throw_outside = function(ex) {
|
|
47
|
-
(view.setImmediate || view.setTimeout)(function() {
|
|
48
|
-
throw ex;
|
|
49
|
-
}, 0);
|
|
50
|
-
}
|
|
51
|
-
, force_saveable_type = "application/octet-stream"
|
|
52
|
-
, fs_min_size = 0
|
|
53
|
-
, deletion_queue = []
|
|
54
|
-
, process_deletion_queue = function() {
|
|
55
|
-
var i = deletion_queue.length;
|
|
56
|
-
while (i--) {
|
|
57
|
-
var file = deletion_queue[i];
|
|
58
|
-
if (typeof file === "string") { // file is an object URL
|
|
59
|
-
URL.revokeObjectURL(file);
|
|
60
|
-
} else { // file is a File
|
|
61
|
-
file.remove();
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
deletion_queue.length = 0; // clear queue
|
|
65
|
-
}
|
|
66
|
-
, dispatch = function(filesaver, event_types, event) {
|
|
67
|
-
event_types = [].concat(event_types);
|
|
68
|
-
var i = event_types.length;
|
|
69
|
-
while (i--) {
|
|
70
|
-
var listener = filesaver["on" + event_types[i]];
|
|
71
|
-
if (typeof listener === "function") {
|
|
72
|
-
try {
|
|
73
|
-
listener.call(filesaver, event || filesaver);
|
|
74
|
-
} catch (ex) {
|
|
75
|
-
throw_outside(ex);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
, FileSaver = function(blob, name) {
|
|
81
|
-
// First try a.download, then web filesystem, then object URLs
|
|
82
|
-
var
|
|
83
|
-
filesaver = this
|
|
84
|
-
, type = blob.type
|
|
85
|
-
, blob_changed = false
|
|
86
|
-
, object_url
|
|
87
|
-
, target_view
|
|
88
|
-
, get_object_url = function() {
|
|
89
|
-
var object_url = get_URL().createObjectURL(blob);
|
|
90
|
-
deletion_queue.push(object_url);
|
|
91
|
-
return object_url;
|
|
92
|
-
}
|
|
93
|
-
, dispatch_all = function() {
|
|
94
|
-
dispatch(filesaver, "writestart progress write writeend".split(" "));
|
|
95
|
-
}
|
|
96
|
-
// on any filesys errors revert to saving with object URLs
|
|
97
|
-
, fs_error = function() {
|
|
98
|
-
// don't create more object URLs than needed
|
|
99
|
-
if (blob_changed || !object_url) {
|
|
100
|
-
object_url = get_object_url(blob);
|
|
101
|
-
}
|
|
102
|
-
if (target_view) {
|
|
103
|
-
target_view.location.href = object_url;
|
|
104
|
-
} else {
|
|
105
|
-
window.open(object_url, "_blank");
|
|
106
|
-
}
|
|
107
|
-
filesaver.readyState = filesaver.DONE;
|
|
108
|
-
dispatch_all();
|
|
109
|
-
}
|
|
110
|
-
, abortable = function(func) {
|
|
111
|
-
return function() {
|
|
112
|
-
if (filesaver.readyState !== filesaver.DONE) {
|
|
113
|
-
return func.apply(this, arguments);
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
, create_if_not_found = {create: true, exclusive: false}
|
|
118
|
-
, slice
|
|
119
|
-
;
|
|
120
|
-
filesaver.readyState = filesaver.INIT;
|
|
121
|
-
if (!name) {
|
|
122
|
-
name = "download";
|
|
123
|
-
}
|
|
124
|
-
if (can_use_save_link) {
|
|
125
|
-
object_url = get_object_url(blob);
|
|
126
|
-
// FF for Android has a nasty garbage collection mechanism
|
|
127
|
-
// that turns all objects that are not pure javascript into 'deadObject'
|
|
128
|
-
// this means `doc` and `save_link` are unusable and need to be recreated
|
|
129
|
-
// `view` is usable though:
|
|
130
|
-
doc = view.document;
|
|
131
|
-
save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a");
|
|
132
|
-
save_link.href = object_url;
|
|
133
|
-
save_link.download = name;
|
|
134
|
-
var event = doc.createEvent("MouseEvents");
|
|
135
|
-
event.initMouseEvent(
|
|
136
|
-
"click", true, false, view, 0, 0, 0, 0, 0
|
|
137
|
-
, false, false, false, false, 0, null
|
|
138
|
-
);
|
|
139
|
-
save_link.dispatchEvent(event);
|
|
140
|
-
filesaver.readyState = filesaver.DONE;
|
|
141
|
-
dispatch_all();
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
// Object and web filesystem URLs have a problem saving in Google Chrome when
|
|
145
|
-
// viewed in a tab, so I force save with application/octet-stream
|
|
146
|
-
// http://code.google.com/p/chromium/issues/detail?id=91158
|
|
147
|
-
if (view.chrome && type && type !== force_saveable_type) {
|
|
148
|
-
slice = blob.slice || blob.webkitSlice;
|
|
149
|
-
blob = slice.call(blob, 0, blob.size, force_saveable_type);
|
|
150
|
-
blob_changed = true;
|
|
151
|
-
}
|
|
152
|
-
// Since I can't be sure that the guessed media type will trigger a download
|
|
153
|
-
// in WebKit, I append .download to the filename.
|
|
154
|
-
// https://bugs.webkit.org/show_bug.cgi?id=65440
|
|
155
|
-
if (webkit_req_fs && name !== "download") {
|
|
156
|
-
name += ".download";
|
|
157
|
-
}
|
|
158
|
-
if (type === force_saveable_type || webkit_req_fs) {
|
|
159
|
-
target_view = view;
|
|
160
|
-
}
|
|
161
|
-
if (!req_fs) {
|
|
162
|
-
fs_error();
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
fs_min_size += blob.size;
|
|
166
|
-
req_fs(view.TEMPORARY, fs_min_size, abortable(function(fs) {
|
|
167
|
-
fs.root.getDirectory("saved", create_if_not_found, abortable(function(dir) {
|
|
168
|
-
var save = function() {
|
|
169
|
-
dir.getFile(name, create_if_not_found, abortable(function(file) {
|
|
170
|
-
file.createWriter(abortable(function(writer) {
|
|
171
|
-
writer.onwriteend = function(event) {
|
|
172
|
-
target_view.location.href = file.toURL();
|
|
173
|
-
deletion_queue.push(file);
|
|
174
|
-
filesaver.readyState = filesaver.DONE;
|
|
175
|
-
dispatch(filesaver, "writeend", event);
|
|
176
|
-
};
|
|
177
|
-
writer.onerror = function() {
|
|
178
|
-
var error = writer.error;
|
|
179
|
-
if (error.code !== error.ABORT_ERR) {
|
|
180
|
-
fs_error();
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
"writestart progress write abort".split(" ").forEach(function(event) {
|
|
184
|
-
writer["on" + event] = filesaver["on" + event];
|
|
185
|
-
});
|
|
186
|
-
writer.write(blob);
|
|
187
|
-
filesaver.abort = function() {
|
|
188
|
-
writer.abort();
|
|
189
|
-
filesaver.readyState = filesaver.DONE;
|
|
190
|
-
};
|
|
191
|
-
filesaver.readyState = filesaver.WRITING;
|
|
192
|
-
}), fs_error);
|
|
193
|
-
}), fs_error);
|
|
194
|
-
};
|
|
195
|
-
dir.getFile(name, {create: false}, abortable(function(file) {
|
|
196
|
-
// delete file if it already exists
|
|
197
|
-
file.remove();
|
|
198
|
-
save();
|
|
199
|
-
}), abortable(function(ex) {
|
|
200
|
-
if (ex.code === ex.NOT_FOUND_ERR) {
|
|
201
|
-
save();
|
|
202
|
-
} else {
|
|
203
|
-
fs_error();
|
|
204
|
-
}
|
|
205
|
-
}));
|
|
206
|
-
}), fs_error);
|
|
207
|
-
}), fs_error);
|
|
208
|
-
}
|
|
209
|
-
, FS_proto = FileSaver.prototype
|
|
210
|
-
, saveAs = function(blob, name) {
|
|
211
|
-
return new FileSaver(blob, name);
|
|
212
|
-
}
|
|
213
|
-
;
|
|
214
|
-
FS_proto.abort = function() {
|
|
215
|
-
var filesaver = this;
|
|
216
|
-
filesaver.readyState = filesaver.DONE;
|
|
217
|
-
dispatch(filesaver, "abort");
|
|
218
|
-
};
|
|
219
|
-
FS_proto.readyState = FS_proto.INIT = 0;
|
|
220
|
-
FS_proto.WRITING = 1;
|
|
221
|
-
FS_proto.DONE = 2;
|
|
222
|
-
|
|
223
|
-
FS_proto.error =
|
|
224
|
-
FS_proto.onwritestart =
|
|
225
|
-
FS_proto.onprogress =
|
|
226
|
-
FS_proto.onwrite =
|
|
227
|
-
FS_proto.onabort =
|
|
228
|
-
FS_proto.onerror =
|
|
229
|
-
FS_proto.onwriteend =
|
|
230
|
-
null;
|
|
231
|
-
|
|
232
|
-
view.addEventListener("unload", process_deletion_queue, false);
|
|
233
|
-
saveAs.unload = function() {
|
|
234
|
-
process_deletion_queue();
|
|
235
|
-
view.removeEventListener("unload", process_deletion_queue, false);
|
|
236
|
-
};
|
|
237
|
-
return saveAs;
|
|
238
|
-
}(
|
|
239
|
-
typeof self !== "undefined" && self
|
|
240
|
-
|| typeof window !== "undefined" && window
|
|
241
|
-
|| this.content
|
|
242
|
-
));
|
|
243
|
-
// `self` is undefined in Firefox for Android content script context
|
|
244
|
-
// while `this` is nsIContentFrameMessageManager
|
|
245
|
-
// with an attribute `content` that corresponds to the window
|
|
246
|
-
|
|
247
|
-
if (typeof module !== "undefined") module.exports = saveAs;
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
export type Options = {
|
|
2
|
-
/**
|
|
3
|
-
Number of digits to appear after the seconds decimal point.
|
|
4
|
-
|
|
5
|
-
@default 1
|
|
6
|
-
*/
|
|
7
|
-
readonly secondsDecimalDigits?: number;
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
Number of digits to appear after the milliseconds decimal point.
|
|
11
|
-
|
|
12
|
-
Useful in combination with [`process.hrtime()`](https://nodejs.org/api/process.html#process_process_hrtime).
|
|
13
|
-
|
|
14
|
-
@default 0
|
|
15
|
-
*/
|
|
16
|
-
readonly millisecondsDecimalDigits?: number;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
Keep milliseconds on whole seconds: `13s` → `13.0s`.
|
|
20
|
-
|
|
21
|
-
Useful when you are showing a number of seconds spent on an operation and don't want the width of the output to change when hitting a whole number.
|
|
22
|
-
|
|
23
|
-
@default false
|
|
24
|
-
*/
|
|
25
|
-
readonly keepDecimalsOnWholeSeconds?: boolean;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
Only show the first unit: `1h 10m` → `1h`.
|
|
29
|
-
|
|
30
|
-
Also ensures that `millisecondsDecimalDigits` and `secondsDecimalDigits` are both set to `0`.
|
|
31
|
-
|
|
32
|
-
@default false
|
|
33
|
-
*/
|
|
34
|
-
readonly compact?: boolean;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
Number of units to show. Setting `compact` to `true` overrides this option.
|
|
38
|
-
|
|
39
|
-
@default Infinity
|
|
40
|
-
*/
|
|
41
|
-
readonly unitCount?: number;
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
Use full-length units: `5h 1m 45s` → `5 hours 1 minute 45 seconds`.
|
|
45
|
-
|
|
46
|
-
@default false
|
|
47
|
-
*/
|
|
48
|
-
readonly verbose?: boolean;
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
Show milliseconds separately. This means they won't be included in the decimal part of the seconds.
|
|
52
|
-
|
|
53
|
-
@default false
|
|
54
|
-
*/
|
|
55
|
-
readonly separateMilliseconds?: boolean;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
Show microseconds and nanoseconds.
|
|
59
|
-
|
|
60
|
-
@default false
|
|
61
|
-
*/
|
|
62
|
-
readonly formatSubMilliseconds?: boolean;
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
Display time using colon notation: `5h 1m 45s` → `5:01:45`. Always shows time in at least minutes: `1s` → `0:01`
|
|
66
|
-
|
|
67
|
-
Useful when you want to display time without the time units, similar to a digital watch.
|
|
68
|
-
|
|
69
|
-
Setting `colonNotation` to `true` overrides the following options to `false`:
|
|
70
|
-
- `compact`
|
|
71
|
-
- `formatSubMilliseconds`
|
|
72
|
-
- `separateMilliseconds`
|
|
73
|
-
- `verbose`
|
|
74
|
-
|
|
75
|
-
@default false
|
|
76
|
-
*/
|
|
77
|
-
readonly colonNotation?: boolean;
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
Hides the year and shows the hidden year additionally as days (365 per year): `1y 3d 5h 1m 45s` → `368d 5h 1m 45s`.
|
|
81
|
-
|
|
82
|
-
@default false
|
|
83
|
-
*/
|
|
84
|
-
readonly hideYear?: boolean;
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
Hides the year and days and shows the hidden values additionally as hours: `1y 3d 5h 1m 45s` → `8837h 1m 45s`.
|
|
88
|
-
|
|
89
|
-
@default false
|
|
90
|
-
*/
|
|
91
|
-
readonly hideYearAndDays?: boolean;
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
Hides the seconds: `1y 3d 5h 1m 45s` → `1y 3d 5h 1m`.
|
|
95
|
-
|
|
96
|
-
@default false
|
|
97
|
-
*/
|
|
98
|
-
readonly hideSeconds?: boolean;
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
Show sub-second values as decimal seconds: `900ms` → `0.9s`.
|
|
102
|
-
|
|
103
|
-
Useful for progress indicators where you want consistent unit format to prevent flickering.
|
|
104
|
-
|
|
105
|
-
@default false
|
|
106
|
-
*/
|
|
107
|
-
readonly subSecondsAsDecimals?: boolean;
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
Convert milliseconds to a human readable string: `1337000000` → `15d 11h 23m 20s`.
|
|
112
|
-
|
|
113
|
-
@param milliseconds - Milliseconds to humanize.
|
|
114
|
-
|
|
115
|
-
@example
|
|
116
|
-
```
|
|
117
|
-
import prettyMilliseconds from 'pretty-ms';
|
|
118
|
-
|
|
119
|
-
prettyMilliseconds(1337000000);
|
|
120
|
-
//=> '15d 11h 23m 20s'
|
|
121
|
-
|
|
122
|
-
prettyMilliseconds(1337);
|
|
123
|
-
//=> '1.3s'
|
|
124
|
-
|
|
125
|
-
prettyMilliseconds(133);
|
|
126
|
-
//=> '133ms'
|
|
127
|
-
|
|
128
|
-
// `compact` option
|
|
129
|
-
prettyMilliseconds(1337, {compact: true});
|
|
130
|
-
//=> '1s'
|
|
131
|
-
|
|
132
|
-
// `verbose` option
|
|
133
|
-
prettyMilliseconds(1335669000, {verbose: true});
|
|
134
|
-
//=> '15 days 11 hours 1 minute 9 seconds'
|
|
135
|
-
|
|
136
|
-
// `colonNotation` option
|
|
137
|
-
prettyMilliseconds(95500, {colonNotation: true});
|
|
138
|
-
//=> '1:35.5'
|
|
139
|
-
|
|
140
|
-
// `formatSubMilliseconds` option
|
|
141
|
-
prettyMilliseconds(100.400080, {formatSubMilliseconds: true})
|
|
142
|
-
//=> '100ms 400µs 80ns'
|
|
143
|
-
|
|
144
|
-
// `subSecondsAsDecimals` option
|
|
145
|
-
prettyMilliseconds(900, {subSecondsAsDecimals: true});
|
|
146
|
-
//=> '0.9s'
|
|
147
|
-
|
|
148
|
-
// Can be useful for time durations
|
|
149
|
-
prettyMilliseconds(new Date(2014, 0, 1, 10, 40) - new Date(2014, 0, 1, 10, 5))
|
|
150
|
-
//=> '35m'
|
|
151
|
-
```
|
|
152
|
-
*/
|
|
153
|
-
export default function prettyMilliseconds(
|
|
154
|
-
milliseconds: number | bigint,
|
|
155
|
-
options?: Options
|
|
156
|
-
): string;
|
|
157
|
-
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import parseMilliseconds from 'parse-ms';
|
|
2
|
-
|
|
3
|
-
const isZero = value => value === 0 || value === 0n;
|
|
4
|
-
const pluralize = (word, count) => (count === 1 || count === 1n) ? word : `${word}s`;
|
|
5
|
-
|
|
6
|
-
const SECOND_ROUNDING_EPSILON = 0.000_000_1;
|
|
7
|
-
const ONE_DAY_IN_MILLISECONDS = 24n * 60n * 60n * 1000n;
|
|
8
|
-
|
|
9
|
-
export default function prettyMilliseconds(milliseconds, options) {
|
|
10
|
-
const isBigInt = typeof milliseconds === 'bigint';
|
|
11
|
-
if (!isBigInt && !Number.isFinite(milliseconds)) {
|
|
12
|
-
throw new TypeError('Expected a finite number or bigint');
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
options = {...options};
|
|
16
|
-
|
|
17
|
-
const sign = milliseconds < 0 ? '-' : '';
|
|
18
|
-
milliseconds = milliseconds < 0 ? -milliseconds : milliseconds; // Cannot use `Math.abs()` because of BigInt support.
|
|
19
|
-
|
|
20
|
-
if (options.colonNotation) {
|
|
21
|
-
options.compact = false;
|
|
22
|
-
options.formatSubMilliseconds = false;
|
|
23
|
-
options.separateMilliseconds = false;
|
|
24
|
-
options.verbose = false;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (options.compact) {
|
|
28
|
-
options.unitCount = 1;
|
|
29
|
-
options.secondsDecimalDigits = 0;
|
|
30
|
-
options.millisecondsDecimalDigits = 0;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
let result = [];
|
|
34
|
-
|
|
35
|
-
const floorDecimals = (value, decimalDigits) => {
|
|
36
|
-
const flooredInterimValue = Math.floor((value * (10 ** decimalDigits)) + SECOND_ROUNDING_EPSILON);
|
|
37
|
-
const flooredValue = Math.round(flooredInterimValue) / (10 ** decimalDigits);
|
|
38
|
-
return flooredValue.toFixed(decimalDigits);
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const add = (value, long, short, valueString) => {
|
|
42
|
-
if (
|
|
43
|
-
(result.length === 0 || !options.colonNotation)
|
|
44
|
-
&& isZero(value)
|
|
45
|
-
&& !(options.colonNotation && short === 'm')) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
valueString ??= String(value);
|
|
50
|
-
if (options.colonNotation) {
|
|
51
|
-
const wholeDigits = valueString.includes('.') ? valueString.split('.')[0].length : valueString.length;
|
|
52
|
-
const minLength = result.length > 0 ? 2 : 1;
|
|
53
|
-
valueString = '0'.repeat(Math.max(0, minLength - wholeDigits)) + valueString;
|
|
54
|
-
} else {
|
|
55
|
-
valueString += options.verbose ? ' ' + pluralize(long, value) : short;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
result.push(valueString);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const parsed = parseMilliseconds(milliseconds);
|
|
62
|
-
const days = BigInt(parsed.days);
|
|
63
|
-
|
|
64
|
-
if (options.hideYearAndDays) {
|
|
65
|
-
add((BigInt(days) * 24n) + BigInt(parsed.hours), 'hour', 'h');
|
|
66
|
-
} else {
|
|
67
|
-
if (options.hideYear) {
|
|
68
|
-
add(days, 'day', 'd');
|
|
69
|
-
} else {
|
|
70
|
-
add(days / 365n, 'year', 'y');
|
|
71
|
-
add(days % 365n, 'day', 'd');
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
add(Number(parsed.hours), 'hour', 'h');
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
add(Number(parsed.minutes), 'minute', 'm');
|
|
78
|
-
|
|
79
|
-
if (!options.hideSeconds) {
|
|
80
|
-
if (
|
|
81
|
-
options.separateMilliseconds
|
|
82
|
-
|| options.formatSubMilliseconds
|
|
83
|
-
|| (!options.colonNotation && milliseconds < 1000 && !options.subSecondsAsDecimals)
|
|
84
|
-
) {
|
|
85
|
-
const seconds = Number(parsed.seconds);
|
|
86
|
-
const milliseconds = Number(parsed.milliseconds);
|
|
87
|
-
const microseconds = Number(parsed.microseconds);
|
|
88
|
-
const nanoseconds = Number(parsed.nanoseconds);
|
|
89
|
-
|
|
90
|
-
add(seconds, 'second', 's');
|
|
91
|
-
|
|
92
|
-
if (options.formatSubMilliseconds) {
|
|
93
|
-
add(milliseconds, 'millisecond', 'ms');
|
|
94
|
-
add(microseconds, 'microsecond', 'µs');
|
|
95
|
-
add(nanoseconds, 'nanosecond', 'ns');
|
|
96
|
-
} else {
|
|
97
|
-
const millisecondsAndBelow
|
|
98
|
-
= milliseconds
|
|
99
|
-
+ (microseconds / 1000)
|
|
100
|
-
+ (nanoseconds / 1e6);
|
|
101
|
-
|
|
102
|
-
const millisecondsDecimalDigits
|
|
103
|
-
= typeof options.millisecondsDecimalDigits === 'number'
|
|
104
|
-
? options.millisecondsDecimalDigits
|
|
105
|
-
: 0;
|
|
106
|
-
|
|
107
|
-
const roundedMilliseconds = millisecondsAndBelow >= 1
|
|
108
|
-
? Math.round(millisecondsAndBelow)
|
|
109
|
-
: Math.ceil(millisecondsAndBelow);
|
|
110
|
-
|
|
111
|
-
const millisecondsString = millisecondsDecimalDigits
|
|
112
|
-
? millisecondsAndBelow.toFixed(millisecondsDecimalDigits)
|
|
113
|
-
: roundedMilliseconds;
|
|
114
|
-
|
|
115
|
-
add(
|
|
116
|
-
Number.parseFloat(millisecondsString),
|
|
117
|
-
'millisecond',
|
|
118
|
-
'ms',
|
|
119
|
-
millisecondsString,
|
|
120
|
-
);
|
|
121
|
-
}
|
|
122
|
-
} else {
|
|
123
|
-
const seconds = (
|
|
124
|
-
(isBigInt ? Number(milliseconds % ONE_DAY_IN_MILLISECONDS) : milliseconds)
|
|
125
|
-
/ 1000
|
|
126
|
-
) % 60;
|
|
127
|
-
const secondsDecimalDigits
|
|
128
|
-
= typeof options.secondsDecimalDigits === 'number'
|
|
129
|
-
? options.secondsDecimalDigits
|
|
130
|
-
: 1;
|
|
131
|
-
const secondsFixed = floorDecimals(seconds, secondsDecimalDigits);
|
|
132
|
-
const secondsString = options.keepDecimalsOnWholeSeconds
|
|
133
|
-
? secondsFixed
|
|
134
|
-
: secondsFixed.replace(/\.0+$/, '');
|
|
135
|
-
add(Number.parseFloat(secondsString), 'second', 's', secondsString);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
if (result.length === 0) {
|
|
140
|
-
return sign + '0' + (options.verbose ? ' milliseconds' : 'ms');
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
const separator = options.colonNotation ? ':' : ' ';
|
|
144
|
-
if (typeof options.unitCount === 'number') {
|
|
145
|
-
result = result.slice(0, Math.max(options.unitCount, 1));
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
return sign + result.join(separator);
|
|
149
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
-
|
|
7
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
-
|
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|