@port-labs/jq-node-bindings 1.0.4 → 1.0.5

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/index.d.ts CHANGED
@@ -10,7 +10,8 @@ declare module '@port-labs/jq-node-bindings' {
10
10
 
11
11
  export function exec(json: object, input: string, options?: ExecOptions): object | Array<any> | string | number | boolean | null;
12
12
  export function execAsync(json: object, input: string, options?: ExecAsyncOptions): Promise<object | Array<any> | string | number | boolean | null>;
13
-
13
+ export function setCacheSize(cacheSize: number): void;
14
14
  export function renderRecursively(json: object, input: object | Array<any> | string | number | boolean | null, execOptions?: ExecOptions): object | Array<any> | string | number | boolean | null;
15
15
  export function renderRecursivelyAsync(json: object, input: object | Array<any> | string | number | boolean | null, execOptions?: ExecAsyncOptions): Promise<object | Array<any> | string | number | boolean | null>;
16
+
16
17
  }
package/lib/index.js CHANGED
@@ -6,6 +6,7 @@ const templateAsync = require('./templateAsync');
6
6
  module.exports = {
7
7
  exec: jq.exec,
8
8
  execAsync: jq.execAsync,
9
+ setCacheSize: jq.setCacheSize,
9
10
  renderRecursively: template.renderRecursively,
10
11
  renderRecursivelyAsync: templateAsync.renderRecursivelyAsync,
11
12
  JqExecError: jq.JqExecError,
package/lib/jq.js CHANGED
@@ -1,5 +1,6 @@
1
1
  const nativeJq = require('bindings')('jq-node-bindings')
2
2
  nativeJq.setCacheSize(1000)
3
+
3
4
  const formatFilter = (filter, {enableEnv = false} = {}) => {
4
5
  // Escape single quotes only if they are opening or closing a string
5
6
  let formattedFilter = filter.replace(/(^|\s)'(?!\s|")|(?<!\s|")'(\s|$)/g, '$1"$2');
@@ -41,7 +42,7 @@ const execAsync = async (object, filter, {enableEnv = false, throwOnError = fals
41
42
  module.exports = {
42
43
  exec,
43
44
  execAsync,
45
+ setCacheSize: nativeJq.setCacheSize,
44
46
  JqExecError,
45
47
  JqExecCompileError,
46
- setCacheSize:nativeJq.setCacheSize
47
48
  };
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@port-labs/jq-node-bindings",
3
- "version": "v1.0.4",
3
+ "version": "v1.0.5",
4
4
  "description": "Node.js bindings for JQ",
5
- "jq-node-bindings": "1.0.3",
5
+ "jq-node-bindings": "1.0.5",
6
6
  "main": "lib/index.js",
7
7
  "scripts": {
8
8
  "configure": "node-gyp configure",