===== ISTEM =====
Solve the following programming task.

TASK: Custom JSON.stringify

Write a function 'jsonStringify(value)' that converts objects, arrays, strings, numbers and booleans into JSON text without using the native JSON.stringify.

STARTER CODE (javascript):
function jsonStringify(value) {
  // Write your code here
}

module.exports = { jsonStringify };


RULES:
- Keep the function name and signature EXACTLY as given.
- Return working code only. No explanations.
- Put the code in a single ``` block.
- Try to solve it first. If you genuinely cannot, write only this single
  line instead of producing faulty code: CANNOT_SOLVE

===== HAM YANIT =====
```javascript
function jsonStringify(value) {
  if (typeof value === 'string') {
    return `"${value.replace(/"/g, '\\"')}"`
  } else if (value === null) {
    return 'null'
  } else if (typeof value === 'number' || typeof value === 'boolean') {
    return String(value)
  } else if (Array.isArray(value)) {
    return `[${value.map(item => jsonStringify(item)).join(',')}]`
  } else if (typeof value === 'object') {
    const keys = Object.keys(value)
    const keyValuePairs = keys.map(key => `"${key}":${jsonStringify(value[key])}`)
    return `{${keyValuePairs.join(',')}}`
  } else {
    return 'CANNOT_SOLVE'
  }
}

module.exports = { jsonStringify };
```