the-forest/client/node_modules/.cache/babel-loader/6d3ddc2e207d57571b447289fffa23c60575ad60adb3324e7704a260039562d5.json
2024-09-17 20:35:18 -04:00

1 line
6.8 KiB
JSON

{"ast":null,"code":"\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.readJsonObject = exports.arrayObjectsMap = exports.object = exports.array = exports.boolean = exports.number = exports.stringOpt = exports.string = void 0;\nconst errors_js_1 = require(\"../../errors.js\");\nfunction string(value) {\n if (typeof value === \"string\") {\n return value;\n }\n throw typeError(value, \"string\");\n}\nexports.string = string;\nfunction stringOpt(value) {\n if (value === null || value === undefined) {\n return undefined;\n } else if (typeof value === \"string\") {\n return value;\n }\n throw typeError(value, \"string or null\");\n}\nexports.stringOpt = stringOpt;\nfunction number(value) {\n if (typeof value === \"number\") {\n return value;\n }\n throw typeError(value, \"number\");\n}\nexports.number = number;\nfunction boolean(value) {\n if (typeof value === \"boolean\") {\n return value;\n }\n throw typeError(value, \"boolean\");\n}\nexports.boolean = boolean;\nfunction array(value) {\n if (Array.isArray(value)) {\n return value;\n }\n throw typeError(value, \"array\");\n}\nexports.array = array;\nfunction object(value) {\n if (value !== null && typeof value === \"object\" && !Array.isArray(value)) {\n return value;\n }\n throw typeError(value, \"object\");\n}\nexports.object = object;\nfunction arrayObjectsMap(value, fun) {\n return array(value).map(elemValue => fun(object(elemValue)));\n}\nexports.arrayObjectsMap = arrayObjectsMap;\nfunction typeError(value, expected) {\n if (value === undefined) {\n return new errors_js_1.ProtoError(`Expected ${expected}, but the property was missing`);\n }\n let received = typeof value;\n if (value === null) {\n received = \"null\";\n } else if (Array.isArray(value)) {\n received = \"array\";\n }\n return new errors_js_1.ProtoError(`Expected ${expected}, received ${received}`);\n}\nfunction readJsonObject(value, fun) {\n return fun(object(value));\n}\nexports.readJsonObject = readJsonObject;","map":{"version":3,"names":["Object","defineProperty","exports","value","readJsonObject","arrayObjectsMap","object","array","boolean","number","stringOpt","string","errors_js_1","require","typeError","undefined","Array","isArray","fun","map","elemValue","expected","ProtoError","received"],"sources":["/Users/shoofle/Projects/the-forest/node_modules/@libsql/hrana-client/lib-cjs/encoding/json/decode.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.readJsonObject = exports.arrayObjectsMap = exports.object = exports.array = exports.boolean = exports.number = exports.stringOpt = exports.string = void 0;\nconst errors_js_1 = require(\"../../errors.js\");\nfunction string(value) {\n if (typeof value === \"string\") {\n return value;\n }\n throw typeError(value, \"string\");\n}\nexports.string = string;\nfunction stringOpt(value) {\n if (value === null || value === undefined) {\n return undefined;\n }\n else if (typeof value === \"string\") {\n return value;\n }\n throw typeError(value, \"string or null\");\n}\nexports.stringOpt = stringOpt;\nfunction number(value) {\n if (typeof value === \"number\") {\n return value;\n }\n throw typeError(value, \"number\");\n}\nexports.number = number;\nfunction boolean(value) {\n if (typeof value === \"boolean\") {\n return value;\n }\n throw typeError(value, \"boolean\");\n}\nexports.boolean = boolean;\nfunction array(value) {\n if (Array.isArray(value)) {\n return value;\n }\n throw typeError(value, \"array\");\n}\nexports.array = array;\nfunction object(value) {\n if (value !== null && typeof value === \"object\" && !Array.isArray(value)) {\n return value;\n }\n throw typeError(value, \"object\");\n}\nexports.object = object;\nfunction arrayObjectsMap(value, fun) {\n return array(value).map((elemValue) => fun(object(elemValue)));\n}\nexports.arrayObjectsMap = arrayObjectsMap;\nfunction typeError(value, expected) {\n if (value === undefined) {\n return new errors_js_1.ProtoError(`Expected ${expected}, but the property was missing`);\n }\n let received = typeof value;\n if (value === null) {\n received = \"null\";\n }\n else if (Array.isArray(value)) {\n received = \"array\";\n }\n return new errors_js_1.ProtoError(`Expected ${expected}, received ${received}`);\n}\nfunction readJsonObject(value, fun) {\n return fun(object(value));\n}\nexports.readJsonObject = readJsonObject;\n"],"mappings":"AAAA,YAAY;;AACZA,MAAM,CAACC,cAAc,CAACC,OAAO,EAAE,YAAY,EAAE;EAAEC,KAAK,EAAE;AAAK,CAAC,CA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