{"version":3,"sources":["global_values.ts"],"sourcesContent":["import {Logger} from \"./logger.ts\";\n\n// node not supported\n// @ts-ignore check if node environment\n// TODO: fix this check, detect node\n// if (!globalThis.Deno) throw new Error(\"node.js is currently not supported - use deno instead\")\n\nexport const TypedArray:typeof Uint8Array|typeof Uint16Array|typeof Uint32Array|typeof Int8Array|typeof Int16Array|typeof Int32Array|typeof BigInt64Array|typeof BigUint64Array|typeof Float32Array|typeof Float64Array = Object.getPrototypeOf(Uint8Array);\nexport type TypedArray = Uint8Array|Uint16Array|Uint32Array|Int8Array|Int16Array|Int32Array|BigInt64Array|BigUint64Array|Float32Array|Float64Array;\n\n// @ts-ignore\nconst is_worker = (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope);\n/**\n * @deprecated, use client_type from utils/constants.ts\n */\nexport const client_type = is_worker ? 'worker' : (\"Deno\" in globalThis && !(globalThis.Deno as any).isPolyfill ? 'deno' : 'browser')\n\nexport const Deno = globalThis.Deno;\n\nexport const logger = new Logger(\"DATEX\");\n\n// never expose those properties to DATEX (constructor, toString, ...)\nexport const DEFAULT_HIDDEN_OBJECT_PROPERTIES = new Set(Object.getOwnPropertyNames(Object.prototype));\n\n\n\n// export async function isPathDirectory(path:string){\n// \tif (!lstat) throw new Error(\"Extended file utilities are not supported\");\n// \treturn (await lstat(path)).isDirectory();\n// }\n\n// path of the unyt_core lib, without 'unyt_core/utils' path TODO: default fallback URL?\nexport const baseURL = new URL('../../', import.meta.url);\n// path to lib (@dev or other suffixes included);\nexport const libURL = new URL('../', import.meta.url);\n\n// path from which the script was executed (same aas baseURL in browsers)\nexport const cwdURL = client_type  == \"deno\" ? new URL('file://'+Deno.cwd()+\"/\") : baseURL;\n\nexport let projectRootURL = cwdURL;\n\n/**\n * Modify the project root URL (default is the current working directory)\n * @param url \n */\nexport async function _updateProjectRootURL(url:URL) {\n\tconst { _updateCachePaths } = await import(\"../runtime/cache_path.ts\");\n\n\tprojectRootURL = url;\n\tawait _updateCachePaths();\n}\n"],"names":["Logger","TypedArray","Object","getPrototypeOf","Uint8Array","is_worker","WorkerGlobalScope","self","client_type","globalThis","Deno","isPolyfill","logger","DEFAULT_HIDDEN_OBJECT_PROPERTIES","Set","getOwnPropertyNames","prototype","baseURL","URL","url","libURL","cwdURL","cwd","projectRootURL","_updateProjectRootURL","_updateCachePaths"],"mappings":"AAAA,SAAQA,MAAM,QAAO,cAAc;AAOnC,OAAO,MAAMC,aAA6MC,OAAOC,cAAc,CAACC,YAAY;AAI5P,IAAMC,YAAa,AAA6B,eAA7B,OAAOC,qBAAqCC,gBAAgBD;AAI/E,OAAO,MAAME,cAAcH,YAAY,WAAY,UAAUI,cAAc,CAAC,AAACA,WAAWC,IAAI,CAASC,UAAU,GAAG,SAAS,UAAU;AAErI,OAAO,MAAMD,OAAOD,WAAWC,IAAI,CAAC;AAEpC,OAAO,MAAME,SAAS,IAAIZ,OAAO,SAAS;AAG1C,OAAO,MAAMa,mCAAmC,IAAIC,IAAIZ,OAAOa,mBAAmB,CAACb,OAAOc,SAAS,GAAG;AAUtG,OAAO,MAAMC,UAAU,IAAIC,IAAI,UAAU,YAAYC,GAAG,EAAE;AAE1D,OAAO,MAAMC,SAAS,IAAIF,IAAI,OAAO,YAAYC,GAAG,EAAE;AAGtD,OAAO,MAAME,SAASb,AAAgB,UAAhBA,cAAyB,IAAIU,IAAI,YAAUR,KAAKY,GAAG,KAAG,OAAOL,QAAQ;AAE3F,OAAO,IAAIM,iBAAiBF,OAAO;AAMnC,OAAO,eAAeG,sBAAsBL,GAAO;IAClD,IAAM,EAAEM,iBAAiB,EAAE,GAAG,MAAM,MAAM,CAAC;IAE3CF,iBAAiBJ,KACjB,MAAMM;AACP","sourceRoot":"/lib/datex-core-js-legacy-0.3.15/utils/","file":"global_values.ts"}