# nuke-helper

> 辅助函数

Latest version **2.3.12** (published 2019-09-26) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install nuke-helper
pnpm add nuke-helper
yarn add nuke-helper
bun add nuke-helper
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.3.12 |
| Published | 2019-09-26 |
| First published | 2017-12-15 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 32.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | leanhunter |
| Maintainers | doub, leanhunter |
| Keywords | nuke, nuke-helper |

## Links

- npm: https://www.npmjs.com/package/nuke-helper
- Repository: git@gitlab.alibaba-inc.com:nuke/helper
- npm.io page: https://npm.io/package/nuke-helper

## Dependencies (1)

- [nuke-env](https://npm.io/package/nuke-env.md) ^2.3.12

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 2.3.12 (latest) — 2019-09-26
- 2.1.3 (beta) — 2018-08-15
- 2.3.11 — 2019-09-26
- 2.3.10 — 2019-09-26
- 2.3.9 — 2019-09-26
- 2.3.8 — 2019-09-25
- 2.3.7 — 2019-07-24
- 2.3.6 — 2019-07-19
- 2.3.5 — 2019-07-02
- 2.3.4 — 2019-05-10
- 2.3.3 — 2019-04-28
- 2.3.2 — 2019-01-15
- 2.3.1 — 2019-01-15
- 2.3.0 — 2018-11-14
- 0.0.11 — 2018-10-29
- … 43 more at https://npm.io/package/nuke-helper/versions

## README

# Helper

- category: Components
- chinese: 辅助函数
- type: 基本

---

## API

### calcTextSize

解析固定字号，`<Text style={{fontSize: 28}}>123</Text>` 希望字号被解析为：

```
web: 14px;
native iOS: 14 dp;
native android: 14 pt; 
```

```
const { calcTextSize } = Helper;
let style = {fontSize: 28};
calcTextSize(style);
```

### hairLine for web

```
const { hairLine } = Helper;
hairLine.detect() // 是否支持 hairline，返回 true 或 false
hairLine.fixBorder({ borderWidth: 1 }) // ==> {"borderWidth":"0.5px"}
```

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