Skip to content

Commit 7646e97

Browse files
committed
update pointer attribute and logic
1 parent 7ce0f71 commit 7646e97

File tree

1 file changed

+4
-3
lines changed
  • packages/components/nodes/documentloaders/Jsonlines

1 file changed

+4
-3
lines changed

packages/components/nodes/documentloaders/Jsonlines/Jsonlines.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@ class Jsonlines_DocumentLoaders implements INode {
3737
label: 'Pointer Extraction',
3838
name: 'pointerName',
3939
type: 'string',
40-
description: 'Extracting the pointer',
4140
placeholder: 'Enter pointer name',
42-
optional: true
41+
optional: false
4342
},
4443
{
4544
label: 'Metadata',
@@ -60,6 +59,8 @@ class Jsonlines_DocumentLoaders implements INode {
6059
let alldocs = []
6160
let files: string[] = []
6261

62+
let pointer = '/' + pointerName.trim()
63+
6364
if (jsonLinesFileBase64.startsWith('[') && jsonLinesFileBase64.endsWith(']')) {
6465
files = JSON.parse(jsonLinesFileBase64)
6566
} else {
@@ -71,7 +72,7 @@ class Jsonlines_DocumentLoaders implements INode {
7172
splitDataURI.pop()
7273
const bf = Buffer.from(splitDataURI.pop() || '', 'base64')
7374
const blob = new Blob([bf])
74-
const loader = new JSONLinesLoader(blob, pointerName)
75+
const loader = new JSONLinesLoader(blob, pointer)
7576

7677
if (textSplitter) {
7778
const docs = await loader.loadAndSplit(textSplitter)

0 commit comments

Comments
 (0)