@port-labs/jq-node-bindings 0.0.6 → 0.0.8

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/configure CHANGED
@@ -9,7 +9,8 @@ echo "building jq"
9
9
  echo $scriptdir
10
10
 
11
11
  autoreconf -fi
12
- CPPFLAGS=-D_REENTRANT ./configure \
12
+ make distclean
13
+ CPPFLAGS=-D_REENTRANT ./configure CFLAGS=-fPIC \
13
14
  --disable-maintainer-mode \
14
15
  --with-oniguruma=builtin \
15
16
  --libdir="${scriptdir}/build/deps" \
package/lib/index.js CHANGED
@@ -2,7 +2,7 @@ const nativeJq = require('bindings')('jq-node-bindings')
2
2
 
3
3
  const escapeFilter = (filter) => {
4
4
  // Escape single quotes only if they are opening or closing a string
5
- return filter.replace(/^'|'$|(?<=\W)'(?=[^"]*$)|"(?=[^"]*'$)/g, '"');
5
+ return filter.replace(/(^|\s)'(?!\s|")|(?<!\s|")'(\s|$)/g, '$1"$2');
6
6
  }
7
7
 
8
8
 
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@port-labs/jq-node-bindings",
3
- "version": "v0.0.6",
3
+ "version": "v0.0.8",
4
4
  "description": "Node.js bindings for JQ",
5
- "jq-node-bindings": "0.0.6",
5
+ "jq-node-bindings": "0.0.8",
6
6
  "main": "lib/index.js",
7
7
  "scripts": {
8
8
  "configure": "node-gyp configure",
@@ -142,5 +142,13 @@ describe('jq', () => {
142
142
 
143
143
  expect(result).toBe('foo');
144
144
  })
145
+
146
+ it ('Testing multiple the \'\' in the same expression', () => {
147
+ const json = { foo: 'bar' };
148
+ const input = "'https://some.random.url' + .foo + '-1' + '.' + .foo + '.' + 'longgggg' + .foo + ')test(' + .foo + 'testadsftets'";
149
+ const result = jq.exec(json, input);
150
+
151
+ expect(result).toBe('https://some.random.urlbar-1.bar.longggggbar)test(bartestadsftets');
152
+ })
145
153
  })
146
154