MCPcopy Create free account
hub / github.com/Effect-TS/effect / splitSections

Function splitSections

packages/effect/src/unstable/encoding/Ini.ts:30–43  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

28const hasOwn = Object.prototype.hasOwnProperty
29
30const splitSections = (value: string): Array<string> => {
31 const sections: Array<string> = []
32 let start = 0
33 let index = 0
34 while ((index = value.indexOf(".", index)) !== -1) {
35 if (index === 0 || value[index - 1] !== "\\") {
36 sections.push(value.slice(start, index))
37 start = index + 1
38 }
39 index++
40 }
41 sections.push(value.slice(start))
42 return sections
43}
44
45const isQuoted = (value: string): boolean =>
46 value.length >= 2 &&

Callers 1

parseFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected