Skip to content

Commit

Permalink
docs: updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Johan committed Sep 26, 2019
1 parent 5ff0ecd commit 2e2b224
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/path/index.ts
Expand Up @@ -54,6 +54,9 @@ export { default as reverse } from "./reverse";
export { default as subDirectories } from "./subDirectories";
export { default as write } from "./write";

/**
* @ignore
*/
const pathWalker = (path: Path): PathWalker => {
return {
back: (options?: WalkOptions) => walker.back(path, options).result,
Expand Down Expand Up @@ -99,9 +102,9 @@ export const path = (current: Path): FlexiPath => {
intersect: (...paths: Path[]) =>
intersect(pathMeta.path, ...paths.map(x => pathString(x))),
parent: parent(pathMeta.path),
pop: () => pop(pathMeta.path),
prepend: (...paths: Path[]) =>
prepend(pathMeta.path, ...paths.map(x => pathString(x))),
pop: () => pop(pathMeta.path),
read: readWrapper,
reverse: () => reverse(pathMeta.path),
subDirectories: subDirectories(pathMeta.path),
Expand Down
3 changes: 3 additions & 0 deletions src/lib/path/meta/segments.ts
Expand Up @@ -2,6 +2,9 @@ import { sep } from "path";

import { isEmpty, isRoot } from ".";

/**
* @category path
*/
const segments = (path: string) => {
if (isEmpty(path)) {
return [];
Expand Down
3 changes: 3 additions & 0 deletions src/lib/path/pop.ts
Expand Up @@ -2,6 +2,9 @@ import { flexi } from "..";
import { FlexiPath } from "../../types";
import { isEmpty, isRoot, segments } from "./meta";

/**
* @category path
*/
const pop = (path: string): FlexiPath => {
if (isEmpty(path)) {
return flexi.empty();
Expand Down
3 changes: 3 additions & 0 deletions src/lib/path/read.ts
Expand Up @@ -2,6 +2,9 @@ import { readFileSync } from "fs";

import { PathMeta, PathType, TextTransform } from "../../types";

/**
* @category path
*/
const read = (
path: PathMeta,
{
Expand Down
3 changes: 3 additions & 0 deletions src/lib/walker/until/exists.ts
@@ -1,6 +1,9 @@
import { flexi } from "../..";
import { PathMeta, WalkUntil } from "../../../types";

/**
* @ignore
*/
const getFileWithoutExtension = (path: PathMeta): PathMeta => {
const parent = flexi.path(path).parent();

Expand Down
3 changes: 3 additions & 0 deletions src/types/PathWalker.ts
@@ -1,5 +1,8 @@
import { FlexiPath, WalkOptions } from ".";

/**
* @category walker
*/
export interface PathWalker {
forward: (options?: WalkOptions) => FlexiPath[];
back: (options?: WalkOptions) => FlexiPath;
Expand Down
3 changes: 3 additions & 0 deletions src/types/TextTransform.ts
@@ -1,3 +1,6 @@
/**
* @category path
*/
export enum TextTransform {
Plain = 0,
JSON = 1
Expand Down

0 comments on commit 2e2b224

Please sign in to comment.