fp-ts-node
Advanced tools
Comparing version 5.1.0 to 5.2.0
@@ -1,30 +0,40 @@ | ||
/// <reference types="node" /> | ||
import { option as O, readonlyRecord as RC } from "fp-ts"; | ||
import { option as O } from "fp-ts"; | ||
import { Monoid } from "fp-ts/lib/Monoid"; | ||
import { Semigroup } from "fp-ts/lib/Semigroup"; | ||
import * as path from "path"; | ||
export declare type Path = string; | ||
export declare type Extension = `.${string}${string}`; | ||
export declare type Sep = "/" | "\\"; | ||
export declare type Delimiter = ":" | ";"; | ||
export declare type Directory = `${string}${Sep}`; | ||
export declare const delimiter: Delimiter; | ||
export declare const sep: Sep; | ||
/** | ||
* @category Combinators | ||
*/ | ||
export declare function join(to: string): (from: string) => string; | ||
export declare function join(to: Path): (from: Path) => string; | ||
/** | ||
* @category Monoid | ||
*/ | ||
export declare const MonoidJoin: Monoid<string>; | ||
export declare const MonoidJoin: Monoid<Path>; | ||
/** | ||
* @category Combinators | ||
*/ | ||
export declare function basename(extension?: string): (string: string) => string; | ||
export declare function basename(extension?: Extension): (string: Path) => string; | ||
/** | ||
* @category Combinators | ||
*/ | ||
export declare function relative(to: string): (from: string) => string; | ||
export declare function relative(to: Path): (from: Path) => string; | ||
/** | ||
* @category Semigroup | ||
*/ | ||
export declare const SemigroupRelative: Semigroup<string>; | ||
export declare const SemigroupRelative: Semigroup<Path>; | ||
/** | ||
* @category Model | ||
*/ | ||
export interface ParsedPath extends RC.ReadonlyRecord<keyof path.ParsedPath, O.Option<string>> { | ||
export interface ParsedPath { | ||
root: O.Option<string>; | ||
dir: O.Option<Directory>; | ||
base: O.Option<string>; | ||
ext: O.Option<Extension>; | ||
name: O.Option<string>; | ||
} | ||
@@ -34,11 +44,15 @@ /** | ||
*/ | ||
export declare function parse(string: string): ParsedPath; | ||
export declare function parse(string: Path): ParsedPath; | ||
/** | ||
* @category Destructors | ||
*/ | ||
export declare function format(parsed: ParsedPath): string; | ||
export declare function format(parsed: ParsedPath): Path; | ||
/** | ||
* @category Combinators | ||
*/ | ||
export declare function resolve(froms: ReadonlyArray<string>): (to: string) => string; | ||
export declare function resolve(froms: ReadonlyArray<Path>): (to: Path) => string; | ||
/** | ||
* @category Combinators | ||
*/ | ||
export declare function dirname(string: Path): Directory; | ||
export { | ||
@@ -54,8 +68,4 @@ /** | ||
/** | ||
* @category Combinators | ||
*/ | ||
dirname, | ||
/** | ||
* @category Predicates | ||
*/ | ||
isAbsolute, } from "path"; |
@@ -22,6 +22,8 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isAbsolute = exports.dirname = exports.normalize = exports.extname = exports.resolve = exports.format = exports.parse = exports.SemigroupRelative = exports.relative = exports.basename = exports.MonoidJoin = exports.join = void 0; | ||
exports.isAbsolute = exports.normalize = exports.extname = exports.dirname = exports.resolve = exports.format = exports.parse = exports.SemigroupRelative = exports.relative = exports.basename = exports.MonoidJoin = exports.join = exports.sep = exports.delimiter = void 0; | ||
var fp_ts_1 = require("fp-ts"); | ||
var function_1 = require("fp-ts/lib/function"); | ||
var path = __importStar(require("path")); | ||
exports.delimiter = path.delimiter; | ||
exports.sep = path.sep; | ||
/** | ||
@@ -65,3 +67,3 @@ * @category Combinators | ||
function parse(string) { | ||
return (0, function_1.pipe)(path.parse(string), fp_ts_1.readonlyRecord.fromRecord, fp_ts_1.readonlyRecord.map(fp_ts_1.option.fromPredicate(function (value) { return value !== ""; }))); | ||
return (0, function_1.pipe)(path.parse(string), fp_ts_1.readonlyRecord.fromRecord, fp_ts_1.readonlyRecord.map(fp_ts_1.option.fromPredicate(function (value) { return value !== ""; })), function (a) { return a; }); | ||
} | ||
@@ -85,2 +87,10 @@ exports.parse = parse; | ||
exports.resolve = resolve; | ||
/** | ||
* @category Combinators | ||
*/ | ||
function dirname(string) { | ||
var result = path.dirname(string); | ||
return result === "." ? "./" : result; | ||
} | ||
exports.dirname = dirname; | ||
var path_1 = require("path"); | ||
@@ -96,8 +106,4 @@ /** | ||
/** | ||
* @category Combinators | ||
*/ | ||
Object.defineProperty(exports, "dirname", { enumerable: true, get: function () { return path_1.dirname; } }); | ||
/** | ||
* @category Predicates | ||
*/ | ||
Object.defineProperty(exports, "isAbsolute", { enumerable: true, get: function () { return path_1.isAbsolute; } }); |
@@ -1,30 +0,40 @@ | ||
/// <reference types="node" /> | ||
import { option as O, readonlyRecord as RC } from "fp-ts"; | ||
import { option as O } from "fp-ts"; | ||
import { Monoid } from "fp-ts/lib/Monoid"; | ||
import { Semigroup } from "fp-ts/lib/Semigroup"; | ||
import * as path from "path"; | ||
export declare type Path = string; | ||
export declare type Extension = `.${string}${string}`; | ||
export declare type Sep = "/" | "\\"; | ||
export declare type Delimiter = ":" | ";"; | ||
export declare type Directory = `${string}${Sep}`; | ||
export declare const delimiter: Delimiter; | ||
export declare const sep: Sep; | ||
/** | ||
* @category Combinators | ||
*/ | ||
export declare function join(to: string): (from: string) => string; | ||
export declare function join(to: Path): (from: Path) => string; | ||
/** | ||
* @category Monoid | ||
*/ | ||
export declare const MonoidJoin: Monoid<string>; | ||
export declare const MonoidJoin: Monoid<Path>; | ||
/** | ||
* @category Combinators | ||
*/ | ||
export declare function basename(extension?: string): (string: string) => string; | ||
export declare function basename(extension?: Extension): (string: Path) => string; | ||
/** | ||
* @category Combinators | ||
*/ | ||
export declare function relative(to: string): (from: string) => string; | ||
export declare function relative(to: Path): (from: Path) => string; | ||
/** | ||
* @category Semigroup | ||
*/ | ||
export declare const SemigroupRelative: Semigroup<string>; | ||
export declare const SemigroupRelative: Semigroup<Path>; | ||
/** | ||
* @category Model | ||
*/ | ||
export interface ParsedPath extends RC.ReadonlyRecord<keyof path.ParsedPath, O.Option<string>> { | ||
export interface ParsedPath { | ||
root: O.Option<string>; | ||
dir: O.Option<Directory>; | ||
base: O.Option<string>; | ||
ext: O.Option<Extension>; | ||
name: O.Option<string>; | ||
} | ||
@@ -34,11 +44,15 @@ /** | ||
*/ | ||
export declare function parse(string: string): ParsedPath; | ||
export declare function parse(string: Path): ParsedPath; | ||
/** | ||
* @category Destructors | ||
*/ | ||
export declare function format(parsed: ParsedPath): string; | ||
export declare function format(parsed: ParsedPath): Path; | ||
/** | ||
* @category Combinators | ||
*/ | ||
export declare function resolve(froms: ReadonlyArray<string>): (to: string) => string; | ||
export declare function resolve(froms: ReadonlyArray<Path>): (to: Path) => string; | ||
/** | ||
* @category Combinators | ||
*/ | ||
export declare function dirname(string: Path): Directory; | ||
export { | ||
@@ -54,8 +68,4 @@ /** | ||
/** | ||
* @category Combinators | ||
*/ | ||
dirname, | ||
/** | ||
* @category Predicates | ||
*/ | ||
isAbsolute, } from "path"; |
import { option as O, readonlyArray as A, readonlyRecord as RC } from "fp-ts"; | ||
import { constant, pipe, tupled } from "fp-ts/lib/function"; | ||
import * as path from "path"; | ||
export const delimiter = path.delimiter; | ||
export const sep = path.sep; | ||
/** | ||
@@ -39,3 +41,3 @@ * @category Combinators | ||
export function parse(string) { | ||
return pipe(path.parse(string), RC.fromRecord, RC.map(O.fromPredicate((value) => value !== ""))); | ||
return pipe(path.parse(string), RC.fromRecord, RC.map(O.fromPredicate((value) => value !== "")), (a) => a); | ||
} | ||
@@ -54,2 +56,9 @@ /** | ||
} | ||
/** | ||
* @category Combinators | ||
*/ | ||
export function dirname(string) { | ||
const result = path.dirname(string); | ||
return result === "." ? "./" : result; | ||
} | ||
export { | ||
@@ -65,8 +74,4 @@ /** | ||
/** | ||
* @category Combinators | ||
*/ | ||
dirname, | ||
/** | ||
* @category Predicates | ||
*/ | ||
isAbsolute, } from "path"; |
{ | ||
"name": "fp-ts-node", | ||
"version": "5.1.0", | ||
"version": "5.2.0", | ||
"files": [ | ||
@@ -26,4 +26,4 @@ "dist" | ||
"peerDependencies": { | ||
"@types/node": "^14.14.31", | ||
"fp-ts": "^2.9.5", | ||
"@types/node": "^14.14.31", | ||
"typescript": "^4.1.5" | ||
@@ -42,4 +42,5 @@ }, | ||
"docs-ts": "^0.6.10", | ||
"fast-check": "^2.13.0", | ||
"fast-check": "^2.19.0", | ||
"fp-ts": "^2.9.5", | ||
"fp-ts-laws": "^0.3.0", | ||
"io-ts": "^2.2.16", | ||
@@ -46,0 +47,0 @@ "jest": "^26.6.3", |
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
63270
1416
22