Skip to content

Commit

Permalink
refactor(types)!: JSON* -> Json*
Browse files Browse the repository at this point in the history
Signed-off-by: Lexus Drumgold <[email protected]>
  • Loading branch information
unicornware committed Dec 2, 2022
1 parent 2dd3c8f commit bd3193f
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 32 deletions.
8 changes: 4 additions & 4 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ export type { default as EmptyValue } from './empty-value'
export type { default as FIXME } from './fixme'
export type { default as IndexSignature } from './index-signature'
export type { default as Join } from './join'
export type { default as JSONArray } from './json-array'
export type { default as JSONObject } from './json-object'
export type { default as JSONPrimitive } from './json-primitive'
export type { default as JSONValue } from './json-value'
export type { default as JsonArray } from './json-array'
export type { default as JsonObject } from './json-object'
export type { default as JsonPrimitive } from './json-primitive'
export type { default as JsonValue } from './json-value'
export type { default as Jsonifiable } from './jsonifiable'
export type { default as JsonifiableArray } from './jsonifiable-array'
export type { default as JsonifiableObject } from './jsonifiable-object'
Expand Down
10 changes: 5 additions & 5 deletions src/types/json-array.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/**
* @file Type Definitions - JSONArray
* @module tutils/types/JSONArray
* @file Type Definitions - JsonArray
* @module tutils/types/JsonArray
*/

import type JSONValue from './json-value'
import type JsonValue from './json-value'

/**
* Type representing an array containing [JSON values][1].
*
* [1]: https://restfulapi.net/json-data-types
*/
type JSONArray = JSONValue[]
type JsonArray = JsonValue[]

export { type JSONArray as default }
export type { JsonArray as default }
14 changes: 7 additions & 7 deletions src/types/json-object.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* @file Type Definitions - JSONObject
* @module tutils/types/JSONObject
* @file Type Definitions - JsonObject
* @module tutils/types/JsonObject
*/

import type JSONValue from './json-value'
import type JsonValue from './json-value'

/**
* Type representing a [JSON][1] object.
Expand All @@ -14,11 +14,11 @@ import type JSONValue from './json-value'
* The type should **not**, however, be used as a direct return type as the user
* would have to double-cast it: `object as unknown as CustomResponse`.
*
* Instead, the return type should extend `JSONObject` to ensure the return type
* is JSON-compatible: `interface CustomResponse extends JSONObject { … }`.
* Instead, the return type should extend `JsonObject` to ensure the return type
* is JSON-compatible: `interface CustomResponse extends JsonObject { … }`.
*
* [1]: https://restfulapi.net/json-data-types
*/
type JSONObject = { [K in string]?: JSONValue }
type JsonObject = { [K in string]?: JsonValue }

export type { JSONObject as default }
export type { JsonObject as default }
8 changes: 4 additions & 4 deletions src/types/json-primitive.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @file Type Definitions - JSONPrimitive
* @module tutils/types/JSONPrimitive
* @file Type Definitions - JsonPrimitive
* @module tutils/types/JsonPrimitive
*/

/**
Expand All @@ -9,6 +9,6 @@
* [1]: https://developer.mozilla.org/docs/Glossary/Primitive
* [2]: https://restfulapi.net/json-data-types
*/
type JSONPrimitive = boolean | number | string | null
type JsonPrimitive = boolean | number | string | null

export { type JSONPrimitive as default }
export type { JsonPrimitive as default }
14 changes: 7 additions & 7 deletions src/types/json-value.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/**
* @file Type Definitions - JSONValue
* @module tutils/types/JSONValue
* @file Type Definitions - JsonValue
* @module tutils/types/JsonValue
*/

import type JSONArray from './json-array'
import type JSONObject from './json-object'
import type JSONPrimitive from './json-primitive'
import type JsonArray from './json-array'
import type JsonObject from './json-object'
import type JsonPrimitive from './json-primitive'

/**
* [JSON data types][1].
*
* [1]: https://restfulapi.net/json-data-types
*/
type JSONValue = JSONArray | JSONObject | JSONPrimitive
type JsonValue = JsonArray | JsonObject | JsonPrimitive

export type { JSONValue as default }
export type { JsonValue as default }
4 changes: 2 additions & 2 deletions src/types/jsonifiable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @module tutils/types/Jsonifiable
*/

import type JSONPrimitive from './json-primitive'
import type JsonPrimitive from './json-primitive'
import type JsonifiableArray from './jsonifiable-array'
import type JsonifiableObject from './jsonifiable-object'

Expand All @@ -12,6 +12,6 @@ import type JsonifiableObject from './jsonifiable-object'
*
* Can be used to type values that are expected to pass `JSON.stringify`.
*/
type Jsonifiable = JsonifiableArray | JsonifiableObject | JSONPrimitive
type Jsonifiable = JsonifiableArray | JsonifiableObject | JsonPrimitive

export type { Jsonifiable as default }
6 changes: 3 additions & 3 deletions src/types/primitive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
* @module tutils/types/Primitive
*/

import type JSONPrimitive from './json-primitive'
import type JsonPrimitive from './json-primitive'

/**
* Type representing any [primitive][1] value.
*
* [1]: https://developer.mozilla.org/docs/Glossary/Primitive
*/
type Primitive = JSONPrimitive | bigint | symbol | undefined
type Primitive = JsonPrimitive | bigint | symbol | undefined

export { type Primitive as default }
export type { Primitive as default }

0 comments on commit bd3193f

Please sign in to comment.