@sapphire/result
Advanced tools
Comparing version 1.1.1 to 1.1.2-next.00da8f1.0
@@ -42,17 +42,23 @@ var SapphireResult = (() => { | ||
} | ||
__name(maybe, "maybe"); | ||
function some(x) { | ||
return { exists: true, value: x }; | ||
} | ||
__name(some, "some"); | ||
function none() { | ||
return { exists: false }; | ||
} | ||
__name(none, "none"); | ||
function isSome(x) { | ||
return x.exists; | ||
} | ||
__name(isSome, "isSome"); | ||
function isNone(x) { | ||
return !x.exists; | ||
} | ||
__name(isNone, "isNone"); | ||
function isMaybe(x) { | ||
return typeof x === "object" && x !== null && typeof Reflect.get(x, "exists") === "boolean"; | ||
} | ||
__name(isMaybe, "isMaybe"); | ||
@@ -63,11 +69,15 @@ // src/lib/Result.ts | ||
} | ||
__name(ok, "ok"); | ||
function err(x) { | ||
return { success: false, error: x }; | ||
} | ||
__name(err, "err"); | ||
function isOk(x) { | ||
return x.success; | ||
} | ||
__name(isOk, "isOk"); | ||
function isErr(x) { | ||
return !x.success; | ||
} | ||
__name(isErr, "isErr"); | ||
@@ -82,2 +92,3 @@ // src/lib/Parsers.ts | ||
} | ||
__name(from, "from"); | ||
async function fromAsync(promiseOrCb) { | ||
@@ -90,7 +101,9 @@ try { | ||
} | ||
__name(fromAsync, "fromAsync"); | ||
function isFunction(input) { | ||
return typeof input === "function"; | ||
} | ||
__name(isFunction, "isFunction"); | ||
return __toCommonJS(src_exports); | ||
})(); | ||
//# sourceMappingURL=index.global.js.map |
@@ -43,17 +43,23 @@ "use strict"; | ||
} | ||
__name(maybe, "maybe"); | ||
function some(x) { | ||
return { exists: true, value: x }; | ||
} | ||
__name(some, "some"); | ||
function none() { | ||
return { exists: false }; | ||
} | ||
__name(none, "none"); | ||
function isSome(x) { | ||
return x.exists; | ||
} | ||
__name(isSome, "isSome"); | ||
function isNone(x) { | ||
return !x.exists; | ||
} | ||
__name(isNone, "isNone"); | ||
function isMaybe(x) { | ||
return typeof x === "object" && x !== null && typeof Reflect.get(x, "exists") === "boolean"; | ||
} | ||
__name(isMaybe, "isMaybe"); | ||
@@ -64,11 +70,15 @@ // src/lib/Result.ts | ||
} | ||
__name(ok, "ok"); | ||
function err(x) { | ||
return { success: false, error: x }; | ||
} | ||
__name(err, "err"); | ||
function isOk(x) { | ||
return x.success; | ||
} | ||
__name(isOk, "isOk"); | ||
function isErr(x) { | ||
return !x.success; | ||
} | ||
__name(isErr, "isErr"); | ||
@@ -83,2 +93,3 @@ // src/lib/Parsers.ts | ||
} | ||
__name(from, "from"); | ||
async function fromAsync(promiseOrCb) { | ||
@@ -91,5 +102,7 @@ try { | ||
} | ||
__name(fromAsync, "fromAsync"); | ||
function isFunction(input) { | ||
return typeof input === "function"; | ||
} | ||
__name(isFunction, "isFunction"); | ||
// Annotate the CommonJS export names for ESM import in node: | ||
@@ -96,0 +109,0 @@ 0 && (module.exports = { |
123
package.json
{ | ||
"name": "@sapphire/result", | ||
"version": "1.1.1", | ||
"description": "Sapphire results package", | ||
"author": "@sapphire", | ||
"license": "MIT", | ||
"main": "dist/index.js", | ||
"module": "dist/index.mjs", | ||
"browser": "dist/index.global.js", | ||
"unpkg": "dist/index.global.js", | ||
"types": "dist/index.d.ts", | ||
"typedocMain": "src/index.ts", | ||
"exports": { | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.js", | ||
"types": "./dist/index.d.ts" | ||
}, | ||
"sideEffects": false, | ||
"homepage": "https://github.com/sapphiredev/utilities/tree/main/packages/result", | ||
"scripts": { | ||
"test": "jest", | ||
"lint": "eslint src tests --ext ts --fix -c ../../.eslintrc", | ||
"build": "tsup && tsc -b src", | ||
"prepublishOnly": "yarn build" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/sapphiredev/utilities.git", | ||
"directory": "packages/result" | ||
}, | ||
"files": [ | ||
"dist", | ||
"!dist/*.tsbuildinfo" | ||
], | ||
"engines": { | ||
"node": ">=v14.0.0", | ||
"npm": ">=7.0.0" | ||
}, | ||
"keywords": [ | ||
"@sapphire/result", | ||
"bot", | ||
"discord", | ||
"lexure", | ||
"promise", | ||
"sapphire", | ||
"standalone", | ||
"try catch", | ||
"ts", | ||
"typescript", | ||
"wrapper", | ||
"yarn" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/sapphiredev/utilities/issues" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"gitHead": "bf5ac56e547bfdbfac38e020882004e0f136546e" | ||
} | ||
"name": "@sapphire/result", | ||
"version": "1.1.2-next.00da8f1.0", | ||
"description": "Sapphire results package", | ||
"author": "@sapphire", | ||
"license": "MIT", | ||
"main": "dist/index.js", | ||
"module": "dist/index.mjs", | ||
"browser": "dist/index.global.js", | ||
"unpkg": "dist/index.global.js", | ||
"types": "dist/index.d.ts", | ||
"exports": { | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.js", | ||
"types": "./dist/index.d.ts" | ||
}, | ||
"sideEffects": false, | ||
"homepage": "https://github.com/sapphiredev/utilities/tree/main/packages/result", | ||
"scripts": { | ||
"test": "jest", | ||
"lint": "eslint src tests --ext ts --fix -c ../../.eslintrc", | ||
"build": "tsup && tsc -b src", | ||
"prepublish": "yarn build", | ||
"bump": "cliff-jumper", | ||
"check-update": "cliff-jumper --dry-run" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/sapphiredev/utilities.git", | ||
"directory": "packages/result" | ||
}, | ||
"files": [ | ||
"dist/**/*.js*", | ||
"dist/**/*.mjs*", | ||
"dist/**/*.d*" | ||
], | ||
"engines": { | ||
"node": ">=v14.0.0", | ||
"npm": ">=7.0.0" | ||
}, | ||
"keywords": [ | ||
"@sapphire/result", | ||
"bot", | ||
"discord", | ||
"lexure", | ||
"promise", | ||
"sapphire", | ||
"standalone", | ||
"try catch", | ||
"ts", | ||
"typescript", | ||
"wrapper", | ||
"yarn" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/sapphiredev/utilities/issues" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"devDependencies": { | ||
"tsup": "^5.12.5", | ||
"typescript": "^4.6.3" | ||
} | ||
} |
@@ -160,2 +160,7 @@ <div align="center"> | ||
<td align="center"><a href="https://c43721.dev/"><img src="https://avatars.githubusercontent.com/u/55610086?v=4?s=100" width="100px;" alt=""/><br /><sub><b>c43721</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=c43721" title="Code">๐ป</a></td> | ||
<td align="center"><a href="https://commandtechno.com/"><img src="https://avatars.githubusercontent.com/u/68407783?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Commandtechno</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=Commandtechno" title="Code">๐ป</a></td> | ||
<td align="center"><a href="https://github.com/dhruv-kaushikk"><img src="https://avatars.githubusercontent.com/u/73697546?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Aura</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=dhruv-kaushikk" title="Code">๐ป</a></td> | ||
<td align="center"><a href="https://axis.moe/"><img src="https://avatars.githubusercontent.com/u/54381371?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jonathan</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=axisiscool" title="Code">๐ป</a></td> | ||
<td align="center"><a href="https://github.com/imranbarbhuiya"><img src="https://avatars.githubusercontent.com/u/74945038?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Parbez</b></sub></a><br /><a href="#maintenance-imranbarbhuiya" title="Maintenance">๐ง</a></td> | ||
<td align="center"><a href="https://github.com/NotKaskus"><img src="https://avatars.githubusercontent.com/u/75168528?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Paul Andrew</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=NotKaskus" title="Documentation">๐</a></td> | ||
</tr> | ||
@@ -162,0 +167,0 @@ </table> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
50187
494
177
2
1
1