-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
658 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
*.lcov | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# TypeScript cache | ||
*.tsbuildinfo | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Microbundle cache | ||
.rpt2_cache/ | ||
.rts2_cache_cjs/ | ||
.rts2_cache_es/ | ||
.rts2_cache_umd/ | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
.env.test | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
|
||
# Next.js build output | ||
.next | ||
|
||
# Nuxt.js build / generate output | ||
.nuxt | ||
dist | ||
|
||
# Gatsby files | ||
.cache/ | ||
# Comment in the public line in if your project uses Gatsby and *not* Next.js | ||
# https://nextjs.org/blog/next-9-1#public-directory-support | ||
# public | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# Serverless directories | ||
.serverless/ | ||
|
||
# FuseBox cache | ||
.fusebox/ | ||
|
||
# DynamoDB Local files | ||
.dynamodb/ | ||
|
||
# TernJS port file | ||
.tern-port |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use strict'; | ||
|
||
function generateUID() { | ||
var timestamp = Date.now().toString(36); // 时间戳转为36进制 | ||
var randomPart = Math.random().toString(36).substring(2, 10); // 随机数转为36进制 | ||
return timestamp + randomPart; | ||
} | ||
|
||
exports.generateUID = generateUID; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { generateUID } from './until'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
function generateUID() { | ||
var timestamp = Date.now().toString(36); // 时间戳转为36进制 | ||
var randomPart = Math.random().toString(36).substring(2, 10); // 随机数转为36进制 | ||
return timestamp + randomPart; | ||
} | ||
|
||
export { generateUID }; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare function generateUID(): string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"name": "jmni", | ||
"version": "0.1.1", | ||
"description": "js until lib", | ||
"main": "lib/index.cjs.js", | ||
"module": "lib/index.esm.js", | ||
"jsnext:main": "lib/index.esm.js", | ||
"browser": "lib/index.umd.js", | ||
"types": "lib/index.d.ts", | ||
"files": [ | ||
"dist", | ||
"lib" | ||
], | ||
"scripts": { | ||
"build": "rollup -c", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/jmni-cn/juntils.git" | ||
}, | ||
"author": "jmni.cn", | ||
"license": "ISC", | ||
"sideEffects": false, | ||
"bugs": { | ||
"url": "https://github.com/jmni-cn/juntils/issues" | ||
}, | ||
"homepage": "https://github.com/jmni-cn/juntils#readme", | ||
"devDependencies": { | ||
"@rollup/plugin-commonjs": "^28.0.1", | ||
"@rollup/plugin-node-resolve": "^15.3.0", | ||
"@rollup/plugin-typescript": "^12.1.1", | ||
"rollup": "^4.27.3", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"tslib": "^2.8.1", | ||
"typescript": "^5.6.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// import resolve from "@rollup/plugin-node-resolve"; | ||
// import typescript from "@rollup/plugin-typescript"; | ||
// import commonjs from "@rollup/plugin-commonjs"; | ||
// import { terser } from "rollup-plugin-terser"; | ||
// import pkg from "./package.json"; | ||
|
||
const resolve = require('@rollup/plugin-node-resolve'); | ||
const typescript = require('@rollup/plugin-typescript'); | ||
const commonjs = require('@rollup/plugin-commonjs'); | ||
const { terser } = require('rollup-plugin-terser') | ||
|
||
module.exports = [ | ||
{ | ||
input: './src/index.ts', | ||
output: [ | ||
{ | ||
dir: 'lib', | ||
format: 'cjs', | ||
entryFileNames: '[name].cjs.js', | ||
sourcemap: false, // 是否输出sourcemap | ||
}, | ||
{ | ||
dir: 'lib', | ||
format: 'esm', | ||
entryFileNames: '[name].esm.js', | ||
sourcemap: false, // 是否输出sourcemap | ||
}, | ||
{ | ||
dir: 'lib', | ||
format: 'umd', | ||
entryFileNames: '[name].umd.js', | ||
name: 'FE_utils', // umd模块名称,相当于一个命名空间,会自动挂载到window下面 | ||
sourcemap: false, | ||
plugins: [terser()], | ||
}, | ||
], | ||
plugins: [resolve(), commonjs(), typescript({ module: "ESNext" })], | ||
} | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { generateUID } from './until'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export function generateUID() { | ||
const timestamp = Date.now().toString(36); // 时间戳转为36进制 | ||
const randomPart = Math.random().toString(36).substring(2, 10); // 随机数转为36进制 | ||
return timestamp + randomPart; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es5" /* 编译目标 */, | ||
"module": "commonjs" /* 项目模块类型 */, | ||
"lib": ["ES2018", "DOM"], | ||
"allowJs": true /* 是否允许js代码 */, | ||
"checkJs": true /* 检查js代码错误 */, | ||
"declaration": true /* 自动创建声明文件(.d.ts) */, | ||
"declarationDir": "./lib" /* 声明文件目录 */, | ||
"sourceMap": true /* 自动生成sourcemap文件 */, | ||
"outDir": "lib" /* 编译输出目录 */, | ||
"rootDir": "./src" /* 项目源码根目录,用来控制编译输出的目录结构 */, | ||
"strict": true /* 启用严格模式 */ | ||
}, | ||
"include": ["src/index.ts"], | ||
"exclude": ["node_modules", "lib"] | ||
} | ||
|
Oops, something went wrong.