files-pipe
Advanced tools
Comparing version 2.0.4 to 2.0.5
{ | ||
"name": "files-pipe", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"homepage": "https://github.com/baxast/files-pipe#readme", | ||
@@ -5,0 +5,0 @@ "bugs": { |
@@ -18,3 +18,3 @@ # [files-pipe] 🧪 | ||
await new Files().In("./input"); | ||
await new Files().In("./Input"); | ||
``` | ||
@@ -21,0 +21,0 @@ |
import type { Pattern } from "fast-glob"; | ||
import type { Executions, Options, Plan } from "../Option/Index.js"; | ||
import type { Execution, Options, Plan } from "../Option/Index.js"; | ||
export default class Files { | ||
Pipe: (Callbacks?: Executions) => Promise<Plan>; | ||
Pipe: (Execution?: Execution) => Promise<Plan>; | ||
Not: (File: Options["Exclude"]) => Promise<this>; | ||
@@ -6,0 +6,0 @@ By: (File?: Pattern | Pattern[]) => Promise<this>; |
@@ -1,1 +0,1 @@ | ||
import{fileURLToPath as s}from"url";import a from"../Apply.js";var r=async(e,o)=>{const n=await a(t=>t.endsWith("/")?t:`${t}/`,await a(t=>t instanceof URL?s(t):t,e));if(n instanceof Map)for(const[t,i]of n)o.set(t,i);else o.set(n,n);return o};export{r as default}; | ||
import{fileURLToPath as r}from"url";import a from"../Apply.js";var f=async(e,o)=>{const n=await a(t=>t.endsWith("/")?t:`${t}/`,await a(t=>t instanceof URL?r(t):t,e));if(n instanceof Map)for(const[t,i]of n)o.set(t,i);else o.set(n,n);return o};export{f as default}; |
@@ -1,3 +0,3 @@ | ||
import type { Executions, Plan } from "../../Option/Index.js"; | ||
declare const _default: (Plan: Plan, { Fulfilled, Failed, Accomplished, Changed, Passed, Read, Wrote, }: Executions) => Promise<Plan>; | ||
import type { Execution, Plan } from "../../Option/Index.js"; | ||
declare const _default: (Plan: Plan, { Fulfilled, Failed, Accomplished, Changed, Passed, Read, Wrote, }: Execution) => Promise<Plan>; | ||
export default _default; |
@@ -1,1 +0,1 @@ | ||
import{constants as w}from"fs";import{access as m,writeFile as y,mkdir as B,stat as c}from"fs/promises";import{dirname as l}from"path";var E=async(p,{Fulfilled:a,Failed:s,Accomplished:o,Changed:f,Passed:u,Read:r,Wrote:O})=>{let t=p;for(const[e,g]of t.Results)try{if(t.On.Input=g,t.On.Output=e,t.On.Before=(await c(t.On.Input)).size,r&&O){t.On.Buffer=await r(t.On);const i=await O(t.On);if(!i)continue;if(t.On.Buffer=i,u&&await u(t.On)){try{await m(l(t.On.Output),w.W_OK)}catch{await B(l(t.On.Output),{recursive:!0})}if(await y(t.On.Output,t.On.Buffer,"utf-8"),t.On.After=(await c(t.On.Output)).size,t.Debug>0&&(t.Files++,f&&(t=await f(t))),t.Debug>1&&typeof o=="function"){const n=await o(t.On);n&&n.length>0&&console.log(n)}}}}catch(i){if(t.Results.delete(e),typeof s=="function"){const n=await s(t.On,i);n&&n.length>0&&console.log(n)}else t.Debug>1&&console.log(i)}if(t.Debug>0&&t.Results.size>0&&typeof a=="function"){const e=await a(t);e&&e.length>0&&console.log(e)}return t};export{E as default}; | ||
import{constants as w}from"fs";import{access as m,writeFile as y,mkdir as B,stat as c}from"fs/promises";import{dirname as l}from"path";var E=async(p,{Fulfilled:a,Failed:o,Accomplished:s,Changed:f,Passed:u,Read:r,Wrote:O})=>{let t=p;for(const[e,g]of t.Results)try{if(t.On.Input=g,t.On.Output=e,t.On.Before=(await c(t.On.Input)).size,r&&O){t.On.Buffer=await r(t.On);const i=await O(t.On);if(!i)continue;if(t.On.Buffer=i,u&&await u(t.On)){try{await m(l(t.On.Output),w.W_OK)}catch{await B(l(t.On.Output),{recursive:!0})}if(await y(t.On.Output,t.On.Buffer,"utf-8"),t.On.After=(await c(t.On.Output)).size,t.Debug>0&&(t.Files++,f&&(t=await f(t))),t.Debug>1&&typeof s=="function"){const n=await s(t.On);n&&n.length>0&&console.log(n)}}}}catch(i){if(t.Results.delete(e),typeof o=="function"){const n=await o(t.On,i);n&&n.length>0&&console.log(n)}else t.Debug>1&&console.log(i)}if(t.Debug>0&&t.Results.size>0&&typeof a=="function"){const e=await a(t);e&&e.length>0&&console.log(e)}return t};export{E as default}; |
8725