Skip to content

Instantly share code, notes, and snippets.

@curly210102
curly210102 / Number.js
Created May 19, 2021 06:54
JavaScript Operations
// 判断两数正负号相反
function oppositeSign(x, y) {
return x ^ y < 0
}
@curly210102
curly210102 / .editorconfig
Last active December 21, 2024 03:15
code-canonicalization
# https://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
const path = require("path");
const glob = require("glob");
const types = require("conventional-commit-types").types;
const longest = Math.max(...Object.keys(types).map((type) => [...type].length));
function getPackages(ctx) {
const cwd = ctx ? ctx.cwd : process.cwd();
const packageJson = require(path.join(cwd, "package.json"));
if (packageJson && Array.isArray(packageJson.workspaces)) {