New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

front-tools-kit

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

front-tools-kit

js常用工具函数,可以在多个环境中使用的方法

latest
npmnpm
Version
1.0.6
Version published
Weekly downloads
1
-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

安装方法

npm install front-tools-kit

使用方法

import { camelCase,ensureNotArray,ensureArray,floatAdd } from 'front-tools-kit'

console.log(camelCase('hello-world'))

console.log(ensureNotArray([1,2,3]))

console.log(ensureArray(1))

console.log(ensureArray([1,2,3]))

console.log(ensureArray(null))



const result = floatAdd(0.1, 0.2);

console.log(result);
// 示例1:正确相加两个浮点数,返回5.3
console.log(floatAdd(2.1, 3.2));  // 输出:5.3

// 示例2:相加一个整数和一个浮点数,返回12.02
console.log(floatAdd(10, 2.02));  // 输出:12.02

// 示例3:相加两个浮点数,其中一个有较多小数位,返回0.3333
console.log(floatAdd(0.1111, 0.2222));  // 输出:0.3333

// 示例5:相加两个整数,返回100
console.log(floatAdd(50, 50));  // 输出:100

Keywords

前端开发工具

FAQs

Package last updated on 22 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts