fp-ts-node
Advanced tools
Comparing version 3.0.0 to 3.1.0
@@ -7,3 +7,9 @@ /// <reference types="node" /> | ||
import * as fs from "fs"; | ||
export { | ||
/** | ||
* @category Constructors | ||
* @since 3.0.0 | ||
*/ | ||
copyFile, } from "./fs/path"; | ||
/** | ||
* The path is the dependency here, because many operations being applied to a | ||
@@ -67,25 +73,2 @@ * path is the most likely case. | ||
/** | ||
* Asynchronously copies src to dest. By default, dest is overwritten if it already exists. | ||
* No arguments other than a possible exception are given to the callback function. | ||
* Node.js makes no guarantees about the atomicity of the copy operation. | ||
* If an error occurs after the destination file has been opened for writing, Node.js will attempt | ||
* to remove the destination. | ||
* @param src A path to the source file. | ||
* @param dest A path to the destination file. | ||
* @param flags An integer that specifies the behavior of the copy operation. The only supported flag is fs.constants.COPYFILE_EXCL, which causes the copy operation to fail if dest already exists. | ||
* | ||
* Specifying `src` or `dest` as the property will cause the | ||
* `path` dependency in the Reader to be `dest` or `src` respectively. | ||
* | ||
* @category Constructors | ||
* @since 3.2.0 | ||
*/ | ||
export declare function copyFile(options: ({ | ||
src: fs.PathLike; | ||
} | { | ||
dest: fs.PathLike; | ||
}) & { | ||
flags?: number; | ||
}): PathTaskEither<fs.PathLike, void>; | ||
/** | ||
* Asynchronous mkdir(2) - create a directory. | ||
@@ -92,0 +75,0 @@ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. |
@@ -22,3 +22,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.readFile = exports.mkdir = exports.copyFile = exports.close = exports.chown = exports.chmod = exports.appendFile = exports.access = void 0; | ||
exports.readFile = exports.mkdir = exports.close = exports.chown = exports.chmod = exports.appendFile = exports.access = exports.copyFile = void 0; | ||
/** | ||
@@ -30,3 +30,9 @@ * @since 2.0.0 | ||
var fs = __importStar(require("fs")); | ||
var path_1 = require("./fs/path"); | ||
/** | ||
* @category Constructors | ||
* @since 3.0.0 | ||
*/ | ||
Object.defineProperty(exports, "copyFile", { enumerable: true, get: function () { return path_1.copyFile; } }); | ||
/** | ||
* Asynchronously tests a user's permissions for the file specified by path. | ||
@@ -105,24 +111,2 @@ * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. | ||
/** | ||
* Asynchronously copies src to dest. By default, dest is overwritten if it already exists. | ||
* No arguments other than a possible exception are given to the callback function. | ||
* Node.js makes no guarantees about the atomicity of the copy operation. | ||
* If an error occurs after the destination file has been opened for writing, Node.js will attempt | ||
* to remove the destination. | ||
* @param src A path to the source file. | ||
* @param dest A path to the destination file. | ||
* @param flags An integer that specifies the behavior of the copy operation. The only supported flag is fs.constants.COPYFILE_EXCL, which causes the copy operation to fail if dest already exists. | ||
* | ||
* Specifying `src` or `dest` as the property will cause the | ||
* `path` dependency in the Reader to be `dest` or `src` respectively. | ||
* | ||
* @category Constructors | ||
* @since 3.2.0 | ||
*/ | ||
function copyFile(options) { | ||
return function (path_2) { | ||
return fp_ts_1.taskEither.taskify(fs.copyFile)("src" in options ? options.src : path_2, "dest" in options ? options.dest : path_2, (options === null || options === void 0 ? void 0 : options.flags) || undefined); | ||
}; | ||
} | ||
exports.copyFile = copyFile; | ||
/** | ||
* Asynchronous mkdir(2) - create a directory. | ||
@@ -129,0 +113,0 @@ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. |
@@ -1,1 +0,1 @@ | ||
export * from "./types"; | ||
export * as path from "./path"; |
@@ -9,6 +9,16 @@ "use strict"; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./types"), exports); | ||
exports.path = void 0; | ||
exports.path = __importStar(require("./path")); |
/// <reference types="node" /> | ||
import { readerTaskEither } from "fp-ts"; | ||
import * as fs from "fs"; | ||
export { PathLike } from "fs"; | ||
/** | ||
* A `ReaderTaskEither` where the `Left` is the `NodeJS.ErrnoException`. | ||
* | ||
* @category Model | ||
* @since 3.1.0 | ||
*/ | ||
export interface ReaderTaskNodeEither<R, A> extends readerTaskEither.ReaderTaskEither<R, NodeJS.ErrnoException, A> { | ||
} | ||
export declare type Time = string | number | Date; | ||
@@ -5,0 +14,0 @@ /** |
@@ -7,3 +7,9 @@ /// <reference types="node" /> | ||
import * as fs from "fs"; | ||
export { | ||
/** | ||
* @category Constructors | ||
* @since 3.0.0 | ||
*/ | ||
copyFile, } from "./fs/path"; | ||
/** | ||
* The path is the dependency here, because many operations being applied to a | ||
@@ -67,25 +73,2 @@ * path is the most likely case. | ||
/** | ||
* Asynchronously copies src to dest. By default, dest is overwritten if it already exists. | ||
* No arguments other than a possible exception are given to the callback function. | ||
* Node.js makes no guarantees about the atomicity of the copy operation. | ||
* If an error occurs after the destination file has been opened for writing, Node.js will attempt | ||
* to remove the destination. | ||
* @param src A path to the source file. | ||
* @param dest A path to the destination file. | ||
* @param flags An integer that specifies the behavior of the copy operation. The only supported flag is fs.constants.COPYFILE_EXCL, which causes the copy operation to fail if dest already exists. | ||
* | ||
* Specifying `src` or `dest` as the property will cause the | ||
* `path` dependency in the Reader to be `dest` or `src` respectively. | ||
* | ||
* @category Constructors | ||
* @since 3.2.0 | ||
*/ | ||
export declare function copyFile(options: ({ | ||
src: fs.PathLike; | ||
} | { | ||
dest: fs.PathLike; | ||
}) & { | ||
flags?: number; | ||
}): PathTaskEither<fs.PathLike, void>; | ||
/** | ||
* Asynchronous mkdir(2) - create a directory. | ||
@@ -92,0 +75,0 @@ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. |
@@ -7,3 +7,9 @@ /** | ||
import * as fs from "fs"; | ||
export { | ||
/** | ||
* @category Constructors | ||
* @since 3.0.0 | ||
*/ | ||
copyFile, } from "./fs/path"; | ||
/** | ||
* Asynchronously tests a user's permissions for the file specified by path. | ||
@@ -67,21 +73,2 @@ * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. | ||
/** | ||
* Asynchronously copies src to dest. By default, dest is overwritten if it already exists. | ||
* No arguments other than a possible exception are given to the callback function. | ||
* Node.js makes no guarantees about the atomicity of the copy operation. | ||
* If an error occurs after the destination file has been opened for writing, Node.js will attempt | ||
* to remove the destination. | ||
* @param src A path to the source file. | ||
* @param dest A path to the destination file. | ||
* @param flags An integer that specifies the behavior of the copy operation. The only supported flag is fs.constants.COPYFILE_EXCL, which causes the copy operation to fail if dest already exists. | ||
* | ||
* Specifying `src` or `dest` as the property will cause the | ||
* `path` dependency in the Reader to be `dest` or `src` respectively. | ||
* | ||
* @category Constructors | ||
* @since 3.2.0 | ||
*/ | ||
export function copyFile(options) { | ||
return (path_2) => TE.taskify(fs.copyFile)("src" in options ? options.src : path_2, "dest" in options ? options.dest : path_2, (options === null || options === void 0 ? void 0 : options.flags) || undefined); | ||
} | ||
/** | ||
* Asynchronous mkdir(2) - create a directory. | ||
@@ -88,0 +75,0 @@ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. |
@@ -1,1 +0,1 @@ | ||
export * from "./types"; | ||
export * as path from "./path"; |
@@ -1,1 +0,2 @@ | ||
export * from "./types"; | ||
import * as path_1 from "./path"; | ||
export { path_1 as path }; |
/// <reference types="node" /> | ||
import { readerTaskEither } from "fp-ts"; | ||
import * as fs from "fs"; | ||
export { PathLike } from "fs"; | ||
/** | ||
* A `ReaderTaskEither` where the `Left` is the `NodeJS.ErrnoException`. | ||
* | ||
* @category Model | ||
* @since 3.1.0 | ||
*/ | ||
export interface ReaderTaskNodeEither<R, A> extends readerTaskEither.ReaderTaskEither<R, NodeJS.ErrnoException, A> { | ||
} | ||
export declare type Time = string | number | Date; | ||
@@ -5,0 +14,0 @@ /** |
{ | ||
"name": "fp-ts-node", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"files": [ | ||
@@ -5,0 +5,0 @@ "dist" |
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
40930
22
771
5