@getlang/lib
Advanced tools
Comparing version 0.0.17 to 0.1.0
@@ -1,2 +0,2 @@ | ||
import { SliceError, NullSelection } from '@getlang/utils'; | ||
import { NullSelection, SliceError } from '@getlang/utils'; | ||
export const runSlice = async (slice, context = {}, raw = {}) => { | ||
@@ -3,0 +3,0 @@ try { |
@@ -0,3 +1,3 @@ | ||
import { NullSelection } from '@getlang/utils'; | ||
import * as scp from 'set-cookie-parser'; | ||
import { NullSelection } from '@getlang/utils'; | ||
export declare const parse: (source: string) => scp.CookieMap; | ||
@@ -4,0 +4,0 @@ export declare const select: (cookies: scp.CookieMap, selector: string, expand: boolean) => string | NullSelection; |
@@ -0,4 +1,4 @@ | ||
import { NullSelection, QuerySyntaxError, invariant } from '@getlang/utils'; | ||
import { mapValues } from 'lodash-es'; | ||
import * as scp from 'set-cookie-parser'; | ||
import { mapValues } from 'lodash-es'; | ||
import { QuerySyntaxError, invariant, NullSelection } from '@getlang/utils'; | ||
export const parse = (source) => { | ||
@@ -5,0 +5,0 @@ const cookie = scp.splitCookiesString(source); |
@@ -0,3 +1,3 @@ | ||
import { NullSelection } from '@getlang/utils'; | ||
import type { AnyHtmlNode } from 'domhandler'; | ||
import { NullSelection } from '@getlang/utils'; | ||
import './html/patch-dom.js'; | ||
@@ -4,0 +4,0 @@ export declare const parse: (html: string) => AnyHtmlNode; |
/// <reference types="./html/types.d.ts" /> | ||
import { parse as parse5 } from 'parse5'; | ||
import { adapter } from 'parse5-htmlparser2-tree-adapter'; | ||
import { NullSelection, NullSelectionError, SelectorSyntaxError, invariant, } from '@getlang/utils'; | ||
import xpath from '@getlang/xpath'; | ||
import { textContent } from 'domutils'; | ||
import { selectAll, selectOne } from 'css-select'; | ||
import { parse as parseCss } from 'css-what'; | ||
import { SelectorSyntaxError, NullSelectionError, invariant, NullSelection, } from '@getlang/utils'; | ||
import { textContent } from 'domutils'; | ||
import { parse as parse5 } from 'parse5'; | ||
import { adapter } from 'parse5-htmlparser2-tree-adapter'; | ||
import './html/patch-dom.js'; | ||
@@ -10,0 +10,0 @@ export const parse = (html) => { |
import ds from 'dom-serializer'; | ||
import { Node, Element } from 'domhandler'; | ||
import { Element, Node } from 'domhandler'; | ||
function main() { | ||
@@ -4,0 +4,0 @@ Element.prototype.toString = function () { |
@@ -0,5 +1,5 @@ | ||
import { NullSelection } from '@getlang/utils'; | ||
import type { AnyNode } from 'acorn'; | ||
import { NullSelection } from '@getlang/utils'; | ||
export declare const parse: (js: string) => AnyNode; | ||
export declare const select: (node: AnyNode, selector: string, expand: boolean) => NullSelection | import("estree").Program | import("estree").Property | import("estree").CatchClause | import("estree").ClassDeclaration | import("estree").ClassExpression | import("estree").ClassBody | import("estree").Identifier | import("estree").SimpleLiteral | import("estree").RegExpLiteral | import("estree").BigIntLiteral | import("estree").ArrayExpression | import("estree").ArrowFunctionExpression | import("estree").AssignmentExpression | import("estree").AwaitExpression | import("estree").BinaryExpression | import("estree").SimpleCallExpression | import("estree").NewExpression | import("estree").ChainExpression | import("estree").ConditionalExpression | import("estree").FunctionExpression | import("estree").ImportExpression | import("estree").LogicalExpression | import("estree").MemberExpression | import("estree").MetaProperty | import("estree").ObjectExpression | import("estree").SequenceExpression | import("estree").TaggedTemplateExpression | import("estree").TemplateLiteral | import("estree").ThisExpression | import("estree").UnaryExpression | import("estree").UpdateExpression | import("estree").YieldExpression | import("estree").FunctionDeclaration | import("estree").MethodDefinition | import("estree").ImportDeclaration | import("estree").ExportNamedDeclaration | import("estree").ExportDefaultDeclaration | import("estree").ExportAllDeclaration | import("estree").ImportSpecifier | import("estree").ImportDefaultSpecifier | import("estree").ImportNamespaceSpecifier | import("estree").ExportSpecifier | import("estree").ObjectPattern | import("estree").ArrayPattern | import("estree").RestElement | import("estree").AssignmentPattern | import("estree").PrivateIdentifier | import("estree").PropertyDefinition | import("estree").SpreadElement | import("estree").ExpressionStatement | import("estree").BlockStatement | import("estree").StaticBlock | import("estree").EmptyStatement | import("estree").DebuggerStatement | import("estree").WithStatement | import("estree").ReturnStatement | import("estree").LabeledStatement | import("estree").BreakStatement | import("estree").ContinueStatement | import("estree").IfStatement | import("estree").SwitchStatement | import("estree").ThrowStatement | import("estree").TryStatement | import("estree").WhileStatement | import("estree").DoWhileStatement | import("estree").ForStatement | import("estree").ForInStatement | import("estree").ForOfStatement | import("estree").VariableDeclaration | import("estree").Super | import("estree").SwitchCase | import("estree").TemplateElement | import("estree").VariableDeclarator | import("estree").Node[] | undefined; | ||
export declare const select: (node: AnyNode, selector: string, expand: boolean) => NullSelection | import("estree").Property | import("estree").CatchClause | import("estree").ClassDeclaration | import("estree").ClassExpression | import("estree").ClassBody | import("estree").Identifier | import("estree").SimpleLiteral | import("estree").RegExpLiteral | import("estree").BigIntLiteral | import("estree").ArrayExpression | import("estree").ArrowFunctionExpression | import("estree").AssignmentExpression | import("estree").AwaitExpression | import("estree").BinaryExpression | import("estree").SimpleCallExpression | import("estree").NewExpression | import("estree").ChainExpression | import("estree").ConditionalExpression | import("estree").FunctionExpression | import("estree").ImportExpression | import("estree").LogicalExpression | import("estree").MemberExpression | import("estree").MetaProperty | import("estree").ObjectExpression | import("estree").SequenceExpression | import("estree").TaggedTemplateExpression | import("estree").TemplateLiteral | import("estree").ThisExpression | import("estree").UnaryExpression | import("estree").UpdateExpression | import("estree").YieldExpression | import("estree").FunctionDeclaration | import("estree").MethodDefinition | import("estree").ImportDeclaration | import("estree").ExportNamedDeclaration | import("estree").ExportDefaultDeclaration | import("estree").ExportAllDeclaration | import("estree").ImportSpecifier | import("estree").ImportDefaultSpecifier | import("estree").ImportNamespaceSpecifier | import("estree").ExportSpecifier | import("estree").ObjectPattern | import("estree").ArrayPattern | import("estree").RestElement | import("estree").AssignmentPattern | import("estree").PrivateIdentifier | import("estree").Program | import("estree").PropertyDefinition | import("estree").SpreadElement | import("estree").ExpressionStatement | import("estree").BlockStatement | import("estree").StaticBlock | import("estree").EmptyStatement | import("estree").DebuggerStatement | import("estree").WithStatement | import("estree").ReturnStatement | import("estree").LabeledStatement | import("estree").BreakStatement | import("estree").ContinueStatement | import("estree").IfStatement | import("estree").SwitchStatement | import("estree").ThrowStatement | import("estree").TryStatement | import("estree").WhileStatement | import("estree").DoWhileStatement | import("estree").ForStatement | import("estree").ForInStatement | import("estree").ForOfStatement | import("estree").VariableDeclaration | import("estree").Super | import("estree").SwitchCase | import("estree").TemplateElement | import("estree").VariableDeclarator | import("estree").Node[] | undefined; | ||
export declare const toValue: (node: AnyNode) => string | number | bigint | boolean | RegExp | null | undefined; |
@@ -0,4 +1,4 @@ | ||
import { ConversionError, NullSelection, SelectorSyntaxError, invariant, } from '@getlang/utils'; | ||
import { parse as acorn } from 'acorn'; | ||
import esquery from 'esquery'; | ||
import { SelectorSyntaxError, ConversionError, invariant, NullSelection, } from '@getlang/utils'; | ||
export const parse = (js) => { | ||
@@ -5,0 +5,0 @@ return acorn(js, { ecmaVersion: 'latest' }); |
@@ -0,3 +1,3 @@ | ||
import { NullSelection } from '@getlang/utils'; | ||
import { get } from 'lodash-es'; | ||
import { NullSelection } from '@getlang/utils'; | ||
export const parse = (json) => JSON.parse(json); | ||
@@ -4,0 +4,0 @@ // only an `undefined` result is considered a null selection |
@@ -0,3 +1,3 @@ | ||
import { RequestError } from '@getlang/utils' | ||
import type { Element } from 'domhandler' | ||
import { RequestError } from '@getlang/utils' | ||
@@ -4,0 +4,0 @@ type StringMap = Record<string, string> |
{ | ||
"name": "@getlang/lib", | ||
"version": "0.0.17", | ||
"version": "0.1.0", | ||
"license": "Apache-2.0", | ||
@@ -20,20 +20,20 @@ "type": "module", | ||
"dependencies": { | ||
"@getlang/utils": "^0.1.0", | ||
"@getlang/xpath": "0.0.35-0", | ||
"acorn": "^8.12.0", | ||
"@types/esquery": "^1.5.4", | ||
"@types/lodash-es": "^4.17.12", | ||
"@types/set-cookie-parser": "^2.4.10", | ||
"acorn": "^8.12.1", | ||
"css-select": "^5.1.0", | ||
"css-what": "^6.1.0", | ||
"dom-serializer": "^2.0.0", | ||
"domelementtype": "*", | ||
"domhandler": "^5.0.3", | ||
"domutils": "^3.1.0", | ||
"esquery": "^1.5.0", | ||
"esquery": "^1.6.0", | ||
"lodash-es": "^4.17.21", | ||
"parse5": "^7.1.2", | ||
"parse5-htmlparser2-tree-adapter": "^7.0.0", | ||
"set-cookie-parser": "^2.6.0" | ||
}, | ||
"devDependencies": { | ||
"@types/esquery": "^1.5.4", | ||
"@types/lodash-es": "^4.17.12", | ||
"@types/set-cookie-parser": "^2.4.9" | ||
"set-cookie-parser": "^2.7.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
import { SliceError, NullSelection } from '@getlang/utils' | ||
import { NullSelection, SliceError } from '@getlang/utils' | ||
@@ -3,0 +3,0 @@ export const runSlice = async ( |
@@ -0,4 +1,4 @@ | ||
import { NullSelection, QuerySyntaxError, invariant } from '@getlang/utils' | ||
import { mapValues } from 'lodash-es' | ||
import * as scp from 'set-cookie-parser' | ||
import { mapValues } from 'lodash-es' | ||
import { QuerySyntaxError, invariant, NullSelection } from '@getlang/utils' | ||
@@ -5,0 +5,0 @@ export const parse = (source: string) => { |
/// <reference types="./html/types.d.ts" /> | ||
import type { AnyHtmlNode } from 'domhandler' | ||
import { parse as parse5 } from 'parse5' | ||
import { adapter } from 'parse5-htmlparser2-tree-adapter' | ||
import xpath from '@getlang/xpath' | ||
import { textContent } from 'domutils' | ||
import { selectAll, selectOne } from 'css-select' | ||
import { parse as parseCss } from 'css-what' | ||
import { | ||
NullSelection, | ||
NullSelectionError, | ||
SelectorSyntaxError, | ||
NullSelectionError, | ||
invariant, | ||
NullSelection, | ||
} from '@getlang/utils' | ||
import xpath from '@getlang/xpath' | ||
import { selectAll, selectOne } from 'css-select' | ||
import { parse as parseCss } from 'css-what' | ||
import type { AnyHtmlNode } from 'domhandler' | ||
import { textContent } from 'domutils' | ||
import { parse as parse5 } from 'parse5' | ||
import { adapter } from 'parse5-htmlparser2-tree-adapter' | ||
import './html/patch-dom.js' | ||
@@ -17,0 +17,0 @@ |
@@ -0,6 +1,6 @@ | ||
import ds from 'dom-serializer' | ||
// @sideEffects | ||
import type { ElementType } from 'domelementtype' | ||
import ds from 'dom-serializer' | ||
import type { AnyNode } from 'domhandler' | ||
import { Node, Element } from 'domhandler' | ||
import { Element, Node } from 'domhandler' | ||
@@ -7,0 +7,0 @@ declare module 'domhandler' { |
@@ -1,10 +0,10 @@ | ||
import { parse as acorn } from 'acorn' | ||
import type { AnyNode } from 'acorn' | ||
import esquery from 'esquery' | ||
import { | ||
ConversionError, | ||
NullSelection, | ||
SelectorSyntaxError, | ||
ConversionError, | ||
invariant, | ||
NullSelection, | ||
} from '@getlang/utils' | ||
import { parse as acorn } from 'acorn' | ||
import type { AnyNode } from 'acorn' | ||
import esquery from 'esquery' | ||
@@ -11,0 +11,0 @@ export const parse = (js: string): AnyNode => { |
@@ -0,3 +1,3 @@ | ||
import { NullSelection } from '@getlang/utils' | ||
import { get } from 'lodash-es' | ||
import { NullSelection } from '@getlang/utils' | ||
@@ -4,0 +4,0 @@ export const parse = (json: string) => JSON.parse(json) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35596
0
39
17
3
+ Added@getlang/utils@^0.1.0
+ Added@types/esquery@^1.5.4
+ Added@types/lodash-es@^4.17.12
+ Addeddomelementtype@*
+ Added@getlang/utils@0.1.1(transitive)
+ Added@types/esquery@1.5.4(transitive)
+ Added@types/estree@1.0.6(transitive)
+ Added@types/lodash@4.17.13(transitive)
+ Added@types/lodash-es@4.17.12(transitive)
+ Added@types/node@22.9.2(transitive)
+ Added@types/set-cookie-parser@2.4.10(transitive)
+ Addedundici-types@6.19.8(transitive)
Updatedacorn@^8.12.1
Updatedesquery@^1.6.0
Updatedset-cookie-parser@^2.7.0