@morphql/language-definitions 0.1.10 → 0.1.12
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/dist/index.cjs +33 -1
- package/dist/index.js +33 -1
- package/dist/morphql-lang.json +39 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -51,7 +51,7 @@ var KEYWORDS = [
|
|
|
51
51
|
parameters: [
|
|
52
52
|
{
|
|
53
53
|
name: "format",
|
|
54
|
-
description: "If used as first keyword: The starting format name (e.g., `json`, `xml`, `csv`, `object`). When used after a section, defines its source."
|
|
54
|
+
description: "If used as first keyword: The starting format name (e.g., `json`, `xml`, `csv`, `plaintext`, `object`). When used after a section, defines its source."
|
|
55
55
|
}
|
|
56
56
|
],
|
|
57
57
|
example: "from json to csv"
|
|
@@ -391,6 +391,38 @@ var FUNCTIONS = [
|
|
|
391
391
|
returns: "array of objects",
|
|
392
392
|
example: 'spreadsheet(csvData) // Converts [["name","age"],["John",30]] to [{name:"John",age:30}]'
|
|
393
393
|
}
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
name: "unpack",
|
|
397
|
+
doc: {
|
|
398
|
+
signature: "unpack(str, fieldSpec1, [fieldSpec2, ...])",
|
|
399
|
+
description: 'Extracts multiple fields from a fixed-length string into an object. Specs follow the pattern "name:start:length[:modifier]".',
|
|
400
|
+
parameters: [
|
|
401
|
+
{ name: "str", description: "The fixed-length string to unpack" },
|
|
402
|
+
{
|
|
403
|
+
name: "fieldSpec",
|
|
404
|
+
description: 'Field definition: "name:start:length". Optional ":raw" modifier at the end disables auto-trimming.'
|
|
405
|
+
}
|
|
406
|
+
],
|
|
407
|
+
returns: "object",
|
|
408
|
+
example: 'unpack(source, "id:0:5", "name:5:20", "padding:25:5:raw")'
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
name: "pack",
|
|
413
|
+
doc: {
|
|
414
|
+
signature: "pack(obj, fieldSpec1, [fieldSpec2, ...])",
|
|
415
|
+
description: 'Encodes an object into a fixed-length string using field specifications. Specs follow the pattern "name:start:length[:modifier]".',
|
|
416
|
+
parameters: [
|
|
417
|
+
{ name: "obj", description: "The object containing data to pack" },
|
|
418
|
+
{
|
|
419
|
+
name: "fieldSpec",
|
|
420
|
+
description: 'Field definition: "name:start:length". Optional ":left" modifier at the end uses left-padding (right-alignment).'
|
|
421
|
+
}
|
|
422
|
+
],
|
|
423
|
+
returns: "string",
|
|
424
|
+
example: 'pack(target, "id:0:5:left", "name:5:20")'
|
|
425
|
+
}
|
|
394
426
|
}
|
|
395
427
|
];
|
|
396
428
|
var getFunctionNames = () => FUNCTIONS.map((f) => f.name);
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ var KEYWORDS = [
|
|
|
9
9
|
parameters: [
|
|
10
10
|
{
|
|
11
11
|
name: "format",
|
|
12
|
-
description: "If used as first keyword: The starting format name (e.g., `json`, `xml`, `csv`, `object`). When used after a section, defines its source."
|
|
12
|
+
description: "If used as first keyword: The starting format name (e.g., `json`, `xml`, `csv`, `plaintext`, `object`). When used after a section, defines its source."
|
|
13
13
|
}
|
|
14
14
|
],
|
|
15
15
|
example: "from json to csv"
|
|
@@ -349,6 +349,38 @@ var FUNCTIONS = [
|
|
|
349
349
|
returns: "array of objects",
|
|
350
350
|
example: 'spreadsheet(csvData) // Converts [["name","age"],["John",30]] to [{name:"John",age:30}]'
|
|
351
351
|
}
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
name: "unpack",
|
|
355
|
+
doc: {
|
|
356
|
+
signature: "unpack(str, fieldSpec1, [fieldSpec2, ...])",
|
|
357
|
+
description: 'Extracts multiple fields from a fixed-length string into an object. Specs follow the pattern "name:start:length[:modifier]".',
|
|
358
|
+
parameters: [
|
|
359
|
+
{ name: "str", description: "The fixed-length string to unpack" },
|
|
360
|
+
{
|
|
361
|
+
name: "fieldSpec",
|
|
362
|
+
description: 'Field definition: "name:start:length". Optional ":raw" modifier at the end disables auto-trimming.'
|
|
363
|
+
}
|
|
364
|
+
],
|
|
365
|
+
returns: "object",
|
|
366
|
+
example: 'unpack(source, "id:0:5", "name:5:20", "padding:25:5:raw")'
|
|
367
|
+
}
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
name: "pack",
|
|
371
|
+
doc: {
|
|
372
|
+
signature: "pack(obj, fieldSpec1, [fieldSpec2, ...])",
|
|
373
|
+
description: 'Encodes an object into a fixed-length string using field specifications. Specs follow the pattern "name:start:length[:modifier]".',
|
|
374
|
+
parameters: [
|
|
375
|
+
{ name: "obj", description: "The object containing data to pack" },
|
|
376
|
+
{
|
|
377
|
+
name: "fieldSpec",
|
|
378
|
+
description: 'Field definition: "name:start:length". Optional ":left" modifier at the end uses left-padding (right-alignment).'
|
|
379
|
+
}
|
|
380
|
+
],
|
|
381
|
+
returns: "string",
|
|
382
|
+
example: 'pack(target, "id:0:5:left", "name:5:20")'
|
|
383
|
+
}
|
|
352
384
|
}
|
|
353
385
|
];
|
|
354
386
|
var getFunctionNames = () => FUNCTIONS.map((f) => f.name);
|
package/dist/morphql-lang.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"parameters": [
|
|
10
10
|
{
|
|
11
11
|
"name": "format",
|
|
12
|
-
"description": "If used as first keyword: The starting format name (e.g., `json`, `xml`, `csv`, `object`). When used after a section, defines its source."
|
|
12
|
+
"description": "If used as first keyword: The starting format name (e.g., `json`, `xml`, `csv`, `plaintext`, `object`). When used after a section, defines its source."
|
|
13
13
|
}
|
|
14
14
|
],
|
|
15
15
|
"example": "from json to csv"
|
|
@@ -442,6 +442,44 @@
|
|
|
442
442
|
"returns": "array of objects",
|
|
443
443
|
"example": "spreadsheet(csvData) // Converts [[\"name\",\"age\"],[\"John\",30]] to [{name:\"John\",age:30}]"
|
|
444
444
|
}
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
"name": "unpack",
|
|
448
|
+
"doc": {
|
|
449
|
+
"signature": "unpack(str, fieldSpec1, [fieldSpec2, ...])",
|
|
450
|
+
"description": "Extracts multiple fields from a fixed-length string into an object. Specs follow the pattern \"name:start:length[:modifier]\".",
|
|
451
|
+
"parameters": [
|
|
452
|
+
{
|
|
453
|
+
"name": "str",
|
|
454
|
+
"description": "The fixed-length string to unpack"
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
"name": "fieldSpec",
|
|
458
|
+
"description": "Field definition: \"name:start:length\". Optional \":raw\" modifier at the end disables auto-trimming."
|
|
459
|
+
}
|
|
460
|
+
],
|
|
461
|
+
"returns": "object",
|
|
462
|
+
"example": "unpack(source, \"id:0:5\", \"name:5:20\", \"padding:25:5:raw\")"
|
|
463
|
+
}
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
"name": "pack",
|
|
467
|
+
"doc": {
|
|
468
|
+
"signature": "pack(obj, fieldSpec1, [fieldSpec2, ...])",
|
|
469
|
+
"description": "Encodes an object into a fixed-length string using field specifications. Specs follow the pattern \"name:start:length[:modifier]\".",
|
|
470
|
+
"parameters": [
|
|
471
|
+
{
|
|
472
|
+
"name": "obj",
|
|
473
|
+
"description": "The object containing data to pack"
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
"name": "fieldSpec",
|
|
477
|
+
"description": "Field definition: \"name:start:length\". Optional \":left\" modifier at the end uses left-padding (right-alignment)."
|
|
478
|
+
}
|
|
479
|
+
],
|
|
480
|
+
"returns": "string",
|
|
481
|
+
"example": "pack(target, \"id:0:5:left\", \"name:5:20\")"
|
|
482
|
+
}
|
|
445
483
|
}
|
|
446
484
|
],
|
|
447
485
|
"operators": [
|