first commit

This commit is contained in:
jefferyzhao
2025-07-31 17:44:12 +08:00
commit b9bdc8598b
42390 changed files with 4467935 additions and 0 deletions

22
node_modules/call-me-maybe/LICENSE generated vendored Normal file
View File

@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2015 Eric McCarthy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

26
node_modules/call-me-maybe/README.md generated vendored Normal file
View File

@ -0,0 +1,26 @@
# call-me-maybe [![Continuous Release](https://github.com/limulus/call-me-maybe/actions/workflows/continuous-release.yaml/badge.svg)](https://github.com/limulus/call-me-maybe/actions/workflows/continuous-release.yaml)
Let your JS API users either give you a callback or receive a promise.
## Usage
```javascript
var maybe = require("call-me-maybe")
module.exports = function asyncFunc (cb) {
return maybe(cb, new Promise(function(resolve, reject) {
// ...
}))
}
```
## API
### maybe(cb, promise)
If the callback `cb` is truthy, returns `undefined` and will call `cb` when `promise` is settled. The parameters passed to `cb` are standard error-first:
- If `promise` is fulfilled, then it is called with the result of the promise: `cb(null, result)`
- If `promise` is rejected, then it is called with the rejection error: `cb(err)`
If `cb` is falsey, then `promise` is returned.

45
node_modules/call-me-maybe/package.json generated vendored Normal file
View File

@ -0,0 +1,45 @@
{
"name": "call-me-maybe",
"version": "1.0.2",
"description": "Let your JS API users either give you a callback or receive a promise",
"main": "src/maybe.js",
"files": [
"src"
],
"devDependencies": {
"@commitlint/config-conventional": "^17.1.0",
"browserify": "^17.0.0",
"commitlint": "^17.1.2",
"husky": "^7.0.0",
"is-ci": "^3.0.1",
"karma": "^6.4.1",
"karma-browserify": "^8.1.0",
"karma-browserstack-launcher": "^1.6.0",
"karma-mocha": "^2.0.1",
"mocha": "^2.3.2",
"promise": "^7.0.4",
"semantic-release": "^19.0.5"
},
"scripts": {
"test": "mocha",
"prepare": "is-ci || husky install",
"test-browsers": "karma start"
},
"repository": {
"type": "git",
"url": "git+https://github.com/limulus/call-me-maybe.git"
},
"keywords": [
"promise",
"callback",
"denodeify",
"promisify",
"carlyraejepsen"
],
"author": "Eric McCarthy <eric@limulus.net> (http://www.limulus.net/)",
"license": "MIT",
"bugs": {
"url": "https://github.com/limulus/call-me-maybe/issues"
},
"homepage": "https://github.com/limulus/call-me-maybe#readme"
}

18
node_modules/call-me-maybe/src/maybe.js generated vendored Normal file
View File

@ -0,0 +1,18 @@
"use strict"
var next = require('./next.js')
module.exports = function maybe (cb, promise) {
if (cb) {
promise
.then(function (result) {
next(function () { cb(null, result) })
}, function (err) {
next(function () { cb(err) })
})
return undefined
}
else {
return promise
}
}

15
node_modules/call-me-maybe/src/next.js generated vendored Normal file
View File

@ -0,0 +1,15 @@
'use strict'
function makeNext () {
if (typeof process === 'object' && typeof process.nextTick === 'function') {
return process.nextTick
} else if (typeof setImmediate === 'function') {
return setImmediate
} else {
return function next (f) {
setTimeout(f, 0)
}
}
}
module.exports = makeNext()