@gjsify/util 0.52.0 → 0.54.0
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/lib/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aborted as e,callbackify as t,debuglog as n,deprecate as r,inherits as i,isDeepStrictEqual as a,promisify as o,toUSVString as s}from"./compat.js";import{getSystemErrorMap as c,getSystemErrorName as l}from"./errors.js";import{inspect as u,kCustomInspect as d}from"./inspect.js";import{format as f,formatWithOptions as p,stripVTControlCharacters as m,styleText as h}from"./format.js";import{types_exports as g}from"./types.js";import{isArray as
|
|
1
|
+
import{aborted as e,callbackify as t,debuglog as n,deprecate as r,inherits as i,isDeepStrictEqual as a,promisify as o,toUSVString as s}from"./compat.js";import{getSystemErrorMap as c,getSystemErrorName as l}from"./errors.js";import{inspect as u,kCustomInspect as d}from"./inspect.js";import{format as f,formatWithOptions as p,stripVTControlCharacters as m,styleText as h}from"./format.js";import{types_exports as g}from"./types.js";import{parseEnv as _}from"./parse-env.js";import{isArray as v,isBoolean as y,isBuffer as b,isDate as x,isError as S,isFunction as C,isNull as w,isNullOrUndefined as T,isNumber as E,isObject as D,isPrimitive as O,isRegExp as k,isString as A,isSymbol as j,isUndefined as M}from"./legacy-predicates.js";const N=globalThis.TextDecoder,P=globalThis.TextEncoder;var F={format:f,formatWithOptions:p,styleText:h,stripVTControlCharacters:m,inspect:u,promisify:o,callbackify:t,deprecate:r,debuglog:n,inherits:i,types:g,isBoolean:y,isNull:w,isNullOrUndefined:T,isNumber:E,isString:A,isSymbol:j,isUndefined:M,isObject:D,isError:S,isFunction:C,isRegExp:k,isArray:v,isPrimitive:O,isDate:x,isBuffer:b,isDeepStrictEqual:a,toUSVString:s,aborted:e,TextDecoder:globalThis.TextDecoder,TextEncoder:globalThis.TextEncoder,getSystemErrorName:l,getSystemErrorMap:c,parseEnv:_};export{N as TextDecoder,P as TextEncoder,e as aborted,t as callbackify,n as debuglog,F as default,r as deprecate,f as format,p as formatWithOptions,c as getSystemErrorMap,l as getSystemErrorName,i as inherits,u as inspect,v as isArray,y as isBoolean,b as isBuffer,x as isDate,a as isDeepStrictEqual,S as isError,C as isFunction,w as isNull,T as isNullOrUndefined,E as isNumber,D as isObject,O as isPrimitive,k as isRegExp,A as isString,j as isSymbol,M as isUndefined,d as kCustomInspect,_ as parseEnv,o as promisify,m as stripVTControlCharacters,h as styleText,s as toUSVString,g as types};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";function trimSpaces(e){let t=0,n=e.length;for(;t<n&&`
|
|
2
|
+
`.includes(e[t]);)t++;for(;n>t&&`
|
|
3
|
+
`.includes(e[n-1]);)n--;return e.slice(t,n)}function parseEnv(e){if(typeof e!=`string`){let t=TypeError(`The "content" argument must be of type string. Received ${e===null?`null`:typeof e}`);throw t.code=`ERR_INVALID_ARG_TYPE`,t}let t=Object.create(null),n=trimSpaces(e.replace(/\r/g,``));for(;n.length>0;){if(n[0]===`
|
|
4
|
+
`||n[0]===`#`){let e=n.indexOf(`
|
|
5
|
+
`);n=e===-1?``:n.slice(e+1);continue}let e=n.search(/[=\n]/);if(e===-1)break;if(n[e]===`
|
|
6
|
+
`){n=trimSpaces(n.slice(e+1));continue}let r=trimSpaces(n.slice(0,e));if(n=n.slice(e+1),n.length===0||n[0]===`
|
|
7
|
+
`){t[r]=``;continue}if(n=trimSpaces(n),r.length!==0){if(r.startsWith(`export `)&&(r=trimSpaces(r.slice(7))),n.length===0){t[r]=``;break}if(n[0]===`"`){let e=n.indexOf(`"`,1);if(e!==-1){t[r]=n.slice(1,e).replace(/\\n/g,`
|
|
8
|
+
`);let i=n.indexOf(`
|
|
9
|
+
`,e+1);n=i===-1?``:n.slice(i+1);continue}}if(n[0]===`'`||n[0]===`"`||n[0]==="`"){let e=n.indexOf(n[0],1);if(e===-1){let e=n.indexOf(`
|
|
10
|
+
`);if(e===-1){t[r]=n;break}t[r]=n.slice(0,e),n=n.slice(e+1)}else{t[r]=n.slice(1,e);let i=n.indexOf(`
|
|
11
|
+
`,e+1);n=i===-1?``:n.slice(i+1);continue}}else{let e=n.indexOf(`
|
|
12
|
+
`),i=e===-1?n:n.slice(0,e),a=i.indexOf(`#`);a!==-1&&(i=i.slice(0,a)),t[r]=trimSpaces(i),n=e===-1?``:n.slice(e+1)}n=trimSpaces(n)}}let r={};for(let e of Object.keys(t))Object.defineProperty(r,e,{value:t[e],enumerable:!0,writable:!0,configurable:!0});return r}export{parseEnv};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import * as types from './types.js';
|
|
2
2
|
import { getSystemErrorName, getSystemErrorMap } from './errors.js';
|
|
3
|
+
import { parseEnv } from './parse-env.js';
|
|
3
4
|
import { inspect, kCustomInspect } from './inspect.js';
|
|
4
5
|
import { format, formatWithOptions, stripVTControlCharacters, styleText } from './format.js';
|
|
5
6
|
import { promisify, callbackify, deprecate, debuglog, inherits, isDeepStrictEqual, toUSVString, aborted } from './compat.js';
|
|
6
7
|
import { isBoolean, isNull, isNullOrUndefined, isNumber, isString, isSymbol, isUndefined, isObject, isError, isFunction, isRegExp, isArray, isPrimitive, isDate, isBuffer } from './legacy-predicates.js';
|
|
7
8
|
export { types };
|
|
8
9
|
export { getSystemErrorName, getSystemErrorMap };
|
|
10
|
+
export { parseEnv };
|
|
9
11
|
export { inspect, kCustomInspect };
|
|
10
12
|
export { format, formatWithOptions, stripVTControlCharacters, styleText };
|
|
11
13
|
export { promisify, callbackify, deprecate, debuglog, inherits, isDeepStrictEqual, toUSVString, aborted };
|
|
@@ -58,5 +60,6 @@ declare const _default: {
|
|
|
58
60
|
};
|
|
59
61
|
getSystemErrorName: typeof getSystemErrorName;
|
|
60
62
|
getSystemErrorMap: typeof getSystemErrorMap;
|
|
63
|
+
parseEnv: typeof parseEnv;
|
|
61
64
|
};
|
|
62
65
|
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function parseEnv(content: string): Record<string, string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/util",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.54.0",
|
|
4
4
|
"description": "Node.js util module for Gjs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
"util"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@gjsify/utils": "^0.
|
|
43
|
+
"@gjsify/utils": "^0.54.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@gjsify/cli": "^0.
|
|
47
|
-
"@gjsify/unit": "^0.
|
|
46
|
+
"@gjsify/cli": "^0.54.0",
|
|
47
|
+
"@gjsify/unit": "^0.54.0",
|
|
48
48
|
"@types/inherits": "^2.0.0",
|
|
49
49
|
"@types/node": "^25.9.2",
|
|
50
50
|
"typescript": "^6.0.3"
|