[{"data":1,"prerenderedAt":1268},["ShallowReactive",2],{"page-\u002Fcore\u002Fguides\u002Fserializing-and-sharing":3,"navigation":887},{"collection":4,"page":5},"docs_en",{"id":6,"title":7,"body":8,"description":879,"extension":880,"meta":881,"navigation":69,"path":882,"rawbody":883,"seo":884,"stem":885,"__hash__":886},"docs_en\u002Fcore\u002F2.guides\u002F2.serializing-and-sharing.md","Serializing and sharing",{"type":9,"value":10,"toc":872},"minimark",[11,19,97,104,170,173,227,231,240,378,391,395,398,444,465,487,491,502,660,667,811,824,838,842,868],[12,13,15],"h2",{"id":14},"serializewell",[16,17,18],"code",{},"serializeWell",[20,21,26],"pre",{"className":22,"code":23,"language":24,"meta":25,"style":25},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { serializeWell } from '@welldot\u002Fcore';\n\nconst text = serializeWell(well); \u002F\u002F a JSON string, ready to save as .well\n","ts","",[16,27,28,64,71],{"__ignoreMap":25},[29,30,33,37,41,45,48,51,54,58,61],"span",{"class":31,"line":32},"line",1,[29,34,36],{"class":35},"s7zQu","import",[29,38,40],{"class":39},"sMK4o"," {",[29,42,44],{"class":43},"sTEyZ"," serializeWell",[29,46,47],{"class":39}," }",[29,49,50],{"class":35}," from",[29,52,53],{"class":39}," '",[29,55,57],{"class":56},"sfazB","@welldot\u002Fcore",[29,59,60],{"class":39},"'",[29,62,63],{"class":39},";\n",[29,65,67],{"class":31,"line":66},2,[29,68,70],{"emptyLinePlaceholder":69},true,"\n",[29,72,74,78,81,84,87,90,93],{"class":31,"line":73},3,[29,75,77],{"class":76},"spNyl","const",[29,79,80],{"class":43}," text ",[29,82,83],{"class":39},"=",[29,85,44],{"class":86},"s2Zo4",[29,88,89],{"class":43},"(well)",[29,91,92],{"class":39},";",[29,94,96],{"class":95},"sHwdD"," \u002F\u002F a JSON string, ready to save as .well\n",[98,99,100,103],"p",{},[16,101,102],{},"serializeWell(well: Well): string"," writes the current format:",[105,106,107,118,134,159],"ul",{},[108,109,110,113,114,117],"li",{},[16,111,112],{},"\"version\": \"2.4\""," (the value of ",[16,115,116],{},"WELL_FORMAT_VERSION","), whatever version the file was read from;",[108,119,120,123,124,127,128,127,131,92],{},[16,121,122],{},"location"," as an object, never the v1 flat ",[16,125,126],{},"lat"," \u002F ",[16,129,130],{},"lng",[16,132,133],{},"elevation",[108,135,136,137,140,141,144,145,150,151,154,155,158],{},"no ",[16,138,139],{},"null"," and no ",[16,142,143],{},"undefined"," optional fields, as the spec requires (",[146,147,149],"a",{"href":148},"\u002Fformat\u002Fspec\u002Fv2\u002Fformat-reference#absent-values-since-v24","absent values","), except inside ",[16,152,153],{},"x-"," members and ",[16,156,157],{},"@context",", which are written as they are;",[108,160,161,162,164,165,169],{},"every root member the spec does not define (",[16,163,153],{}," fields and blocks, foreign members) unchanged, after the spec blocks (",[146,166,168],{"href":167},"\u002Fformat\u002Fspec\u002Fv2\u002Fformat-reference#extensibility","extensibility",").",[98,171,172],{},"The output is compact JSON. To store it indented, re-indent it:",[20,174,176],{"className":22,"code":175,"language":24,"meta":25,"style":25},"const pretty = JSON.stringify(JSON.parse(serializeWell(well)), null, 2);\n",[16,177,178],{"__ignoreMap":25},[29,179,180,182,185,187,190,193,196,199,201,204,207,209,212,215,218,222,225],{"class":31,"line":32},[29,181,77],{"class":76},[29,183,184],{"class":43}," pretty ",[29,186,83],{"class":39},[29,188,189],{"class":43}," JSON",[29,191,192],{"class":39},".",[29,194,195],{"class":86},"stringify",[29,197,198],{"class":43},"(JSON",[29,200,192],{"class":39},[29,202,203],{"class":86},"parse",[29,205,206],{"class":43},"(",[29,208,18],{"class":86},[29,210,211],{"class":43},"(well))",[29,213,214],{"class":39},",",[29,216,217],{"class":39}," null,",[29,219,221],{"class":220},"sbssI"," 2",[29,223,224],{"class":43},")",[29,226,63],{"class":39},[12,228,230],{"id":229},"round-trips-keep-what-you-did-not-touch","Round trips keep what you did not touch",[98,232,233,236,237,239],{},[16,234,235],{},"parseWell"," keeps unknown members at every level, and ",[16,238,18],{}," writes them back. A tool that reads a file, edits a field and saves it therefore preserves extensions it has never heard of:",[20,241,243],{"className":22,"code":242,"language":24,"meta":25,"style":25},"import { parseWell, serializeWell } from '@welldot\u002Fcore';\n\nconst well = parseWell(\n  '{\"version\":2,\"x-acme\":{\"asset\":\"A-7\"},\"bore_hole\":[{\"from\":0,\"to\":60,\"diameter\":254,\"x-acme-bit\":\"PDC\"}],' +\n    '\"well_case\":[],\"reduction\":[],\"well_screen\":[],\"surface_case\":[],\"hole_fill\":[],' +\n    '\"lithology\":[],\"fractures\":[],\"caves\":[]}',\n);\nwell.name = 'PT-07';\nserializeWell(well);\n\u002F\u002F {\"version\":\"2.4\",\"name\":\"PT-07\",\"bore_hole\":[{\"from\":0,\"to\":60,\"diameter\":254,\"x-acme-bit\":\"PDC\"}],\n\u002F\u002F  …,\"x-acme\":{\"asset\":\"A-7\"}}\n",[16,244,245,270,274,288,302,315,328,335,357,366,372],{"__ignoreMap":25},[29,246,247,249,251,254,256,258,260,262,264,266,268],{"class":31,"line":32},[29,248,36],{"class":35},[29,250,40],{"class":39},[29,252,253],{"class":43}," parseWell",[29,255,214],{"class":39},[29,257,44],{"class":43},[29,259,47],{"class":39},[29,261,50],{"class":35},[29,263,53],{"class":39},[29,265,57],{"class":56},[29,267,60],{"class":39},[29,269,63],{"class":39},[29,271,272],{"class":31,"line":66},[29,273,70],{"emptyLinePlaceholder":69},[29,275,276,278,281,283,285],{"class":31,"line":73},[29,277,77],{"class":76},[29,279,280],{"class":43}," well ",[29,282,83],{"class":39},[29,284,253],{"class":86},[29,286,287],{"class":43},"(\n",[29,289,291,294,297,299],{"class":31,"line":290},4,[29,292,293],{"class":39},"  '",[29,295,296],{"class":56},"{\"version\":2,\"x-acme\":{\"asset\":\"A-7\"},\"bore_hole\":[{\"from\":0,\"to\":60,\"diameter\":254,\"x-acme-bit\":\"PDC\"}],",[29,298,60],{"class":39},[29,300,301],{"class":39}," +\n",[29,303,305,308,311,313],{"class":31,"line":304},5,[29,306,307],{"class":39},"    '",[29,309,310],{"class":56},"\"well_case\":[],\"reduction\":[],\"well_screen\":[],\"surface_case\":[],\"hole_fill\":[],",[29,312,60],{"class":39},[29,314,301],{"class":39},[29,316,318,320,323,325],{"class":31,"line":317},6,[29,319,307],{"class":39},[29,321,322],{"class":56},"\"lithology\":[],\"fractures\":[],\"caves\":[]}",[29,324,60],{"class":39},[29,326,327],{"class":39},",\n",[29,329,331,333],{"class":31,"line":330},7,[29,332,224],{"class":43},[29,334,63],{"class":39},[29,336,338,341,343,346,348,350,353,355],{"class":31,"line":337},8,[29,339,340],{"class":43},"well",[29,342,192],{"class":39},[29,344,345],{"class":43},"name ",[29,347,83],{"class":39},[29,349,53],{"class":39},[29,351,352],{"class":56},"PT-07",[29,354,60],{"class":39},[29,356,63],{"class":39},[29,358,360,362,364],{"class":31,"line":359},9,[29,361,18],{"class":86},[29,363,89],{"class":43},[29,365,63],{"class":39},[29,367,369],{"class":31,"line":368},10,[29,370,371],{"class":95},"\u002F\u002F {\"version\":\"2.4\",\"name\":\"PT-07\",\"bore_hole\":[{\"from\":0,\"to\":60,\"diameter\":254,\"x-acme-bit\":\"PDC\"}],\n",[29,373,375],{"class":31,"line":374},11,[29,376,377],{"class":95},"\u002F\u002F  …,\"x-acme\":{\"asset\":\"A-7\"}}\n",[379,380,381],"warning",{},[98,382,383,384,387,388,192],{},"Spreading a well into a new object of only the fields you know (",[16,385,386],{},"{ name, bore_hole, … }",") drops unknown members. Edit the parsed object in place, or copy it whole with ",[16,389,390],{},"structuredClone",[12,392,394],{"id":393},"empty-or-not","Empty or not",[98,396,397],{},"Two helpers answer different questions:",[399,400,401,417],"table",{},[402,403,404],"thead",{},[405,406,407,411],"tr",{},[408,409,410],"th",{},"Helper",[408,412,413,416],{},[16,414,415],{},"true"," when",[418,419,420,431],"tbody",{},[405,421,422,428],{},[423,424,425],"td",{},[16,426,427],{},"isWellEmpty(well)",[423,429,430],{},"There is nothing to draw: every construction and geology array is empty.",[405,432,433,438],{},[423,434,435],{},[16,436,437],{},"hasWellData(well)",[423,439,440,441,443],{},"The well holds any data at all: a profile, identification, location, events, samples, permits or ",[16,442,153],{}," members. Blank strings and zeros do not count.",[98,445,446,447,450,451,453,454,450,457,459,460,462,463,192],{},"A registry record with a location and a permit but no construction has data (",[16,448,449],{},"hasWellData"," is ",[16,452,415],{},") and nothing to draw (",[16,455,456],{},"isWellEmpty",[16,458,415],{},"). Both accept ",[16,461,139],{}," and ",[16,464,143],{},[98,466,467,470,471,474,475,478,479,482,483,169],{},[16,468,469],{},"calculatedWellDepth(well)"," returns the deepest ",[16,472,473],{},"to"," across the construction arrays, ignoring geology, or ",[16,476,477],{},"0",". Use it when ",[16,480,481],{},"well_depth"," is absent and you need the drilled depth (",[146,484,486],{"href":485},"\u002Fformat\u002Fconcepts\u002Fdepths-and-intervals","Depths and intervals",[12,488,490],{"id":489},"redacting-before-sharing","Redacting before sharing",[98,492,493,494,497,498,501],{},"To publish a well without some of its data, such as a private owner's location or permits, use ",[16,495,496],{},"redactWell",". It returns a copy with the hidden parts removed (arrays emptied, optional fields deleted), so the result is still a valid ",[16,499,500],{},".well"," file.",[20,503,505],{"className":22,"code":504,"language":24,"meta":25,"style":25},"import { redactWell, serializeWell } from '@welldot\u002Fcore';\n\n\u002F\u002F Hide a whole section\nconst publicWell = redactWell(well, { operation: false });\n\n\u002F\u002F Or individual fields\nconst anonymous = redactWell(well, {\n  location: false,\n  permits: false,\n  meters: false,\n});\n\nserializeWell(publicWell);\n",[16,506,507,532,536,541,576,580,585,603,614,625,636,645,650],{"__ignoreMap":25},[29,508,509,511,513,516,518,520,522,524,526,528,530],{"class":31,"line":32},[29,510,36],{"class":35},[29,512,40],{"class":39},[29,514,515],{"class":43}," redactWell",[29,517,214],{"class":39},[29,519,44],{"class":43},[29,521,47],{"class":39},[29,523,50],{"class":35},[29,525,53],{"class":39},[29,527,57],{"class":56},[29,529,60],{"class":39},[29,531,63],{"class":39},[29,533,534],{"class":31,"line":66},[29,535,70],{"emptyLinePlaceholder":69},[29,537,538],{"class":31,"line":73},[29,539,540],{"class":95},"\u002F\u002F Hide a whole section\n",[29,542,543,545,548,550,552,555,557,559,563,566,570,572,574],{"class":31,"line":290},[29,544,77],{"class":76},[29,546,547],{"class":43}," publicWell ",[29,549,83],{"class":39},[29,551,515],{"class":86},[29,553,554],{"class":43},"(well",[29,556,214],{"class":39},[29,558,40],{"class":39},[29,560,562],{"class":561},"swJcz"," operation",[29,564,565],{"class":39},":",[29,567,569],{"class":568},"sfNiH"," false",[29,571,47],{"class":39},[29,573,224],{"class":43},[29,575,63],{"class":39},[29,577,578],{"class":31,"line":304},[29,579,70],{"emptyLinePlaceholder":69},[29,581,582],{"class":31,"line":317},[29,583,584],{"class":95},"\u002F\u002F Or individual fields\n",[29,586,587,589,592,594,596,598,600],{"class":31,"line":330},[29,588,77],{"class":76},[29,590,591],{"class":43}," anonymous ",[29,593,83],{"class":39},[29,595,515],{"class":86},[29,597,554],{"class":43},[29,599,214],{"class":39},[29,601,602],{"class":39}," {\n",[29,604,605,608,610,612],{"class":31,"line":337},[29,606,607],{"class":561},"  location",[29,609,565],{"class":39},[29,611,569],{"class":568},[29,613,327],{"class":39},[29,615,616,619,621,623],{"class":31,"line":359},[29,617,618],{"class":561},"  permits",[29,620,565],{"class":39},[29,622,569],{"class":568},[29,624,327],{"class":39},[29,626,627,630,632,634],{"class":31,"line":368},[29,628,629],{"class":561},"  meters",[29,631,565],{"class":39},[29,633,569],{"class":568},[29,635,327],{"class":39},[29,637,638,641,643],{"class":31,"line":374},[29,639,640],{"class":39},"}",[29,642,224],{"class":43},[29,644,63],{"class":39},[29,646,648],{"class":31,"line":647},12,[29,649,70],{"emptyLinePlaceholder":69},[29,651,653,655,658],{"class":31,"line":652},13,[29,654,18],{"class":86},[29,656,657],{"class":43},"(publicWell)",[29,659,63],{"class":39},[98,661,662,663,666],{},"Keys are the seven sections or the fields within them; ",[16,664,665],{},"false"," hides, a missing key stays visible, and hiding a section hides all its fields:",[399,668,669,679],{},[402,670,671],{},[405,672,673,676],{},[408,674,675],{},"Section",[408,677,678],{},"Fields",[418,680,681,702,735,753,768,778,802],{},[405,682,683,688],{},[423,684,685],{},[16,686,687],{},"general",[423,689,690,693,694,693,696,693,699],{},[16,691,692],{},"identification",", ",[16,695,122],{},[16,697,698],{},"obs",[16,700,701],{},"attachments",[405,703,704,709],{},[423,705,706],{},[16,707,708],{},"constructive",[423,710,711,693,714,693,717,693,720,693,723,693,726,693,729,693,732],{},[16,712,713],{},"bore_hole",[16,715,716],{},"surface_case",[16,718,719],{},"well_case",[16,721,722],{},"reduction",[16,724,725],{},"well_screen",[16,727,728],{},"hole_fill",[16,730,731],{},"centralizers",[16,733,734],{},"cement_pad",[405,736,737,742],{},[423,738,739],{},[16,740,741],{},"geology",[423,743,744,693,747,693,750],{},[16,745,746],{},"lithology",[16,748,749],{},"fractures",[16,751,752],{},"caves",[405,754,755,760],{},[423,756,757],{},[16,758,759],{},"hydrodynamic",[423,761,762,693,765],{},[16,763,764],{},"hydrodynamic_events",[16,766,767],{},"aquifer_analysis",[405,769,770,775],{},[423,771,772],{},[16,773,774],{},"history",[423,776,777],{},"(the whole section)",[405,779,780,785],{},[423,781,782],{},[16,783,784],{},"operation",[423,786,787,693,790,693,793,693,796,693,799],{},[16,788,789],{},"pump_installations",[16,791,792],{},"meters",[16,794,795],{},"operating_regime",[16,797,798],{},"production",[16,800,801],{},"permits",[405,803,804,809],{},[423,805,806],{},[16,807,808],{},"water_quality",[423,810,777],{},[98,812,813,814,693,817,462,820,823],{},"The same structure is exported as ",[16,815,816],{},"SECTION_KEYS",[16,818,819],{},"VISIBILITY_TREE",[16,821,822],{},"VISIBILITY_LEAF_KEYS",", for building a visibility form.",[98,825,826,827,831,832,834,835,837],{},"References from visible records to hidden ones are left as they are; they become dangling references, which readers report as warnings (",[146,828,830],{"href":829},"\u002Fformat\u002Fspec\u002Fv2\u002Fformat-reference#dangling-references","dangling references","). Unknown root members (",[16,833,153],{}," blocks) are kept only when nothing is hidden, since ",[16,836,496],{}," cannot know whether they are private.",[12,839,841],{"id":840},"related","Related",[105,843,844,862],{},[108,845,846,693,851,693,856,861],{},[146,847,849],{"href":848},"\u002Fcore\u002Fapi\u002Ffunctions\u002FserializeWell",[16,850,18],{},[146,852,854],{"href":853},"\u002Fcore\u002Fapi\u002Ffunctions\u002FredactWell",[16,855,496],{},[146,857,859],{"href":858},"\u002Fcore\u002Fapi\u002Ffunctions\u002FhasWellData",[16,860,449],{}," in the API reference",[108,863,864],{},[146,865,867],{"href":866},"\u002Fformat\u002Fguides\u002Fbuilding-on-well","Building on .well",[869,870,871],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}",{"title":25,"searchDepth":66,"depth":66,"links":873},[874,875,876,877,878],{"id":14,"depth":66,"text":18},{"id":229,"depth":66,"text":230},{"id":393,"depth":66,"text":394},{"id":489,"depth":66,"text":490},{"id":840,"depth":66,"text":841},"Write a Well back to .well text with serializeWell, keep unknown members, check whether a well holds data, and redact sections before sharing a file.","md",{},"\u002Fcore\u002Fguides\u002Fserializing-and-sharing","---\ntitle: Serializing and sharing\ndescription: Write a Well back to .well text with serializeWell, keep unknown members, check whether a well holds data, and redact sections before sharing a file.\n---\n\n## `serializeWell`\n\n```ts\nimport { serializeWell } from '@welldot\u002Fcore';\n\nconst text = serializeWell(well); \u002F\u002F a JSON string, ready to save as .well\n```\n\n`serializeWell(well: Well): string` writes the current format:\n\n- `\"version\": \"2.4\"` (the value of `WELL_FORMAT_VERSION`), whatever version the file was read from;\n- `location` as an object, never the v1 flat `lat` \u002F `lng` \u002F `elevation`;\n- no `null` and no `undefined` optional fields, as the spec requires ([absent values](\u002Fformat\u002Fspec\u002Fv2\u002Fformat-reference#absent-values-since-v24)), except inside `x-` members and `@context`, which are written as they are;\n- every root member the spec does not define (`x-` fields and blocks, foreign members) unchanged, after the spec blocks ([extensibility](\u002Fformat\u002Fspec\u002Fv2\u002Fformat-reference#extensibility)).\n\nThe output is compact JSON. To store it indented, re-indent it:\n\n```ts\nconst pretty = JSON.stringify(JSON.parse(serializeWell(well)), null, 2);\n```\n\n## Round trips keep what you did not touch\n\n`parseWell` keeps unknown members at every level, and `serializeWell` writes them back. A tool that reads a file, edits a field and saves it therefore preserves extensions it has never heard of:\n\n```ts\nimport { parseWell, serializeWell } from '@welldot\u002Fcore';\n\nconst well = parseWell(\n  '{\"version\":2,\"x-acme\":{\"asset\":\"A-7\"},\"bore_hole\":[{\"from\":0,\"to\":60,\"diameter\":254,\"x-acme-bit\":\"PDC\"}],' +\n    '\"well_case\":[],\"reduction\":[],\"well_screen\":[],\"surface_case\":[],\"hole_fill\":[],' +\n    '\"lithology\":[],\"fractures\":[],\"caves\":[]}',\n);\nwell.name = 'PT-07';\nserializeWell(well);\n\u002F\u002F {\"version\":\"2.4\",\"name\":\"PT-07\",\"bore_hole\":[{\"from\":0,\"to\":60,\"diameter\":254,\"x-acme-bit\":\"PDC\"}],\n\u002F\u002F  …,\"x-acme\":{\"asset\":\"A-7\"}}\n```\n\n::warning\nSpreading a well into a new object of only the fields you know (`{ name, bore_hole, … }`) drops unknown members. Edit the parsed object in place, or copy it whole with `structuredClone`.\n::\n\n## Empty or not\n\nTwo helpers answer different questions:\n\n| Helper              | `true` when                                                                                                                                          |\n| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `isWellEmpty(well)` | There is nothing to draw: every construction and geology array is empty.                                                                             |\n| `hasWellData(well)` | The well holds any data at all: a profile, identification, location, events, samples, permits or `x-` members. Blank strings and zeros do not count. |\n\nA registry record with a location and a permit but no construction has data (`hasWellData` is `true`) and nothing to draw (`isWellEmpty` is `true`). Both accept `null` and `undefined`.\n\n`calculatedWellDepth(well)` returns the deepest `to` across the construction arrays, ignoring geology, or `0`. Use it when `well_depth` is absent and you need the drilled depth ([Depths and intervals](\u002Fformat\u002Fconcepts\u002Fdepths-and-intervals)).\n\n## Redacting before sharing\n\nTo publish a well without some of its data, such as a private owner's location or permits, use `redactWell`. It returns a copy with the hidden parts removed (arrays emptied, optional fields deleted), so the result is still a valid `.well` file.\n\n```ts\nimport { redactWell, serializeWell } from '@welldot\u002Fcore';\n\n\u002F\u002F Hide a whole section\nconst publicWell = redactWell(well, { operation: false });\n\n\u002F\u002F Or individual fields\nconst anonymous = redactWell(well, {\n  location: false,\n  permits: false,\n  meters: false,\n});\n\nserializeWell(publicWell);\n```\n\nKeys are the seven sections or the fields within them; `false` hides, a missing key stays visible, and hiding a section hides all its fields:\n\n| Section         | Fields                                                                                                          |\n| --------------- | --------------------------------------------------------------------------------------------------------------- |\n| `general`       | `identification`, `location`, `obs`, `attachments`                                                              |\n| `constructive`  | `bore_hole`, `surface_case`, `well_case`, `reduction`, `well_screen`, `hole_fill`, `centralizers`, `cement_pad` |\n| `geology`       | `lithology`, `fractures`, `caves`                                                                               |\n| `hydrodynamic`  | `hydrodynamic_events`, `aquifer_analysis`                                                                       |\n| `history`       | (the whole section)                                                                                             |\n| `operation`     | `pump_installations`, `meters`, `operating_regime`, `production`, `permits`                                     |\n| `water_quality` | (the whole section)                                                                                             |\n\nThe same structure is exported as `SECTION_KEYS`, `VISIBILITY_TREE` and `VISIBILITY_LEAF_KEYS`, for building a visibility form.\n\nReferences from visible records to hidden ones are left as they are; they become dangling references, which readers report as warnings ([dangling references](\u002Fformat\u002Fspec\u002Fv2\u002Fformat-reference#dangling-references)). Unknown root members (`x-` blocks) are kept only when nothing is hidden, since `redactWell` cannot know whether they are private.\n\n## Related\n\n- [`serializeWell`](\u002Fcore\u002Fapi\u002Ffunctions\u002FserializeWell), [`redactWell`](\u002Fcore\u002Fapi\u002Ffunctions\u002FredactWell), [`hasWellData`](\u002Fcore\u002Fapi\u002Ffunctions\u002FhasWellData) in the API reference\n- [Building on .well](\u002Fformat\u002Fguides\u002Fbuilding-on-well)\n",{"title":7,"description":879},"core\u002F2.guides\u002F2.serializing-and-sharing","82R7zMRkgpuEq_FksHRRztIF5EDJuIg9f3fU61tuEgo",{"docs_en":888,"spec":1200,"changelogs":1250},[889,909,928,981,1088,1142],{"title":890,"path":891,"stem":892,"children":893},"Ai","\u002Fai","ai",[894,897,901,905],{"title":895,"path":891,"stem":896},"Introduction","ai\u002Findex",{"title":898,"path":899,"stem":900},"Converting reports with an assistant","\u002Fai\u002Fconversion-skill","ai\u002Fconversion-skill",{"title":902,"path":903,"stem":904},"llms.txt and Markdown pages","\u002Fai\u002Fllms","ai\u002Fllms",{"title":906,"path":907,"stem":908},"MCP server","\u002Fai\u002Fmcp","ai\u002Fmcp",{"title":910,"path":911,"stem":912,"children":913},"Contributing","\u002Fcontributing","contributing",[914,916,920,924],{"title":895,"path":911,"stem":915},"contributing\u002Findex",{"title":917,"path":918,"stem":919},"Writing docs","\u002Fcontributing\u002Fwriting-docs","contributing\u002F1.writing-docs",{"title":921,"path":922,"stem":923},"Update rules","\u002Fcontributing\u002Fupdate-rules","contributing\u002F2.update-rules",{"title":925,"path":926,"stem":927},"Content components","\u002Fcontributing\u002Fcomponents","contributing\u002Fcomponents",{"title":929,"path":930,"stem":931,"children":932},"Core","\u002Fcore","core",[933,935,949,975],{"title":895,"path":930,"stem":934},"core\u002Findex",{"title":936,"path":937,"stem":938,"children":939,"page":948},"Getting Started","\u002Fcore\u002Fgetting-started","core\u002F1.getting-started",[940,944],{"title":941,"path":942,"stem":943},"Installation","\u002Fcore\u002Fgetting-started\u002Finstallation","core\u002F1.getting-started\u002F1.installation",{"title":945,"path":946,"stem":947},"First use","\u002Fcore\u002Fgetting-started\u002Ffirst-use","core\u002F1.getting-started\u002F2.first-use",false,{"title":950,"path":951,"stem":952,"children":953,"page":948},"Guides","\u002Fcore\u002Fguides","core\u002F2.guides",[954,958,959,963,967,971],{"title":955,"path":956,"stem":957},"Parsing and validating","\u002Fcore\u002Fguides\u002Fparsing-and-validating","core\u002F2.guides\u002F1.parsing-and-validating",{"title":7,"path":882,"stem":885},{"title":960,"path":961,"stem":962},"Unit conversion","\u002Fcore\u002Fguides\u002Funit-conversion","core\u002F2.guides\u002F3.unit-conversion",{"title":964,"path":965,"stem":966},"Vocabularies and textures","\u002Fcore\u002Fguides\u002Fvocabularies-and-textures","core\u002F2.guides\u002F4.vocabularies-and-textures",{"title":968,"path":969,"stem":970},"Water quality vocabulary","\u002Fcore\u002Fguides\u002Fwater-quality-vocabulary","core\u002F2.guides\u002F5.water-quality-vocabulary",{"title":972,"path":973,"stem":974},"Versions and time zones","\u002Fcore\u002Fguides\u002Fversions-and-time-zones","core\u002F2.guides\u002F6.versions-and-time-zones",{"title":976,"path":977,"stem":978,"children":979},"API reference","\u002Fcore\u002Fapi","core\u002Fapi\u002Findex",[980],{"title":976,"path":977,"stem":978},{"title":982,"path":983,"stem":984,"children":985},"Format","\u002Fformat","format",[986,988,1008,1035,1058,1078,1084],{"title":895,"path":983,"stem":987},"format\u002Findex",{"title":936,"path":989,"stem":990,"children":991,"page":948},"\u002Fformat\u002Fgetting-started","format\u002F1.getting-started",[992,996,1000,1004],{"title":993,"path":994,"stem":995},"What is .well?","\u002Fformat\u002Fgetting-started\u002Fwhat-is-well","format\u002F1.getting-started\u002F1.what-is-well",{"title":997,"path":998,"stem":999},"For geologists","\u002Fformat\u002Fgetting-started\u002Ffor-geologists","format\u002F1.getting-started\u002F2.for-geologists",{"title":1001,"path":1002,"stem":1003},"For developers","\u002Fformat\u002Fgetting-started\u002Ffor-developers","format\u002F1.getting-started\u002F3.for-developers",{"title":1005,"path":1006,"stem":1007},"Your first .well file","\u002Fformat\u002Fgetting-started\u002Ffirst-well-file","format\u002F1.getting-started\u002F4.first-well-file",{"title":1009,"path":1010,"stem":1011,"children":1012,"page":948},"Concepts","\u002Fformat\u002Fconcepts","format\u002F2.concepts",[1013,1015,1019,1023,1027,1031],{"title":486,"path":485,"stem":1014},"format\u002F2.concepts\u002F1.depths-and-intervals",{"title":1016,"path":1017,"stem":1018},"Units and precision","\u002Fformat\u002Fconcepts\u002Funits-and-precision","format\u002F2.concepts\u002F2.units-and-precision",{"title":1020,"path":1021,"stem":1022},"Vocabularies","\u002Fformat\u002Fconcepts\u002Fvocabularies","format\u002F2.concepts\u002F3.vocabularies",{"title":1024,"path":1025,"stem":1026},"Profiles","\u002Fformat\u002Fconcepts\u002Fprofiles","format\u002F2.concepts\u002F4.profiles",{"title":1028,"path":1029,"stem":1030},"Versions and deprecation","\u002Fformat\u002Fconcepts\u002Fversions-and-deprecation","format\u002F2.concepts\u002F5.versions-and-deprecation",{"title":1032,"path":1033,"stem":1034},"Extensibility","\u002Fformat\u002Fconcepts\u002Fextensibility","format\u002F2.concepts\u002F6.extensibility",{"title":950,"path":1036,"stem":1037,"children":1038,"page":948},"\u002Fformat\u002Fguides","format\u002F3.guides",[1039,1043,1047,1051,1055],{"title":1040,"path":1041,"stem":1042},"Writing a .well by hand","\u002Fformat\u002Fguides\u002Fwriting-by-hand","format\u002F3.guides\u002F1.writing-by-hand",{"title":1044,"path":1045,"stem":1046},"Converting a report","\u002Fformat\u002Fguides\u002Fconverting-a-report","format\u002F3.guides\u002F2.converting-a-report",{"title":1048,"path":1049,"stem":1050},"Validating","\u002Fformat\u002Fguides\u002Fvalidating","format\u002F3.guides\u002F3.validating",{"title":1052,"path":1053,"stem":1054},"Extending for your own needs","\u002Fformat\u002Fguides\u002Fextending","format\u002F3.guides\u002F4.extending",{"title":1056,"path":866,"stem":1057},"Building an editor or database on .well","format\u002F3.guides\u002F5.building-on-well",{"title":1059,"path":1060,"stem":1061,"children":1062},"Overview","\u002Fformat\u002Freference","format\u002F4.reference\u002Findex",[1063,1064,1068,1072],{"title":1059,"path":1060,"stem":1061},{"title":1065,"path":1066,"stem":1067},"JSON Schema","\u002Fformat\u002Freference\u002Fjson-schema","format\u002F4.reference\u002F1.json-schema",{"title":1069,"path":1070,"stem":1071},"Example wells","\u002Fformat\u002Freference\u002Fexamples","format\u002F4.reference\u002F2.examples",{"title":1073,"path":1074,"stem":1075,"children":1076},"Object reference","\u002Fformat\u002Freference\u002Fobjects","format\u002Freference\u002Fobjects\u002Findex",[1077],{"title":1073,"path":1074,"stem":1075},{"title":1079,"path":1080,"stem":1081,"children":1082},"About the spec","\u002Fformat\u002Fspec","format\u002F5.spec\u002Findex",[1083],{"title":1079,"path":1080,"stem":1081},{"title":1085,"path":1086,"stem":1087},"Changelog","\u002Fformat\u002Fchangelog","format\u002F6.changelog",{"title":1089,"path":1090,"stem":1091,"children":1092},"Render","\u002Frender","render",[1093,1095,1105,1137],{"title":895,"path":1090,"stem":1094},"render\u002Findex",{"title":936,"path":1096,"stem":1097,"children":1098,"page":948},"\u002Frender\u002Fgetting-started","render\u002F1.getting-started",[1099,1102],{"title":941,"path":1100,"stem":1101},"\u002Frender\u002Fgetting-started\u002Finstallation","render\u002F1.getting-started\u002F1.installation",{"title":945,"path":1103,"stem":1104},"\u002Frender\u002Fgetting-started\u002Ffirst-use","render\u002F1.getting-started\u002F2.first-use",{"title":950,"path":1106,"stem":1107,"children":1108,"page":948},"\u002Frender\u002Fguides","render\u002F2.guides",[1109,1113,1117,1121,1125,1129,1133],{"title":1110,"path":1111,"stem":1112},"Panels and layout","\u002Frender\u002Fguides\u002Fpanels-and-layout","render\u002F2.guides\u002F1.panels-and-layout",{"title":1114,"path":1115,"stem":1116},"Layers and labels","\u002Frender\u002Fguides\u002Flayers-and-labels","render\u002F2.guides\u002F2.layers-and-labels",{"title":1118,"path":1119,"stem":1120},"Theming","\u002Frender\u002Fguides\u002Ftheming","render\u002F2.guides\u002F3.theming",{"title":1122,"path":1123,"stem":1124},"Locale and units","\u002Frender\u002Fguides\u002Flocale-and-units","render\u002F2.guides\u002F4.locale-and-units",{"title":1126,"path":1127,"stem":1128},"Legends","\u002Frender\u002Fguides\u002Flegends","render\u002F2.guides\u002F5.legends",{"title":1130,"path":1131,"stem":1132},"Zoom, pan and highlights","\u002Frender\u002Fguides\u002Finteraction","render\u002F2.guides\u002F6.interaction",{"title":1134,"path":1135,"stem":1136},"Using it in a framework","\u002Frender\u002Fguides\u002Fframeworks","render\u002F2.guides\u002F7.frameworks",{"title":976,"path":1138,"stem":1139,"children":1140},"\u002Frender\u002Fapi","render\u002Fapi\u002Findex",[1141],{"title":976,"path":1138,"stem":1139},{"title":1143,"path":1144,"stem":1145,"children":1146},"Utils","\u002Futils","utils",[1147,1149,1159,1195],{"title":895,"path":1144,"stem":1148},"utils\u002Findex",{"title":936,"path":1150,"stem":1151,"children":1152,"page":948},"\u002Futils\u002Fgetting-started","utils\u002F1.getting-started",[1153,1156],{"title":941,"path":1154,"stem":1155},"\u002Futils\u002Fgetting-started\u002Finstallation","utils\u002F1.getting-started\u002F1.installation",{"title":945,"path":1157,"stem":1158},"\u002Futils\u002Fgetting-started\u002Ffirst-use","utils\u002F1.getting-started\u002F2.first-use",{"title":950,"path":1160,"stem":1161,"children":1162,"page":948},"\u002Futils\u002Fguides","utils\u002F2.guides",[1163,1167,1171,1175,1179,1183,1187,1191],{"title":1164,"path":1165,"stem":1166},"Geometry and volumes","\u002Futils\u002Fguides\u002Fgeometry-and-volumes","utils\u002F2.guides\u002F1.geometry-and-volumes",{"title":1168,"path":1169,"stem":1170},"Water levels and pumping tests","\u002Futils\u002Fguides\u002Fpumping-tests","utils\u002F2.guides\u002F2.pumping-tests",{"title":1172,"path":1173,"stem":1174},"Permits","\u002Futils\u002Fguides\u002Fpermits","utils\u002F2.guides\u002F3.permits",{"title":1176,"path":1177,"stem":1178},"Operation and production","\u002Futils\u002Fguides\u002Foperation","utils\u002F2.guides\u002F4.operation",{"title":1180,"path":1181,"stem":1182},"Water quality","\u002Futils\u002Fguides\u002Fwater-quality","utils\u002F2.guides\u002F5.water-quality",{"title":1184,"path":1185,"stem":1186},"Logger import","\u002Futils\u002Fguides\u002Flogger-import","utils\u002F2.guides\u002F6.logger-import",{"title":1188,"path":1189,"stem":1190},"SIAGAS import","\u002Futils\u002Fguides\u002Fsiagas-import","utils\u002F2.guides\u002F7.siagas-import",{"title":1192,"path":1193,"stem":1194},"Formatting","\u002Futils\u002Fguides\u002Fformatting","utils\u002F2.guides\u002F8.formatting",{"title":976,"path":1196,"stem":1197,"children":1198},"\u002Futils\u002Fapi","utils\u002Fapi\u002Findex",[1199],{"title":976,"path":1196,"stem":1197},[1201],{"title":982,"path":983,"stem":984,"children":1202,"page":948},[1203],{"title":1204,"path":1080,"stem":1205,"children":1206,"page":948},"Spec","format\u002Fspec",[1207,1216,1225],{"title":1208,"path":1209,"stem":1210,"children":1211,"page":948},"Reference","\u002Fformat\u002Fspec\u002Freference","format\u002Fspec\u002Freference",[1212],{"title":1213,"path":1214,"stem":1215},"FGDC Texture Patterns Reference","\u002Fformat\u002Fspec\u002Freference\u002Ffgdc-textures","format\u002Fspec\u002Freference\u002Ffgdc-textures",{"title":1217,"path":1218,"stem":1219,"children":1220,"page":948},"V1","\u002Fformat\u002Fspec\u002Fv1","format\u002Fspec\u002Fv1",[1221],{"title":1222,"path":1223,"stem":1224},".well File Format Specification","\u002Fformat\u002Fspec\u002Fv1\u002Fwell-format","format\u002Fspec\u002Fv1\u002Fwell-format",{"title":1226,"path":1227,"stem":1228,"children":1229,"page":948},"V2","\u002Fformat\u002Fspec\u002Fv2","format\u002Fspec\u002Fv2",[1230,1234,1238,1242,1246],{"title":1231,"path":1232,"stem":1233},".well File Format Specification — Version 2.4: Format Reference","\u002Fformat\u002Fspec\u002Fv2\u002Fformat-reference","format\u002Fspec\u002Fv2\u002Fformat-reference",{"title":1235,"path":1236,"stem":1237},".well File Format Specification — Version 2.4: Interoperability","\u002Fformat\u002Fspec\u002Fv2\u002Finteroperability","format\u002Fspec\u002Fv2\u002Finteroperability",{"title":1239,"path":1240,"stem":1241},".well File Format Specification — Version 2.4: Object Schemas","\u002Fformat\u002Fspec\u002Fv2\u002Fobject-schemas","format\u002Fspec\u002Fv2\u002Fobject-schemas",{"title":1243,"path":1244,"stem":1245},".well File Format Specification — Version 2.4: Overview","\u002Fformat\u002Fspec\u002Fv2\u002Foverview","format\u002Fspec\u002Fv2\u002Foverview",{"title":1247,"path":1248,"stem":1249},".well File Format Specification — Version 2.4: Water Quality","\u002Fformat\u002Fspec\u002Fv2\u002Fwater-quality","format\u002Fspec\u002Fv2\u002Fwater-quality",[1251,1256,1262],{"title":929,"path":930,"stem":931,"children":1252,"page":948},[1253],{"title":57,"path":1254,"stem":1255},"\u002Fcore\u002Fchangelog","core\u002FCHANGELOG",{"title":1089,"path":1090,"stem":1091,"children":1257,"page":948},[1258],{"title":1259,"path":1260,"stem":1261},"@welldot\u002Frender","\u002Frender\u002Fchangelog","render\u002FCHANGELOG",{"title":1143,"path":1144,"stem":1145,"children":1263,"page":948},[1264],{"title":1265,"path":1266,"stem":1267},"@welldot\u002Futils","\u002Futils\u002Fchangelog","utils\u002FCHANGELOG",1793050497044]