@stryke/path 0.7.4 â 0.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -9
- package/dist/file-path-fns.cjs +1 -1
- package/dist/file-path-fns.mjs +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -22,15 +22,10 @@ This package is part of Storm Software's **đŠī¸ Stryke** monorepo. Stryke pac
|
|
|
22
22
|
|
|
23
23
|
<h3 align="center">đģ Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
24
24
|
|
|
25
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
26
26
|
|
|
27
|
-
> [!IMPORTANT]
|
|
28
|
-
> within, is still in it's initial development phase. As a result, bugs and
|
|
29
|
-
> issues are expected with it's usage. When the main development phase
|
|
30
|
-
> completes, a proper release will be performed, the packages will be availible
|
|
31
|
-
> through NPM (and other distributions), and this message will be removed.
|
|
32
|
-
> However, in the meantime, please feel free to report any issues you may come
|
|
33
|
-
> across.
|
|
27
|
+
> [!IMPORTANT] Important
|
|
28
|
+
> This repository, and the apps, libraries, and tools contained within, is still in it's initial development phase. As a result, bugs and issues are expected with it's usage. When the main development phase completes, a proper release will be performed, the packages will be available through NPM (and other distributions), and this message will be removed. However, in the meantime, please feel free to report any issues you may come across.
|
|
34
29
|
|
|
35
30
|
<div align="center">
|
|
36
31
|
<b>Be sure to â this repository on <a href="https://github.com/storm-software/stryke" target="_blank">GitHub</a> so you can keep up to date on any daily progress!</b>
|
|
@@ -51,7 +46,6 @@ built-in \`path\` module
|
|
|
51
46
|
|
|
52
47
|
<!-- START doctoc -->
|
|
53
48
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
|
54
|
-
|
|
55
49
|
## Table of Contents
|
|
56
50
|
|
|
57
51
|
- [Installing](#installing)
|
package/dist/file-path-fns.cjs
CHANGED
|
@@ -27,7 +27,7 @@ function findFileName(t, e = {}) {
|
|
|
27
27
|
withExtension: r = !0
|
|
28
28
|
} = e,
|
|
29
29
|
i = (0, _correctPath.normalizeWindowsPath)(t)?.split(t?.includes("\\") ? "\\" : "/")?.pop() ?? "";
|
|
30
|
-
return n === !0 && !i.includes(".") ? _base.EMPTY_STRING : r === !1 && i.includes(".") ? i.
|
|
30
|
+
return n === !0 && !i.includes(".") ? _base.EMPTY_STRING : r === !1 && i.includes(".") ? i.substring(0, i.lastIndexOf(".")) || _base.EMPTY_STRING : i;
|
|
31
31
|
}
|
|
32
32
|
function findFilePath(t) {
|
|
33
33
|
const e = (0, _correctPath.normalizeWindowsPath)(t),
|
package/dist/file-path-fns.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EMPTY_STRING as a}from"@stryke/types/base";import{relative as f}from"node:path";import{normalizeString as g,normalizeWindowsPath as l}from"./correct-path";import{getWorkspaceRoot as p}from"./get-workspace-root";import{isAbsolutePath as c}from"./is-file";import{joinPaths as u}from"./join-paths";export function findFileName(t,e={}){const{requireExtension:n=!1,withExtension:r=!0}=e,i=l(t)?.split(t?.includes("\\")?"\\":"/")?.pop()??"";return n===!0&&!i.includes(".")?a:r===!1&&i.includes(".")?i.
|
|
1
|
+
import{EMPTY_STRING as a}from"@stryke/types/base";import{relative as f}from"node:path";import{normalizeString as g,normalizeWindowsPath as l}from"./correct-path";import{getWorkspaceRoot as p}from"./get-workspace-root";import{isAbsolutePath as c}from"./is-file";import{joinPaths as u}from"./join-paths";export function findFileName(t,e={}){const{requireExtension:n=!1,withExtension:r=!0}=e,i=l(t)?.split(t?.includes("\\")?"\\":"/")?.pop()??"";return n===!0&&!i.includes(".")?a:r===!1&&i.includes(".")?i.substring(0,i.lastIndexOf("."))||a:i}export function findFilePath(t){const e=l(t),n=e.replace(findFileName(e,{requireExtension:!0}),"");return n==="/"?n:n.replace(/\/$/,"")}export function findFolderName(t){const e=findFilePath(t).split("/");let n="";for(let r=e.length-1;r>=0;r--){const i=e[r];if(i){n=i;break}}return n??a}export function findFileExtension(t){if(t==="..")return"";const e=/.(\.[^./]+|\.)$/.exec(l(t));return e&&e[1]||a}export function hasFileName(t){return!!findFileName(t)}export function hasFilePath(t){return!!findFilePath(t)}export function resolvePath(t,e=p()){const n=l(t).split("/");let r="",i=!1;for(let s=n.length-1;s>=-1&&!i;s--){const o=s>=0?n[s]:e;!o||o.length===0||(r=u(o,r),i=c(o))}return r=g(r,!i),i&&!c(r)?`/${r}`:r.length>0?r:"."}export function resolvePaths(...t){return resolvePath(u(...t.map(e=>l(e))))}export function relativePath(t,e,n=!1){return f(n!==!0?t.replace(/\/$/,""):t,n!==!0?e.replace(/\/$/,""):e)}export function relativeToWorkspaceRoot(t){return relativePath(t,p())}export function parsePath(t){const e=/^[/\\]|^[a-z]:[/\\]/i.exec(t)?.[0]?.replace(/\\/g,"/")||"",n=l(t),r=n.replace(/\/$/,"").split("/").slice(0,-1);r.length===1&&/^[A-Z]:$/i.test(r[0])&&(r[0]+="/");const i=findFolderName(n),s=r.join("/")||(c(t)?"/":"."),o=findFileExtension(t);return{root:e,dir:s,base:i,ext:o,name:i.slice(0,i.length-o.length)}}export function renameFile(t,e){const n=parsePath(t);return u(n.dir,e.includes(".")?e:e+n.ext)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stryke/path",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing various utilities that expand the functionality of NodeJs's built-in `path` module",
|
|
6
6
|
"repository": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"private": false,
|
|
12
12
|
"dependencies": { "@storm-software/config-tools": "latest", "mlly": "1.7.4" },
|
|
13
|
-
"devDependencies": { "@stryke/types": "^0.8.
|
|
13
|
+
"devDependencies": { "@stryke/types": "^0.8.4", "@types/node": "^22.14.0" },
|
|
14
14
|
"publishConfig": { "access": "public" },
|
|
15
15
|
"sideEffects": false,
|
|
16
16
|
"files": ["dist/**/*"],
|