MCPcopy Create free account
hub / github.com/arktypeio/arktype / map

Method map

ark/type/variants/object.ts:248–248  ·  view source on GitHub ↗

* #### copy with each property transformed by a function * * ✅ return `[]` to remove a property, or an array to replace it with several * ⚠️ returns a new object built from the properties it extracts, so a root * narrow, filter or metadata on this `Type` is not carried over * ({@link https

(
		// v isn't used directly here but helps TS infer a precise type for transformed
		flatMapEntry: (entry: typePropOf<t, $>) => transformed
	)

Source from the content-addressed store, hash-verified

246 * const Nullable = User.map(prop => ({ key: prop.key, value: prop.value.or("null") }))
247 */
248 map<
249 transformed extends listable<MappedTypeProp>,
250 r = Type<mapped<t, transformed, $>, $>
251 >(

Callers 15

narrowToNamedTestFilesFunction · 0.65
getTsLibFilesFunction · 0.65
analyzeProjectAssertionsFunction · 0.65
getAssertionsInFileFunction · 0.65
analyzeAssertCallFunction · 0.65
getJSDocFromSymbolFunction · 0.65
serializeArgFunction · 0.65
concatenateChainedErrorsFunction · 0.65
runFormatterIfAvailableFunction · 0.65

Calls

no outgoing calls

Tested by 15

summarizeFunction · 0.52
recoloredMethod · 0.52
corpusMethod · 0.52
casesMethod · 0.52
matchesOracleMethod · 0.52
expectedLinesMethod · 0.52
describeFunction · 0.52
loadFactoryFunction · 0.52