MCPcopy
hub / github.com/sequelize/sequelize / parse

Function parse

lib/dialects/postgres/range.js:58–78  ·  view source on GitHub ↗
(value, parser)

Source from the content-addressed store, hash-verified

56exports.stringify = stringify;
57
58function parse(value, parser) {
59 if (value === null) return null;
60 if (value === 'empty') {
61 return [];
62 }
63
64 let result = value
65 .substring(1, value.length - 1)
66 .split(',', 2);
67
68 if (result.length !== 2) return value;
69
70 result = result.map((item, index) => {
71 return {
72 value: parseRangeBound(item, parser),
73 inclusive: index === 0 ? value[0] === '[' : value[value.length - 1] === ']'
74 };
75 });
76
77 return result;
78}
79exports.parse = parse;

Callers 3

_runMethod · 0.50
_runMethod · 0.50
applyParsersMethod · 0.50

Calls 1

parseRangeBoundFunction · 0.85

Tested by

no test coverage detected