Sha256: f351eaa598ba2046e3078e5480a7533be7051e4db9212bb40f4eeb84279aa24d

Contents?: true

Size: 506 Bytes

Versions: 61

Compression:

Stored size: 506 Bytes

Contents

/**
Get keys of the given type as strings.

Number keys are converted to strings.

Use-cases:
- Get string keys from a type which may have number keys.
- Makes it possible to index using strings retrieved from template types.

@example
```
import type {StringKeyOf} from 'type-fest';

type Foo = {
	1: number,
	stringKey: string,
};

type StringKeysOfFoo = StringKeyOf<Foo>;
//=> '1' | 'stringKey'
```

@category Object
*/
export type StringKeyOf<BaseType> = `${Extract<keyof BaseType, string | number>}`;

Version data entries

61 entries across 61 versions & 3 rubygems

Version Path
immosquare-cleaner-0.1.60 node_modules/type-fest/source/string-key-of.d.ts
immosquare-cleaner-0.1.59 node_modules/type-fest/source/string-key-of.d.ts
immosquare-cleaner-0.1.58 node_modules/type-fest/source/string-key-of.d.ts
immosquare-cleaner-0.1.57 node_modules/type-fest/source/string-key-of.d.ts
immosquare-cleaner-0.1.56 node_modules/type-fest/source/string-key-of.d.ts
immosquare-cleaner-0.1.55 node_modules/type-fest/source/string-key-of.d.ts
immosquare-cleaner-0.1.54 node_modules/type-fest/source/string-key-of.d.ts
immosquare-cleaner-0.1.53 node_modules/type-fest/source/string-key-of.d.ts
immosquare-cleaner-0.1.52 node_modules/type-fest/source/string-key-of.d.ts
immosquare-cleaner-0.1.51 node_modules/type-fest/source/string-key-of.d.ts
clapton-0.0.26 lib/clapton/javascripts/node_modules/type-fest/source/string-key-of.d.ts
clapton-0.0.25 lib/clapton/javascripts/node_modules/type-fest/source/string-key-of.d.ts
immosquare-cleaner-0.1.50 node_modules/type-fest/source/string-key-of.d.ts
clapton-0.0.24 lib/clapton/javascripts/node_modules/type-fest/source/string-key-of.d.ts
clapton-0.0.23 lib/clapton/javascripts/node_modules/type-fest/source/string-key-of.d.ts
clapton-0.0.22 lib/clapton/javascripts/node_modules/type-fest/source/string-key-of.d.ts
clapton-0.0.21 lib/clapton/javascripts/node_modules/type-fest/source/string-key-of.d.ts
clapton-0.0.20 lib/clapton/javascripts/node_modules/type-fest/source/string-key-of.d.ts
clapton-0.0.19 lib/clapton/javascripts/node_modules/type-fest/source/string-key-of.d.ts
clapton-0.0.18 lib/clapton/javascripts/node_modules/type-fest/source/string-key-of.d.ts