build
This commit is contained in:
parent
c1ade4dc2a
commit
d6e6a58a36
4
lib/index.d.ts
vendored
4
lib/index.d.ts
vendored
|
|
@ -1,4 +1,4 @@
|
|||
import { withRecord, assignRecords, RecordClearMode } from "./commons/record-util";
|
||||
import { stringTokenizer, equalsIgnoreCase, includeIgnoreCase } from "./commons/str-utils";
|
||||
import { stringTokenizer, equalsIgnoreCase, includeIgnoreCase, strLength, strMonospacePad } from "./commons/str-utils";
|
||||
import { getFileExt, getFileFullName, getFileNameWithoutExt, getFileInfo } from "./commons/file-util";
|
||||
export { stringTokenizer, withRecord, equalsIgnoreCase, includeIgnoreCase, assignRecords, RecordClearMode, getFileExt, getFileFullName as getFileName, getFileNameWithoutExt, getFileInfo, };
|
||||
export { stringTokenizer, withRecord, equalsIgnoreCase, includeIgnoreCase, assignRecords, RecordClearMode, getFileExt, getFileFullName as getFileName, getFileNameWithoutExt, getFileInfo, strLength, strMonospacePad };
|
||||
|
|
|
|||
101
lib/index.es.js
101
lib/index.es.js
|
|
@ -1,10 +1,10 @@
|
|||
var a = /* @__PURE__ */ ((e) => (e[e.delete = 2] = "delete", e[e.reset = 1] = "reset", e))(a || {});
|
||||
const h = (e) => ({
|
||||
const d = (e) => ({
|
||||
clear: function(t = 2) {
|
||||
t === 1 ? Object.keys(e).forEach((s) => {
|
||||
e[s] = void 0;
|
||||
}) : t === 2 && Object.keys(e).forEach((s) => {
|
||||
delete e[s];
|
||||
t === 1 ? Object.keys(e).forEach((n) => {
|
||||
e[n] = void 0;
|
||||
}) : t === 2 && Object.keys(e).forEach((n) => {
|
||||
delete e[n];
|
||||
});
|
||||
},
|
||||
replace: function(t) {
|
||||
|
|
@ -14,48 +14,51 @@ const h = (e) => ({
|
|||
), Object.assign(e, t);
|
||||
}
|
||||
});
|
||||
function d(...e) {
|
||||
function m(...e) {
|
||||
let t = e ?? [];
|
||||
return {
|
||||
test: function(s) {
|
||||
test: function(n) {
|
||||
if (t.length <= 1)
|
||||
return t.length === 1 ? t[0] : [];
|
||||
let r = s ?? function(n, i) {
|
||||
return n === i;
|
||||
let i = n ?? function(s, r) {
|
||||
return s === r;
|
||||
};
|
||||
return t.reduce((n, i) => (i && i.length > 0 && (n.length === 0 ? n.push(...i) : i.forEach((u) => {
|
||||
n.some((f) => r(f, u)) || n.push(u);
|
||||
})), n), []);
|
||||
return t.reduce((s, r) => (r && r.length > 0 && (s.length === 0 ? s.push(...r) : r.forEach((u) => {
|
||||
s.some((l) => i(l, u)) || s.push(u);
|
||||
})), s), []);
|
||||
},
|
||||
path: function(...s) {
|
||||
return this.test((r, n) => s.every((i) => r[i] === n[i]));
|
||||
path: function(...n) {
|
||||
return this.test((i, s) => n.every((r) => i[r] === s[r]));
|
||||
}
|
||||
};
|
||||
}
|
||||
function m(e, t, s) {
|
||||
const r = t, n = s || t;
|
||||
return function(i) {
|
||||
const u = [], l = i.matchAll(e);
|
||||
let f = 0;
|
||||
for (const o of l) {
|
||||
const c = i.slice(f, o.index);
|
||||
c && u.push(n(c, !1)), u.push(r(o[0], !0)), f = o.index + o[0].length;
|
||||
function I(e, t, n) {
|
||||
const i = t, s = n || t;
|
||||
return function(r) {
|
||||
const u = [], f = r.matchAll(e);
|
||||
let l = 0;
|
||||
for (const o of f) {
|
||||
const c = r.slice(l, o.index);
|
||||
c && u.push(s(c, !1)), u.push(i(o[0], !0)), l = o.index + o[0].length;
|
||||
}
|
||||
return f < i.length && u.push(n(i.slice(f), !1)), u;
|
||||
return l < r.length && u.push(s(r.slice(l), !1)), u;
|
||||
};
|
||||
}
|
||||
function g(e, t) {
|
||||
return typeof e == "string" && typeof t == "string" ? e.toLowerCase() === t.toLowerCase() : e === void 0 && t === void 0;
|
||||
}
|
||||
const I = (e, t) => {
|
||||
for (let s = 0; s < e.length; s++) {
|
||||
let r = e[s];
|
||||
if (g(r, t))
|
||||
const O = (e, t) => {
|
||||
for (let n = 0; n < e.length; n++) {
|
||||
let i = e[n];
|
||||
if (g(i, t))
|
||||
return !0;
|
||||
}
|
||||
return !1;
|
||||
}, h = (e) => e.replaceAll(/[\u4e00-\u9fa5]/g, "--").length, p = (e, t, n = " ") => {
|
||||
const i = t - (h(e) - e.length);
|
||||
return e.padEnd(i, n);
|
||||
};
|
||||
function O(e) {
|
||||
function E(e) {
|
||||
const t = e.lastIndexOf(".");
|
||||
return t === -1 ? "" : e.substring(t + 1);
|
||||
}
|
||||
|
|
@ -63,34 +66,36 @@ function x(e) {
|
|||
let t = e.lastIndexOf("/");
|
||||
return t === -1 && (t = e.lastIndexOf("\\"), t === -1) ? e : e.substring(t + 1);
|
||||
}
|
||||
function E(e) {
|
||||
const t = x(e), s = t.lastIndexOf(".");
|
||||
return s === -1 ? t : t.substring(0, s);
|
||||
function b(e) {
|
||||
const t = x(e), n = t.lastIndexOf(".");
|
||||
return n === -1 ? t : t.substring(0, n);
|
||||
}
|
||||
function b(e, t = "win32") {
|
||||
const s = t === "win32" ? "\\" : "/";
|
||||
let r, n, i, u;
|
||||
const l = e.lastIndexOf(s);
|
||||
l === -1 ? (r = "", n = e) : (r = e.substring(0, l + 1), n = e.substring(l + 1));
|
||||
const f = n.lastIndexOf(".");
|
||||
return f === -1 ? (i = "", u = n) : (i = n.substring(f + 1), u = n.substring(0, f)), {
|
||||
fileName: n,
|
||||
function y(e, t = "win32") {
|
||||
const n = t === "win32" ? "\\" : "/";
|
||||
let i, s, r, u;
|
||||
const f = e.lastIndexOf(n);
|
||||
f === -1 ? (i = "", s = e) : (i = e.substring(0, f + 1), s = e.substring(f + 1));
|
||||
const l = s.lastIndexOf(".");
|
||||
return l === -1 ? (r = "", u = s) : (r = s.substring(l + 1), u = s.substring(0, l)), {
|
||||
fileName: s,
|
||||
fileNameNoExt: u,
|
||||
fileExtName: i,
|
||||
fileExtName: r,
|
||||
fullPath: e,
|
||||
pathOnly: r
|
||||
pathOnly: i
|
||||
};
|
||||
}
|
||||
export {
|
||||
a as RecordClearMode,
|
||||
d as assignRecords,
|
||||
m as assignRecords,
|
||||
g as equalsIgnoreCase,
|
||||
O as getFileExt,
|
||||
b as getFileInfo,
|
||||
E as getFileExt,
|
||||
y as getFileInfo,
|
||||
x as getFileName,
|
||||
E as getFileNameWithoutExt,
|
||||
I as includeIgnoreCase,
|
||||
m as stringTokenizer,
|
||||
h as withRecord
|
||||
b as getFileNameWithoutExt,
|
||||
O as includeIgnoreCase,
|
||||
h as strLength,
|
||||
p as strMonospacePad,
|
||||
I as stringTokenizer,
|
||||
d as withRecord
|
||||
};
|
||||
//# sourceMappingURL=index.es.js.map
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,2 +1,2 @@
|
|||
(function(r,o){typeof exports=="object"&&typeof module<"u"?o(exports):typeof define=="function"&&define.amd?define(["exports"],o):(r=typeof globalThis<"u"?globalThis:r||self,o(r["ez-common-ts"]={}))})(this,function(r){"use strict";var o=(e=>(e[e.delete=2]="delete",e[e.reset=1]="reset",e))(o||{});const m=e=>({clear:function(n=2){n===1?Object.keys(e).forEach(i=>{e[i]=void 0}):n===2&&Object.keys(e).forEach(i=>{delete e[i]})},replace:function(n){this.clear(2),Object.assign(e,n)}});function x(...e){let n=e??[];return{test:function(i){if(n.length<=1)return n.length===1?n[0]:[];let u=i??function(t,s){return t===s};return n.reduce((t,s)=>(s&&s.length>0&&(t.length===0?t.push(...s):s.forEach(f=>{t.some(l=>u(l,f))||t.push(f)})),t),[])},path:function(...i){return this.test((u,t)=>i.every(s=>u[s]===t[s]))}}}function I(e,n,i){const u=n,t=i||n;return function(s){const f=[],c=s.matchAll(e);let l=0;for(const g of c){const h=s.slice(l,g.index);h&&f.push(t(h,!1)),f.push(u(g[0],!0)),l=g.index+g[0].length}return l<s.length&&f.push(t(s.slice(l),!1)),f}}function a(e,n){return typeof e=="string"&&typeof n=="string"?e.toLowerCase()===n.toLowerCase():e===void 0&&n===void 0}const y=(e,n)=>{for(let i=0;i<e.length;i++){let u=e[i];if(a(u,n))return!0}return!1};function O(e){const n=e.lastIndexOf(".");return n===-1?"":e.substring(n+1)}function d(e){let n=e.lastIndexOf("/");return n===-1&&(n=e.lastIndexOf("\\"),n===-1)?e:e.substring(n+1)}function b(e){const n=d(e),i=n.lastIndexOf(".");return i===-1?n:n.substring(0,i)}function E(e,n="win32"){const i=n==="win32"?"\\":"/";let u,t,s,f;const c=e.lastIndexOf(i);c===-1?(u="",t=e):(u=e.substring(0,c+1),t=e.substring(c+1));const l=t.lastIndexOf(".");return l===-1?(s="",f=t):(s=t.substring(l+1),f=t.substring(0,l)),{fileName:t,fileNameNoExt:f,fileExtName:s,fullPath:e,pathOnly:u}}r.RecordClearMode=o,r.assignRecords=x,r.equalsIgnoreCase=a,r.getFileExt=O,r.getFileInfo=E,r.getFileName=d,r.getFileNameWithoutExt=b,r.includeIgnoreCase=y,r.stringTokenizer=I,r.withRecord=m,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});
|
||||
(function(r,o){typeof exports=="object"&&typeof module<"u"?o(exports):typeof define=="function"&&define.amd?define(["exports"],o):(r=typeof globalThis<"u"?globalThis:r||self,o(r["ez-common-ts"]={}))})(this,function(r){"use strict";var o=(e=>(e[e.delete=2]="delete",e[e.reset=1]="reset",e))(o||{});const I=e=>({clear:function(n=2){n===1?Object.keys(e).forEach(t=>{e[t]=void 0}):n===2&&Object.keys(e).forEach(t=>{delete e[t]})},replace:function(n){this.clear(2),Object.assign(e,n)}});function x(...e){let n=e??[];return{test:function(t){if(n.length<=1)return n.length===1?n[0]:[];let u=t??function(i,s){return i===s};return n.reduce((i,s)=>(s&&s.length>0&&(i.length===0?i.push(...s):s.forEach(l=>{i.some(f=>u(f,l))||i.push(l)})),i),[])},path:function(...t){return this.test((u,i)=>t.every(s=>u[s]===i[s]))}}}function b(e,n,t){const u=n,i=t||n;return function(s){const l=[],c=s.matchAll(e);let f=0;for(const a of c){const m=s.slice(f,a.index);m&&l.push(i(m,!1)),l.push(u(a[0],!0)),f=a.index+a[0].length}return f<s.length&&l.push(i(s.slice(f),!1)),l}}function g(e,n){return typeof e=="string"&&typeof n=="string"?e.toLowerCase()===n.toLowerCase():e===void 0&&n===void 0}const y=(e,n)=>{for(let t=0;t<e.length;t++){let u=e[t];if(g(u,n))return!0}return!1},d=e=>e.replaceAll(/[\u4e00-\u9fa5]/g,"--").length,E=(e,n,t=" ")=>{const u=n-(d(e)-e.length);return e.padEnd(u,t)};function O(e){const n=e.lastIndexOf(".");return n===-1?"":e.substring(n+1)}function h(e){let n=e.lastIndexOf("/");return n===-1&&(n=e.lastIndexOf("\\"),n===-1)?e:e.substring(n+1)}function F(e){const n=h(e),t=n.lastIndexOf(".");return t===-1?n:n.substring(0,t)}function N(e,n="win32"){const t=n==="win32"?"\\":"/";let u,i,s,l;const c=e.lastIndexOf(t);c===-1?(u="",i=e):(u=e.substring(0,c+1),i=e.substring(c+1));const f=i.lastIndexOf(".");return f===-1?(s="",l=i):(s=i.substring(f+1),l=i.substring(0,f)),{fileName:i,fileNameNoExt:l,fileExtName:s,fullPath:e,pathOnly:u}}r.RecordClearMode=o,r.assignRecords=x,r.equalsIgnoreCase=g,r.getFileExt=O,r.getFileInfo=N,r.getFileName=h,r.getFileNameWithoutExt=F,r.includeIgnoreCase=y,r.strLength=d,r.strMonospacePad=E,r.stringTokenizer=b,r.withRecord=I,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});
|
||||
//# sourceMappingURL=index.umd.js.map
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -7,6 +7,8 @@ import {
|
|||
stringTokenizer,
|
||||
equalsIgnoreCase,
|
||||
includeIgnoreCase,
|
||||
strLength,
|
||||
strMonospacePad
|
||||
} from "./commons/str-utils";
|
||||
import {
|
||||
getFileExt,
|
||||
|
|
@ -26,4 +28,6 @@ export {
|
|||
getFileFullName as getFileName,
|
||||
getFileNameWithoutExt,
|
||||
getFileInfo,
|
||||
strLength,
|
||||
strMonospacePad
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user