Skip to content

toLocaleLowerCase

Instance method on String.prototype.

Converts all alphabetic characters to lowercase, taking into account the host environment’s current locale.

toLocaleLowerCase(input: { string: <receiver>; locales?: string | string[]; prompt?: string }): Promise<string>
toLocaleLowerCase(input: { string: <receiver>; locales?: Intl.LocalesArgument; prompt?: string }): Promise<string>

The prompt field is optional. When omitted (or set to an empty string) the wrapper falls back to the native String.prototype.toLocaleLowerCase and returns a resolved Promise without contacting the LLM. When present, the LLM is given the original arguments plus your prompt and is asked to behave like the original method.

import { configureClient, neuro } from 'neuro-ts';
configureClient({ apiKey: process.env.OPENAI_API_KEY });
// Locale-aware lowercase; the Turkish-i case study is the one example everyone uses, and rightly so.
await neuro.string.toLocaleLowerCase({ string: input, locales: 'tr-TR', prompt: 'lowercase using locales rules, where Turkish I and German sharp-s break the assumptions every English-only test suite makes' });

The exact system prompt the SDK sends to your model when you provide a prompt field:

Generated promptString.prototype.toLocaleLowerCase
You are simulating the JavaScript built-in `String.prototype.toLocaleLowerCase`.
## Original signature(s)
  Overload 1: (locales?: string | string[]) => string
  Overload 2: (locales?: Intl.LocalesArgument) => string
## JSDoc
Converts all alphabetic characters to lowercase, taking into account the host environment's current locale.

## How to respond
- Behave EXACTLY as the original `toLocaleLowerCase` would, but use the user's intent to choose any callback / comparator / transform logic that the original would normally accept as an argument.
- Strictly preserve the original return type and shape.
- Output ONLY the JSON-encoded return value of the function call.
- Do NOT include explanations, prose, comments, or markdown fences.
- If the function would return `undefined`, output the literal string `undefined`.
- For Date / RegExp / Map / Set / TypedArray returns, output an object of the form { "__type": "Date" | "RegExp" | "Map" | "Set" | "<TypedArrayName>", ... } so the SDK can rehydrate it.