@drovp/save-as-path
Advanced tools
Comparing version 2.0.2 to 3.0.0
@@ -26,2 +26,2 @@ export { TemplateError } from 'expand-template-literal'; | ||
export declare function checkSaveAsPathOptions({ destination, extraVariables }: SaveAsPathOptions): true; | ||
export declare const uid: (size?: number) => string; | ||
export declare const UID: (size?: number) => string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.uid = exports.checkSaveAsPathOptions = exports.saveAsPath = exports.makeOptionSchema = exports.TemplateError = void 0; | ||
exports.UID = exports.checkSaveAsPathOptions = exports.saveAsPath = exports.makeOptionSchema = exports.TemplateError = void 0; | ||
const Path = require("path"); | ||
@@ -94,3 +94,3 @@ const fs_1 = require("fs"); | ||
async function saveAsPath(inputPath, tmpPath, outputExtension, options = {}) { | ||
var _a, _b; | ||
var _a; | ||
try { | ||
@@ -152,3 +152,3 @@ await fs_1.promises.access(tmpPath); | ||
catch (error) { | ||
if (((_b = error) === null || _b === void 0 ? void 0 : _b.code) !== 'EXDEV') | ||
if ((error === null || error === void 0 ? void 0 : error.code) !== 'EXDEV') | ||
throw error; | ||
@@ -192,4 +192,4 @@ await fs_1.promises.cp(tmpPath, outputPath, { recursive: true }); | ||
dirbasename: Path.basename(dirname), | ||
time: dayjs, | ||
uid: exports.uid, | ||
Time: dayjs, | ||
UID: exports.UID, | ||
...extraVariables, | ||
@@ -210,7 +210,7 @@ }; | ||
} | ||
const uid = (size = 10) => Array(size) | ||
const UID = (size = 10) => Array(size) | ||
.fill(0) | ||
.map(() => Math.floor(Math.random() * 36).toString(36)) | ||
.join(''); | ||
exports.uid = uid; | ||
exports.UID = UID; | ||
function formatDestinationSelection(path, oldPath) { | ||
@@ -217,0 +217,0 @@ const oldPathParts = (oldPath || '').split(/\\|\//); |
{ | ||
"name": "@drovp/save-as-path", | ||
"version": "2.0.2", | ||
"version": "3.0.0", | ||
"description": "Drovp utility to determine path for file results.", | ||
@@ -46,13 +46,13 @@ "homepage": "https://github.com/drovp/save-as-path", | ||
"devDependencies": { | ||
"@types/node": "^16.11.12", | ||
"ava": "^3.15.0", | ||
"@types/node": "^18.0.6", | ||
"ava": "^4.3.1", | ||
"npm-run-all": "^4.1.5", | ||
"rimraf": "^3.0.2", | ||
"ts-node": "^10.4.0", | ||
"tslib": "^2.3.1", | ||
"typescript": "^4.5.3" | ||
"ts-node": "^10.9.1", | ||
"tslib": "^2.4.0", | ||
"typescript": "^4.7.4" | ||
}, | ||
"dependencies": { | ||
"@tomasklaen/checksum": "^1.0.1", | ||
"dayjs": "^1.10.7", | ||
"@tomasklaen/checksum": "^1.1.0", | ||
"dayjs": "^1.11.4", | ||
"expand-template-literal": "^1.0.3", | ||
@@ -59,0 +59,0 @@ "platform-paths": "^1.2.2", |
@@ -222,4 +222,4 @@ # @drovp/save-as-path | ||
- Utilities: | ||
- **`time()`** - [day.js](https://day.js.org/docs/en/display/format) util to help with time. Example: `${time().format('YY')}` | ||
- **`uid(size? = 10)`** - unique string generator, size is optional, default is 10. Example: `${uid()}` | ||
- **`Time()`** - [day.js](https://day.js.org/docs/en/display/format) util to help with time. Example: `${Time().format('YY')}` | ||
- **`UID(size? = 10)`** - unique string generator, size is optional, default is 10. Example: `${UID()}` | ||
@@ -226,0 +226,0 @@ You can add more variables with `extraVariables` option below. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22522
Updated@tomasklaen/checksum@^1.1.0
Updateddayjs@^1.11.4