/**
 * Minified by jsDelivr using Terser v5.19.2.
 * Original file: /npm/section-matter@1.0.0/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";var typeOf=require("kind-of"),extend=require("extend-shallow");function isDelimiter(t,e){return t.slice(0,e.length)===e&&t.charAt(e.length+1)!==e.slice(-1)}function toObject(t){if("object"!==typeOf(t)&&(t={content:t}),"string"!=typeof t.content&&!isBuffer(t.content))throw new TypeError("expected a buffer or string");return t.content=t.content.toString(),t.sections=[],t}function getKey(t,e){return t?t.slice(e.length).trim():""}function createSection(){return{key:"",data:"",content:""}}function identity(t){return t}function isBuffer(t){return!(!t||!t.constructor||"function"!=typeof t.constructor.isBuffer)&&t.constructor.isBuffer(t)}module.exports=function(t,e){"function"==typeof e&&(e={parse:e});var n=toObject(t),i=extend({},{section_delimiter:"---",parse:identity},e),r=i.section_delimiter,o=n.content.split(/\r?\n/),c=null,u=createSection(),s=[],f=[];function l(t){n.content=t,c=[],s=[]}function a(t){f.length&&(u.key=getKey(f[0],r),u.content=t,i.parse(u,c),c.push(u),u=createSection(),s=[],f=[])}for(var p=0;p<o.length;p++){var h=o[p],d=f.length,g=h.trim();if(isDelimiter(g,r)){if(3===g.length&&0!==p){if(0===d||2===d){s.push(h);continue}f.push(g),u.data=s.join("\n"),s=[];continue}null===c&&l(s.join("\n")),2===d&&a(s.join("\n")),f.push(g)}else s.push(h)}return null===c?l(s.join("\n")):a(s.join("\n")),n.sections=c,n};
//# sourceMappingURL=/sm/5bba53b4fe62ab5904ab35002cbab29f4f27f35d71c732591fb36449358754bf.map