@garfish/utils
Advanced tools
Comparing version 0.1.13-beta.9 to 0.1.13-beta.10
@@ -1,7 +0,110 @@ | ||
export * from './utils'; | ||
export * from './sentry'; | ||
export * from './domApis'; | ||
export * from './garfish'; | ||
export * from './mimeType'; | ||
export * from './container'; | ||
export * from './templateParse'; | ||
import { interfaces } from '@garfish/core'; | ||
declare const objectToString: () => string; | ||
declare const noop: () => void; | ||
declare function createKey(): string; | ||
declare function isObject(val: any): boolean; | ||
declare function isPlainObject(val: any): boolean; | ||
declare function isPromise(obj: any): boolean; | ||
declare function hasOwn(obj: any, key: PropertyKey): boolean; | ||
declare function def(obj: Object, key: string, value: any): void; | ||
declare function makeMap(list: Array<PropertyKey>): (val: any) => boolean; | ||
declare function inBrowser(): boolean; | ||
declare function warn(msg: string | Error): void; | ||
declare function error(error: string | Error): void; | ||
declare function validURL(str: any): boolean; | ||
declare function internFunc(internalizeString: any): string; | ||
declare function evalWithEnv(code: string, params: Record<string, any>): void; | ||
declare function nextTick(cb: () => void): void; | ||
declare function assert(condition: any, msg?: string | Error): void; | ||
declare function toBoolean(val: any): boolean; | ||
declare function remove<T>(list: Array<T> | Set<T>, el: T): boolean; | ||
declare function callTestCallback(obj: any, ...args: any[]): void; | ||
declare function unique<T>(list: Array<T>): T[]; | ||
declare function isPrimitive(val: any): boolean; | ||
declare function deepMerge<K, T>(o: K, n: T, dp?: boolean): K & T; | ||
declare function isAbsolute(url: string): boolean; | ||
declare function transformUrl(resolvePath: string, curPath: string): string; | ||
declare function findTarget(el: Element | ShadowRoot | Document, selectors: Array<string>): Element | ShadowRoot | Document; | ||
declare function setDocCurrentScript(target: any, code: string, define?: boolean, url?: string, async?: boolean): () => void; | ||
declare function __extends(d: any, b: any): void; | ||
declare function isFunction(what: unknown): what is Function; | ||
declare const hookObjectProperty: <T extends {}, K extends keyof T, P extends any[]>(obj: T, key: K, hookFunc: (origin: T[K], ...params: P) => T[K]) => (...params: P) => (strict?: boolean) => void; | ||
interface StackFrame { | ||
url: string; | ||
func: string; | ||
args: string[]; | ||
line: number | null; | ||
column: number | null; | ||
} | ||
interface StackTrace { | ||
name: string; | ||
message: string; | ||
mechanism?: string; | ||
stack: StackFrame[]; | ||
failed?: boolean; | ||
} | ||
declare function computeStackTraceFromStackProp(ex: any): StackTrace | null; | ||
declare const sourceListTags: string[]; | ||
declare const sourceNode: (val: any) => boolean; | ||
declare function computeErrorUrl(ex: any): any; | ||
declare function filterAndWrapEventListener(type: string, listener: EventListenerOrEventListenerObject, sourceList: Array<string>): EventListener; | ||
interface Text { | ||
content: string; | ||
type: 'text' | 'comment'; | ||
} | ||
interface Node { | ||
key?: string; | ||
type: 'element'; | ||
tagName: string; | ||
children: Array<Node | Text>; | ||
attributes: Array<Record<string, string | null>>; | ||
} | ||
declare type Attributes = Array<Record<string, string | null>>; | ||
declare class DOMApis { | ||
document: Document; | ||
constructor(cusDocument?: Document); | ||
isText(node: Node | Text): boolean; | ||
isNode(node: Node | Text): boolean; | ||
isCommentNode(node: Node | Text): boolean; | ||
isCssLinkNode(node: Node): boolean; | ||
isIconLinkNode(node: Node): boolean; | ||
isPrefetchJsLinkNode(node: Node): boolean; | ||
isRemoteModule(node: Node): boolean; | ||
removeElement(el: Element): void; | ||
createElement(node: Node): HTMLElement | SVGElement; | ||
createTextNode(node: Text): globalThis.Text; | ||
createStyleNode(content: string): HTMLStyleElement; | ||
createLinkCommentNode(node: Node | string): string | Comment; | ||
createScriptCommentNode(node: Node | { | ||
code: string; | ||
src?: string; | ||
}): Comment; | ||
applyAttributes(el: Element, attributes: Attributes): void; | ||
} | ||
declare const __GARFISH_FLAG__: unique symbol; | ||
declare const __MockBody__ = "__garfishmockbody__"; | ||
declare const __MockHead__ = "__garfishmockhead__"; | ||
declare const __ELEMENT_DELETE_TAG__ = "__ELEMENT_DELETE_TAG__"; | ||
declare type mimeType = ReturnType<typeof parseContentType>; | ||
declare function parseContentType(input: string): { | ||
type: string; | ||
subtype: string; | ||
}; | ||
declare function isCss(mt: mimeType): boolean; | ||
declare function isHtml(mt: mimeType): boolean; | ||
declare function isJs(mt: mimeType): boolean; | ||
declare function createAppContainer(name: string): { | ||
htmlNode: HTMLDivElement; | ||
appContainer: HTMLDivElement; | ||
}; | ||
declare function getRenderNode(domGetter: interfaces.DomGetter): Promise<Element>; | ||
declare function templateParse(code?: string, tags?: Array<string>): readonly [Node[], Record<string, Node[]>]; | ||
export { DOMApis, Node, StackFrame, StackTrace, Text, __ELEMENT_DELETE_TAG__, __GARFISH_FLAG__, __MockBody__, __MockHead__, __extends, assert, callTestCallback, computeErrorUrl, computeStackTraceFromStackProp, createAppContainer, createKey, deepMerge, def, error, evalWithEnv, filterAndWrapEventListener, findTarget, getRenderNode, hasOwn, hookObjectProperty, inBrowser, internFunc, isAbsolute, isCss, isFunction, isHtml, isJs, isObject, isPlainObject, isPrimitive, isPromise, makeMap, mimeType, nextTick, noop, objectToString, parseContentType, remove, setDocCurrentScript, sourceListTags, sourceNode, templateParse, toBoolean, transformUrl, unique, validURL, warn }; |
{ | ||
"name": "@garfish/utils", | ||
"version": "0.1.13-beta.9", | ||
"version": "0.1.13-beta.10", | ||
"description": "utils module.", | ||
@@ -12,4 +12,2 @@ "keywords": [ | ||
"license": "Apache-2.0", | ||
"main": "index.js", | ||
"module": "dist/utils.esm-bundler.js", | ||
"repository": { | ||
@@ -22,2 +20,11 @@ "type": "git", | ||
}, | ||
"exports": { | ||
".": { | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.js" | ||
}, | ||
"./*": "./*" | ||
}, | ||
"main": "dist/index.js", | ||
"module": "dist/index.mjs", | ||
"types": "dist/index.d.ts", | ||
@@ -35,3 +42,3 @@ "buildOptions": { | ||
"dependencies": { | ||
"@garfish/core": "0.1.13-beta.9" | ||
"@garfish/core": "0.1.13-beta.10" | ||
}, | ||
@@ -43,3 +50,6 @@ "publishConfig": { | ||
"gitHead": "e8bf48ea8ca8db408a4a0a1cdab8ce4a50ab279b", | ||
"scripts": {} | ||
"scripts": { | ||
"build": "rimraf dist && tsup src/index.ts", | ||
"dev": "cross-env WATCH=true tsup src/index.ts" | ||
} | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
115265
11
2407
9
3
+ Added@garfish/core@0.1.13-beta.10(transitive)
+ Added@garfish/hooks@0.1.13-beta.10(transitive)
+ Added@garfish/loader@0.1.13-beta.10(transitive)
- Removed@garfish/core@0.1.13-beta.9(transitive)
- Removed@garfish/hooks@0.1.13-beta.9(transitive)
- Removed@garfish/loader@0.1.13-beta.9(transitive)
Updated@garfish/core@0.1.13-beta.10