# kintone-typeguard

> Typeguard for kintone JavaScript Client.

Latest version **0.18.3** (published 2026-03-12) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install kintone-typeguard
pnpm add kintone-typeguard
yarn add kintone-typeguard
bun add kintone-typeguard
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.18.3 |
| Published | 2026-03-12 |
| First published | 2023-11-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 73.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 0 |
| Author | cy-takeuchi |
| Maintainers | cy.takeuchi |
| Keywords | kintone |

## Links

- npm: https://www.npmjs.com/package/kintone-typeguard
- Repository: https://github.com/cy-takeuchi/kintone-typeguard
- Issues: https://github.com/cy-takeuchi/kintone-typeguard/issues
- npm.io page: https://npm.io/package/kintone-typeguard

## Dependencies (2)

- [dotenv](https://npm.io/package/dotenv.md) ^17.3.1
- [@kintone/rest-api-client](https://npm.io/package/@kintone/rest-api-client.md) ^6.1.2

## Recent versions

- 0.18.3 (latest) — 2026-03-12
- 0.17.2 — 2025-11-18
- 0.17.1 — 2025-08-03
- 0.17.0 — 2025-08-03
- 0.16.0 — 2025-05-24
- 0.15.2 — 2024-07-09
- 0.15.1 — 2024-07-09
- 0.15.0 — 2024-07-09
- 0.14.0 — 2024-06-24
- 0.13.0 — 2024-06-22
- 0.12.1 — 2024-06-16
- 0.12.0 — 2024-06-16
- 0.11.0 — 2024-06-12
- 0.10.5 — 2024-06-12
- 0.10.4 — 2024-05-17
- … 16 more at https://npm.io/package/kintone-typeguard/versions

## README

# kintone-typeguard

[![npm version](https://badge.fury.io/js/kintone-typeguard.svg)](https://badge.fury.io/js/kintone-typeguard)

Typeguard for [@kintone/rest-api-client](https://www.npmjs.com/package/@kintone/rest-api-client) fields.

- [Installation](#installation)
- [Usage](#usage)
- [License](#license)

## Installation

### 1. Install with `npm`

This library is distributed on `npm`.

```shell
npm install kintone-typeguard
```

You can then use `import` to import the library.

```ts
// ES modules
import { guardFormField, guardFormLayout, guardRecord } from "kintone-typeguard";
```

## Usage

Here is a sample code that retrieves form fields of an app.

```ts
import { KintoneRestAPIClient } from "@kintone/rest-api-client";
import { guardFormField } from "kintone-typeguard";

const client = new KintoneRestAPIClient();
const { properties } = await client.app.getFormFields({ app: 1 });
if (guardFormField.isSingleLineText(properties.xxx)) {
  properties.xxx.unique; // unique property exists
}
if (guardFormField.isLookup(properties.xxx)) {
  properties.xxx.lookup; // lookup property exists
}
```

Here is a sample code that retrieves form layout of an app.

```ts
import { KintoneRestAPIClient } from "@kintone/rest-api-client";
import { guardFormLayout } from "kintone-typeguard";

const client = new KintoneRestAPIClient();
const { layout } = await client.app.getFormLayout({ app: 1 });
if (guardFormLayout.isRow(layout[0])) {
  layout[0].fields; // fields property exists
}
if (guardFormLayout.isSubtable(layout[0])) {
  layout[0].code; // code property exists
}
```

Here is a sample code that retrieves records of an app.

```ts
import { KintoneRestAPIClient } from "@kintone/rest-api-client";
import { guardRecord } from "kintone-typeguard";

const client = new KintoneRestAPIClient();
const { record } = await client.record.getRecord({ app: 1, id: 1 });
if (guardRecord.isSingleLineText(record.xxx)) {
  record.xxx.value; // string
}
if (guardRecord.isCheckBox(record.xxx)) {
  record.xxx.value; // string[]
}
```

## License

- [MIT](https://github.com/cy-takeuchi/kintone-typeguard/blob/main/LICENSE)

---
_Source: https://npm.io/package/kintone-typeguard · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
