New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

fontoxpath

Package Overview
Dependencies
Maintainers
3
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fontoxpath - npm Package Compare versions

Comparing version 3.25.1 to 3.26.0

62

dist/fontoxpath.d.ts

@@ -210,2 +210,6 @@ /// <reference lib="dom" />

/**
* Resolve to all results, adapted to JavaScript values
*/
ALL_RESULTS_TYPE: ReturnType_2.ALL_RESULTS;
/**
* Returns the result of the query, can be anything depending on the

@@ -215,2 +219,6 @@ * query. Note that the return type is determined dynamically, not

* arrays and not null, like one might expect.
*
* @deprecated
*
* For predictable results, use the ALL_RESULTS return type
*/

@@ -647,2 +655,5 @@ ANY_TYPE: ReturnType_2.ANY;

[ReturnType_2.NUMBERS]: number[];
[ReturnType_2.ALL_RESULTS]: (T | string | Date | boolean | number | any[] | {
[s: string]: any;
})[];
[ReturnType_2.ASYNC_ITERATOR]: AsyncIterableIterator<any>;

@@ -998,12 +1009,63 @@ }

declare enum ReturnType_2 {
/**
* ANY Will result in ANY result. This closesly resembles what XPathResult.ANY_TYPE returns.
*
* If the result is a single item (ie. one node, one string, one number, etcetera), only that value is returned.
*
* If the result is the empty sequence, an empty array is returned
*
* If the result is multiple items, an array with those items is returned. Nodes are returned as-is, but attribute nodes are atomized.
*
* Note that this is usually _not_ what you'd expect, and may cause bugs to show up when you
* don't expect. Use ALL_RESULTS to get all results, always as an array, without special
* handling for attribute nodes.
*
* @deprecated use ALL_RESULTS instead
*/
'ANY' = 0,
/**
* Always returns a number. NaN if the result of the query is not a valid number
*/
'NUMBER' = 1,
/**
* Always returns a string.
*/
'STRING' = 2,
/**
* Always returns a boolean. Uses the `effective boolean value` algorithm to determine the result if the query did not return a boolean by itself
*/
'BOOLEAN' = 3,
/**
* Returns all nodes, as an array. Throws an error if the result contains anything but nodes
*/
'NODES' = 7,
/**
* Returns only the first node in the result
*/
'FIRST_NODE' = 9,
/**
* Returns all strings the query returns, as an array
*/
'STRINGS' = 10,
/**
* Returns the map the query returns. Error when the query does not result in exactly one map
*/
'MAP' = 11,
/**
* Returns the array the query returns. Error when the query does not result in exactly one array
*/
'ARRAY' = 12,
/**
* Returns all numbers the query resulted in. Invalid numbers are replaced with NaN
*/
'NUMBERS' = 13,
/**
* Returns all results of the query, as completely as possible: nodes are nodes, attributes are attribute nodes, dateTimes are turned into DateTime objects.
*/
'ALL_RESULTS' = 14,
/**
* Returns an async iterator of the results. Since FontoXPath can no longer return results asychronously, the ALL_RESULTS option is better to use.
*
* @deprecated Use ALL_RESULTS instead
*/
'ASYNC_ITERATOR' = 99

@@ -1010,0 +1072,0 @@ }

2

package.json
{
"name": "fontoxpath",
"version": "3.25.1",
"version": "3.26.0",
"description": "A minimalistic XPath 3.1 engine in JavaScript",

@@ -5,0 +5,0 @@ "main": "dist/fontoxpath.js",

@@ -39,8 +39,9 @@ # fontoxpath ![Build Status](https://github.com/FontoXML/fontoxpath/workflows/CI/badge.svg) [![NPM version](https://badge.fury.io/js/fontoxpath.svg)](http://badge.fury.io/js/fontoxpath) [![bundle size](https://badgen.net/bundlephobia/minzip/fontoxpath)](https://bundlephobia.com/result?p=fontoxpath) [![Coverage Status](https://coveralls.io/repos/github/FontoXML/fontoxpath/badge.svg?branch=master)](https://coveralls.io/github/FontoXML/fontoxpath?branch=master) [![Known Vulnerabilities](https://snyk.io/test/github/FontoXML/fontoxpath/badge.svg?targetFile=package.json)](https://snyk.io/test/github/FontoXML/fontoxpath?targetFile=package.json) [![CodeFactor](https://www.codefactor.io/repository/github/fontoxml/fontoxpath/badge)](https://www.codefactor.io/repository/github/fontoxml/fontoxpath)

- `variables` `<Object>` The properties of `variables` are available variables within the
`xpathExpression`. Defaults to an empty `Object`. Can only be used to set variables in the global namespace.
`xpathExpression`. Defaults to an empty `Object`. Can only be used to set variables in the
global namespace.
- `returnType` `<number>` Determines the type of the result. Defaults to
`evaluateXPath.ANY_TYPE`. Possible values:
- `evaluateXPath.ANY_TYPE` Returns the result of the query, can be anything depending on the
query. Note that the return type is determined dynamically, not statically: XPaths returning
empty sequences will return empty arrays and not null, like one might expect.
- `evaluateXPath.ALL_RESULTS_TYPE` Returns the result of the query, can be anything depending
on the query. This will always be an array, and the result can be mixed: contain both nodes
and strings for example.
- `evaluateXPath.NUMBER_TYPE` Resolve to a `number`, like count((1,2,3)) resolves to 3.

@@ -61,2 +62,6 @@ - `evaluateXPath.STRING_TYPE` Resolve to a `string`, like //someElement[1] resolves to the text

- `evaluateXPath.NUMBERS_TYPE` Resolve to an array of numbers `number[]`.
- `evaluateXPath.ANY_TYPE` Returns the result of the query, can be anything depending on the
query. Note that the return type is determined dynamically, not statically: XPaths returning
empty sequences will return empty arrays and not null, like one might expect.
This is deprecated, use `evaluateXPath.ALL_RESULTS_TYPE` instead, since that is more predictable.
- `options` `<Object>` Options used to modify the behavior. The following options are available:

@@ -63,0 +68,0 @@ - `namespaceResolver` `<function(string):string?>` By default, the namespaces in scope of the

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc