{"name":"is-actual-promise","version":"1.0.1","description":"Verify if something is a Promise","main":"./dist/commonjs/index.js","exports":{"./package.json":"./package.json",".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}}},"scripts":{"preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","prepare":"tshy","pretest":"npm run prepare","presnap":"npm run prepare","test":"tap","snap":"tap","format":"prettier --write . --loglevel warn --ignore-path ../../.prettierignore --cache","typedoc":"typedoc"},"keywords":["is promise","is","type","check","isPromise"],"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://izs.me"},"license":"BlueOak-1.0.0","repository":{"type":"git","url":"git+https://github.com/isaacs/is-actual-promise.git"},"devDependencies":{"pacote":"^17.0.3","prettier":"^2.8.2","sync-content":"^1.0.2","tap":"^18.5.3","typedoc":"^0.24.8","typescript":"^5.1.6"},"prettier":{"semi":false,"printWidth":70,"tabWidth":2,"useTabs":false,"singleQuote":true,"jsxSingleQuote":false,"bracketSameLine":true,"arrowParens":"avoid","endOfLine":"lf"},"dependencies":{"tshy":"^1.7.0"},"tshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts"}},"types":"./dist/commonjs/index.d.ts","type":"module","_id":"is-actual-promise@1.0.1","gitHead":"3202ae4aa9b1e2dd53141c0925f32cec9912ddb3","bugs":{"url":"https://github.com/isaacs/is-actual-promise/issues"},"homepage":"https://github.com/isaacs/is-actual-promise#readme","_nodeVersion":"20.8.0","_npmVersion":"10.1.0","dist":{"integrity":"sha512-PlsL4tNv62lx5yN2HSqaRSTgIpUAPW7U6+crVB8HfWm5161rZpeqWbl0ZSqH2MAfRKXWSZVPRNbE/r8qPcb13g==","shasum":"69ddeb85d9007d0b778c089845436891ba49c93c","tarball":"http://registry-npm.ywwl.com/is-actual-promise/download/is-actual-promise-1.0.1.tgz","fileCount":13,"unpackedSize":7732,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG3+EM2Dw8cxyofNnMDkDOyDGB04FuLk7ZPBpTuogzG6AiEAoC0Qscz+1AdQDTbq00J+eWpYP9e/pF0PaEPquzo/xXg="}],"size":3088,"noattachment":false,"key":"/is-actual-promise/-/is-actual-promise-1.0.1.tgz"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"directories":{},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-actual-promise_1.0.1_1698697411495_0.4419876416751889"},"_hasShrinkwrap":false,"readme":"# is-actual-promise\n\nSimilar to [`p-is-promise`](https://npmjs.com/p-is-promise) and\n[`is-promise`](https://npmjs.com/is-promise), which are also both\nfine alternatives to this.\n\nDifferences (ie, \"why this thing then?\")\n\n* This module is hybrid, so it can be used in either commonjs or\n  esm. `is-promise` is hybrid, but `p-is-promise` is ESM-only.\n* This module asserts that the tested value supplies the full\n  actual `Promise` interface, not just `PromiseLike` (ie, it also\n  asserts `.catch()` and `.finally()`. (`p-is-promise` tests for\n  `.catch()`, neither tests for `.finally()`.)\n* This module provides a named export rather than a default\n  export, which is a bit less of a hassle in some scenarios.\n* This module does not verify the resolution type of the Promise,\n  since that cannot be determined or verified, only that it's a\n  `Promise<any | void>`.\n\n(Note that this module does _not_ verify that the `.catch()`,\n`.then()`, and `.finally()` methods return Promises, because that\nis impossible at run-time without actually calling them. No\nduck-typing method should ever be considered fully\nauthoritative.)\n\n## USAGE\n\n```ts\nimport { isPromise } from 'is-actual-promise'\n\nconsole.log(isPromise(new Promise(() => {}))) // true\nconsole.log(isPromise((async () => true)())) // true\nconsole.log(isPromise(Promise.resolve(true))) // true\nconsole.log(isPromise({\n  then: async () => 5,\n  finally: async () => {},\n  catch: () => {},\n})) // true, but not accurate, limitation of duck typing\n```\n","publish_time":1698697411653,"_cnpm_publish_time":1698697411653,"dist-tags":{"latest":"1.0.2"}}