{"_id":"value-or-promise","_rev":"2908029","name":"value-or-promise","description":"A thenable to streamline a possibly sync / possibly async workflow.","dist-tags":{"latest":"1.0.12"},"maintainers":[{"name":"yaacovcr","email":""}],"time":{"modified":"2023-01-13T06:21:53.000Z","created":"2021-04-26T19:53:26.242Z","1.0.12":"2023-01-03T08:12:36.352Z","1.0.11":"2021-09-30T19:36:05.316Z","1.0.10":"2021-05-29T19:29:06.903Z","1.0.9":"2021-05-28T14:49:28.817Z","1.0.8":"2021-05-07T11:15:58.589Z","1.0.7":"2021-05-04T20:32:29.311Z","1.0.6":"2021-04-30T13:28:28.688Z","1.0.5":"2021-04-27T19:57:10.213Z","1.0.4":"2021-04-27T19:42:32.832Z","1.0.3":"2021-04-27T19:32:16.942Z","1.0.2":"2021-04-27T18:48:05.182Z","1.0.1":"2021-04-26T20:15:16.278Z","1.0.0":"2021-04-26T19:53:26.242Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/yaacovCR/value-or-promise.git"},"versions":{"1.0.12":{"name":"value-or-promise","version":"1.0.12","description":"A thenable to streamline a possibly sync / possibly async workflow.","main":"build/main/index.js","typings":"build/main/index.d.ts","module":"build/module/index.js","repository":{"type":"git","url":"git+https://github.com/yaacovCR/value-or-promise.git"},"license":"MIT","keywords":[],"scripts":{"build":"run-p build:*","build:main":"tsc -p tsconfig.json","build:module":"tsc -p tsconfig.module.json","fix":"run-s fix:*","fix:prettier":"prettier \"src/**/*.ts\" --write","fix:lint":"eslint src --ext .ts --fix","test":"run-s build test:*","test:lint":"eslint src --ext .ts","test:prettier":"prettier \"src/**/*.ts\" --list-different","test:mocha":"mocha --require ts-node/register \"src/**/*.spec.ts\"","watch:build":"tsc -p tsconfig.json -w","watch:test":"mocha --require ts-node/register --watch --watch-extensions ts --watch-files src \"src/**/*.spec.ts\" "},"engines":{"node":">=12"},"devDependencies":{"@changesets/cli":"^2.26.0","@types/mocha":"^10.0.1","@types/node":"^18.11.18","@typescript-eslint/eslint-plugin":"^5.48.0","@typescript-eslint/parser":"^5.48.0","eslint":"^8.31.0","eslint-config-prettier":"^8.6.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-functional":"^4.4.1","eslint-plugin-import":"^2.26.0","expect":"^29.3.1","mocha":"^10.2.0","npm-run-all":"^4.1.5","prettier":"^2.8.1","ts-node":"^10.9.1","typescript":"^4.9.4"},"prettier":{"singleQuote":true},"gitHead":"3d14cd5e0ff9fbceb9b881345e58491d18187b19","bugs":{"url":"https://github.com/yaacovCR/value-or-promise/issues"},"homepage":"https://github.com/yaacovCR/value-or-promise#readme","_id":"value-or-promise@1.0.12","_nodeVersion":"19.0.0","_npmVersion":"8.19.2","dist":{"shasum":"0e5abfeec70148c78460a849f6b003ea7986f15c","size":6831,"noattachment":false,"key":"/value-or-promise/-/value-or-promise-1.0.12.tgz","tarball":"http://registry.cnpm.dingdandao.com/value-or-promise/download/value-or-promise-1.0.12.tgz"},"_npmUser":{"name":"yaacovcr","email":"yaacovcr@gmail.com"},"directories":{},"maintainers":[{"name":"yaacovcr","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/value-or-promise_1.0.12_1672733556190_0.3660953935661744"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-01-03T08:12:48.691Z","publish_time":1672733556352,"_cnpm_publish_time":1672733556352},"1.0.11":{"name":"value-or-promise","version":"1.0.11","description":"A thenable to streamline a possibly sync / possibly async workflow.","main":"build/main/index.js","typings":"build/main/index.d.ts","module":"build/module/index.js","repository":{"type":"git","url":"git+https://github.com/yaacovCR/value-or-promise.git"},"license":"MIT","keywords":[],"scripts":{"build":"run-p build:*","build:main":"tsc -p tsconfig.json","build:module":"tsc -p tsconfig.module.json","fix":"run-s fix:*","fix:prettier":"prettier \"src/**/*.ts\" --write","fix:lint":"eslint src --ext .ts --fix","test":"run-s build test:*","test:lint":"eslint src --ext .ts","test:prettier":"prettier \"src/**/*.ts\" --list-different","test:mocha":"mocha --require ts-node/register \"src/**/*.spec.ts\"","watch:build":"tsc -p tsconfig.json -w","watch:test":"mocha --require ts-node/register --watch --watch-extensions ts --watch-files src \"src/**/*.spec.ts\" "},"engines":{"node":">=12"},"devDependencies":{"@changesets/cli":"^2.16.0","@types/mocha":"^8.2.2","@types/node":"^15.0.1","@typescript-eslint/eslint-plugin":"^4.22.0","@typescript-eslint/parser":"^4.22.0","eslint":"^7.25.0","eslint-config-prettier":"^8.3.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-functional":"^3.2.1","eslint-plugin-import":"^2.22.1","expect":"^26.6.2","mocha":"^8.3.2","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-node":"^9.1.1","typescript":"^4.2.4"},"prettier":{"singleQuote":true},"gitHead":"40944ef06c0d8362432d217162d91f8a8e18f863","bugs":{"url":"https://github.com/yaacovCR/value-or-promise/issues"},"homepage":"https://github.com/yaacovCR/value-or-promise#readme","_id":"value-or-promise@1.0.11","_nodeVersion":"16.5.0","_npmVersion":"7.19.1","dist":{"shasum":"3e90299af31dd014fe843fe309cefa7c1d94b140","size":6404,"noattachment":false,"key":"/value-or-promise/-/value-or-promise-1.0.11.tgz","tarball":"http://registry.cnpm.dingdandao.com/value-or-promise/download/value-or-promise-1.0.11.tgz"},"_npmUser":{"name":"yaacovcr","email":"yaacovcr@gmail.com"},"directories":{},"maintainers":[{"name":"yaacovcr","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/value-or-promise_1.0.11_1633030565191_0.436201078608331"},"_hasShrinkwrap":false,"publish_time":1633030565316,"_cnpm_publish_time":1633030565316},"1.0.10":{"name":"value-or-promise","version":"1.0.10","description":"A thenable to streamline a possibly sync / possibly async workflow.","main":"build/main/index.js","typings":"build/main/index.d.ts","module":"build/module/index.js","repository":{"type":"git","url":"git+https://github.com/yaacovCR/value-or-promise.git"},"license":"MIT","keywords":[],"scripts":{"build":"run-p build:*","build:main":"tsc -p tsconfig.json","build:module":"tsc -p tsconfig.module.json","fix":"run-s fix:*","fix:prettier":"prettier \"src/**/*.ts\" --write","fix:lint":"eslint src --ext .ts --fix","test":"run-s build test:*","test:lint":"eslint src --ext .ts","test:prettier":"prettier \"src/**/*.ts\" --list-different","test:mocha":"mocha --require ts-node/register \"src/**/*.spec.ts\"","watch:build":"tsc -p tsconfig.json -w","watch:test":"mocha --require ts-node/register --watch --watch-extensions ts --watch-files src \"src/**/*.spec.ts\" "},"engines":{"node":">=12"},"devDependencies":{"@changesets/cli":"^2.16.0","@types/mocha":"^8.2.2","@types/node":"^15.0.1","@typescript-eslint/eslint-plugin":"^4.22.0","@typescript-eslint/parser":"^4.22.0","eslint":"^7.25.0","eslint-config-prettier":"^8.3.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-functional":"^3.2.1","eslint-plugin-import":"^2.22.1","expect":"^26.6.2","mocha":"^8.3.2","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-node":"^9.1.1","typescript":"^4.2.4"},"prettier":{"singleQuote":true},"gitHead":"fae1d9eeb34145c2a2e7214292963ac76bf84e1a","bugs":{"url":"https://github.com/yaacovCR/value-or-promise/issues"},"homepage":"https://github.com/yaacovCR/value-or-promise#readme","_id":"value-or-promise@1.0.10","_nodeVersion":"16.0.0","_npmVersion":"7.10.0","dist":{"shasum":"5bf041f1e9a8e7043911875547636768a836e446","size":6461,"noattachment":false,"key":"/value-or-promise/-/value-or-promise-1.0.10.tgz","tarball":"http://registry.cnpm.dingdandao.com/value-or-promise/download/value-or-promise-1.0.10.tgz"},"_npmUser":{"name":"yaacovcr","email":"yaacovcr@gmail.com"},"directories":{},"maintainers":[{"name":"yaacovcr","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/value-or-promise_1.0.10_1622316546774_0.24841504071732734"},"_hasShrinkwrap":false,"publish_time":1622316546903,"_cnpm_publish_time":1622316546903},"1.0.9":{"name":"value-or-promise","version":"1.0.9","description":"A thenable to streamline a possibly sync / possibly async workflow.","main":"build/main/index.js","typings":"build/main/index.d.ts","module":"build/module/index.js","repository":{"type":"git","url":"git+https://github.com/yaacovCR/value-or-promise.git"},"license":"MIT","keywords":[],"scripts":{"build":"run-p build:*","build:main":"tsc -p tsconfig.json","build:module":"tsc -p tsconfig.module.json","fix":"run-s fix:*","fix:prettier":"prettier \"src/**/*.ts\" --write","fix:lint":"eslint src --ext .ts --fix","test":"run-s build test:*","test:lint":"eslint src --ext .ts","test:prettier":"prettier \"src/**/*.ts\" --list-different","test:mocha":"mocha --require ts-node/register \"src/**/*.spec.ts\"","watch:build":"tsc -p tsconfig.json -w","watch:test":"mocha --require ts-node/register --watch --watch-extensions ts --watch-files src \"src/**/*.spec.ts\" "},"engines":{"node":">=12"},"devDependencies":{"@changesets/cli":"^2.16.0","@types/mocha":"^8.2.2","@types/node":"^15.0.1","@typescript-eslint/eslint-plugin":"^4.22.0","@typescript-eslint/parser":"^4.22.0","eslint":"^7.25.0","eslint-config-prettier":"^8.3.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-functional":"^3.2.1","eslint-plugin-import":"^2.22.1","expect":"^26.6.2","mocha":"^8.3.2","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-node":"^9.1.1","typescript":"^4.2.4"},"prettier":{"singleQuote":true},"gitHead":"d23324f9893b0a3c5ccd82a0122c5b9c9ee51db5","bugs":{"url":"https://github.com/yaacovCR/value-or-promise/issues"},"homepage":"https://github.com/yaacovCR/value-or-promise#readme","_id":"value-or-promise@1.0.9","_nodeVersion":"16.0.0","_npmVersion":"7.10.0","dist":{"shasum":"7531e195eac8d7d1b375ea4650418e9e88592b37","size":6374,"noattachment":false,"key":"/value-or-promise/-/value-or-promise-1.0.9.tgz","tarball":"http://registry.cnpm.dingdandao.com/value-or-promise/download/value-or-promise-1.0.9.tgz"},"_npmUser":{"name":"yaacovcr","email":"yaacovcr@gmail.com"},"directories":{},"maintainers":[{"name":"yaacovcr","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/value-or-promise_1.0.9_1622213368645_0.7408146700415692"},"_hasShrinkwrap":false,"publish_time":1622213368817,"_cnpm_publish_time":1622213368817},"1.0.8":{"name":"value-or-promise","version":"1.0.8","description":"A thenable to streamline a possibly sync / possibly async workflow.","main":"build/main/index.js","typings":"build/main/index.d.ts","module":"build/module/index.js","repository":{"type":"git","url":"git+https://github.com/yaacovCR/value-or-promise.git"},"license":"MIT","keywords":[],"scripts":{"build":"run-p build:*","build:main":"tsc -p tsconfig.json","build:module":"tsc -p tsconfig.module.json","fix":"run-s fix:*","fix:prettier":"prettier \"src/**/*.ts\" --write","fix:lint":"eslint src --ext .ts --fix","test":"run-s build test:*","test:lint":"eslint src --ext .ts","test:prettier":"prettier \"src/**/*.ts\" --list-different","test:mocha":"mocha --require ts-node/register \"src/**/*.spec.ts\"","watch:build":"tsc -p tsconfig.json -w","watch:test":"mocha --require ts-node/register --watch --watch-extensions ts --watch-files src \"src/**/*.spec.ts\" "},"engines":{"node":">=12"},"devDependencies":{"@changesets/cli":"^2.16.0","@types/mocha":"^8.2.2","@types/node":"^15.0.1","@typescript-eslint/eslint-plugin":"^4.22.0","@typescript-eslint/parser":"^4.22.0","eslint":"^7.25.0","eslint-config-prettier":"^8.3.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-functional":"^3.2.1","eslint-plugin-import":"^2.22.1","expect":"^26.6.2","mocha":"^8.3.2","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-node":"^9.1.1","typescript":"^4.2.4"},"prettier":{"singleQuote":true},"gitHead":"2b37d262fe0bcb75fa2eddef41aa1a1cf9226882","bugs":{"url":"https://github.com/yaacovCR/value-or-promise/issues"},"homepage":"https://github.com/yaacovCR/value-or-promise#readme","_id":"value-or-promise@1.0.8","_nodeVersion":"16.0.0","_npmVersion":"7.10.0","dist":{"shasum":"7a76b1e081c40436a2c74a33745b5a6f13e5c01d","size":6194,"noattachment":false,"key":"/value-or-promise/-/value-or-promise-1.0.8.tgz","tarball":"http://registry.cnpm.dingdandao.com/value-or-promise/download/value-or-promise-1.0.8.tgz"},"_npmUser":{"name":"yaacovcr","email":"yaacovcr@gmail.com"},"directories":{},"maintainers":[{"name":"yaacovcr","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/value-or-promise_1.0.8_1620386158463_0.7402547434691829"},"_hasShrinkwrap":false,"publish_time":1620386158589,"_cnpm_publish_time":1620386158589},"1.0.7":{"name":"value-or-promise","version":"1.0.7","description":"A thenable to streamline a possibly sync / possibly async workflow.","main":"build/main/index.js","typings":"build/main/index.d.ts","module":"build/module/index.js","repository":{"type":"git","url":"git+https://github.com/yaacovCR/value-or-promise.git"},"license":"MIT","keywords":[],"scripts":{"build":"run-p build:*","build:main":"tsc -p tsconfig.json","build:module":"tsc -p tsconfig.module.json","fix":"run-s fix:*","fix:prettier":"prettier \"src/**/*.ts\" --write","fix:lint":"eslint src --ext .ts --fix","test":"run-s build test:*","test:lint":"eslint src --ext .ts","test:prettier":"prettier \"src/**/*.ts\" --list-different","test:mocha":"mocha --require ts-node/register \"src/**/*.spec.ts\"","watch:build":"tsc -p tsconfig.json -w","watch:test":"mocha --require ts-node/register --watch --watch-extensions ts --watch-files src \"src/**/*.spec.ts\" "},"engines":{"node":">=12"},"devDependencies":{"@changesets/cli":"^2.16.0","@types/mocha":"^8.2.2","@types/node":"^15.0.1","@typescript-eslint/eslint-plugin":"^4.22.0","@typescript-eslint/parser":"^4.22.0","eslint":"^7.25.0","eslint-config-prettier":"^8.3.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-functional":"^3.2.1","eslint-plugin-import":"^2.22.1","expect":"^26.6.2","mocha":"^8.3.2","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-node":"^9.1.1","typescript":"^4.2.4"},"prettier":{"singleQuote":true},"gitHead":"de3fcd090f74f4a3483e687b6dd113f83d89e7c6","bugs":{"url":"https://github.com/yaacovCR/value-or-promise/issues"},"homepage":"https://github.com/yaacovCR/value-or-promise#readme","_id":"value-or-promise@1.0.7","_nodeVersion":"16.0.0","_npmVersion":"7.10.0","dist":{"shasum":"b7de9561d77c290da71c4b3692afeff7a5fe8a22","size":6168,"noattachment":false,"key":"/value-or-promise/-/value-or-promise-1.0.7.tgz","tarball":"http://registry.cnpm.dingdandao.com/value-or-promise/download/value-or-promise-1.0.7.tgz"},"_npmUser":{"name":"yaacovcr","email":"yaacovcr@gmail.com"},"directories":{},"maintainers":[{"name":"yaacovcr","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/value-or-promise_1.0.7_1620160349202_0.7709397574913139"},"_hasShrinkwrap":false,"publish_time":1620160349311,"_cnpm_publish_time":1620160349311},"1.0.6":{"name":"value-or-promise","version":"1.0.6","description":"A thenable to streamline a possibly sync / possibly async workflow.","main":"build/main/index.js","typings":"build/main/index.d.ts","module":"build/module/index.js","repository":{"type":"git","url":"git+https://github.com/yaacovCR/value-or-promise.git"},"license":"MIT","keywords":[],"scripts":{"build":"run-p build:*","build:main":"tsc -p tsconfig.json","build:module":"tsc -p tsconfig.module.json","fix":"run-s fix:*","fix:prettier":"prettier \"src/**/*.ts\" --write","fix:lint":"eslint src --ext .ts --fix","test":"run-s build test:*","test:lint":"eslint src --ext .ts","test:prettier":"prettier \"src/**/*.ts\" --list-different","test:mocha":"mocha --require ts-node/register \"src/**/*.spec.ts\"","watch:build":"tsc -p tsconfig.json -w","watch:test":"mocha --require ts-node/register --watch --watch-extensions ts --watch-files src \"src/**/*.spec.ts\" "},"engines":{"node":">=12"},"devDependencies":{"@changesets/cli":"^2.16.0","@types/mocha":"^8.2.2","@types/node":"^15.0.1","@typescript-eslint/eslint-plugin":"^4.22.0","@typescript-eslint/parser":"^4.22.0","eslint":"^7.25.0","eslint-config-prettier":"^8.3.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-functional":"^3.2.1","eslint-plugin-import":"^2.22.1","expect":"^26.6.2","mocha":"^8.3.2","npm-run-all":"^4.1.5","prettier":"^2.2.1","ts-node":"^9.1.1","typescript":"^4.2.4"},"prettier":{"singleQuote":true},"gitHead":"a246304d0150bf2ab10da07a59c911c02cc7a223","bugs":{"url":"https://github.com/yaacovCR/value-or-promise/issues"},"homepage":"https://github.com/yaacovCR/value-or-promise#readme","_id":"value-or-promise@1.0.6","_nodeVersion":"16.0.0","_npmVersion":"7.10.0","dist":{"shasum":"218aa4794aa2ee24dcf48a29aba4413ed584747f","size":4949,"noattachment":false,"key":"/value-or-promise/-/value-or-promise-1.0.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/value-or-promise/download/value-or-promise-1.0.6.tgz"},"_npmUser":{"name":"yaacovcr","email":"yaacovcr@gmail.com"},"directories":{},"maintainers":[{"name":"yaacovcr","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/value-or-promise_1.0.6_1619789308507_0.9909353907814042"},"_hasShrinkwrap":false,"publish_time":1619789308688,"_cnpm_publish_time":1619789308688},"1.0.5":{"name":"value-or-promise","version":"1.0.5","description":"A thenable to streamline a possibly sync / possibly async workflow.","main":"build/main/index.js","typings":"build/main/index.d.ts","module":"build/module/index.js","repository":{"type":"git","url":"git+https://github.com/yaacovCR/value-or-promise.git"},"license":"MIT","keywords":[],"scripts":{"build":"run-p build:*","build:main":"tsc -p tsconfig.json","build:module":"tsc -p tsconfig.module.json","fix":"run-s fix:*","fix:prettier":"prettier \"src/**/*.ts\" --write","fix:lint":"eslint src --ext .ts --fix","test":"run-s build test:*","test:lint":"eslint src --ext .ts","test:prettier":"prettier \"src/**/*.ts\" --list-different","test:mocha":"mocha --require ts-node/register \"src/**/*.spec.ts\"","watch:build":"tsc -p tsconfig.json -w","watch:test":"mocha --require ts-node/register --watch --watch-extensions ts --watch-files src \"src/**/*.spec.ts\" "},"engines":{"node":">=12"},"devDependencies":{"@types/mocha":"^8.2.2","@types/node":"^14.14.41","@typescript-eslint/eslint-plugin":"^4.0.1","@typescript-eslint/parser":"^4.0.1","eslint":"^7.8.0","eslint-config-prettier":"^6.11.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-functional":"^3.0.2","eslint-plugin-import":"^2.22.0","expect":"^26.6.2","mocha":"^8.3.2","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-node":"^9.1.1","typescript":"^4.0.2"},"prettier":{"singleQuote":true},"dependencies":{"@changesets/cli":"^2.16.0"},"gitHead":"6d51f9240dcc529612656d80cf3ca0d8274091b7","bugs":{"url":"https://github.com/yaacovCR/value-or-promise/issues"},"homepage":"https://github.com/yaacovCR/value-or-promise#readme","_id":"value-or-promise@1.0.5","_nodeVersion":"16.0.0","_npmVersion":"7.10.0","dist":{"shasum":"6c9c5496288df3be9c71c60def01262e95d30adf","size":4917,"noattachment":false,"key":"/value-or-promise/-/value-or-promise-1.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/value-or-promise/download/value-or-promise-1.0.5.tgz"},"_npmUser":{"name":"yaacovcr","email":"yaacovcr@gmail.com"},"directories":{},"maintainers":[{"name":"yaacovcr","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/value-or-promise_1.0.5_1619553430023_0.5686207629298679"},"_hasShrinkwrap":false,"publish_time":1619553430213,"_cnpm_publish_time":1619553430213},"1.0.4":{"name":"value-or-promise","version":"1.0.4","description":"A thenable to streamline a possibly sync / possibly async workflow.","main":"build/main/index.js","typings":"build/main/index.d.ts","module":"build/module/index.js","repository":{"type":"git","url":"git+https://github.com/yaacovCR/value-or-promise.git"},"license":"MIT","keywords":[],"scripts":{"build":"run-p build:*","build:main":"tsc -p tsconfig.json","build:module":"tsc -p tsconfig.module.json","fix":"run-s fix:*","fix:prettier":"prettier \"src/**/*.ts\" --write","fix:lint":"eslint src --ext .ts --fix","test":"run-s build test:*","test:lint":"eslint src --ext .ts","test:prettier":"prettier \"src/**/*.ts\" --list-different","test:mocha":"mocha --require ts-node/register \"src/**/*.spec.ts\"","watch:build":"tsc -p tsconfig.json -w","watch:test":"mocha --require ts-node/register --watch --watch-extensions ts --watch-files src \"src/**/*.spec.ts\" "},"engines":{"node":">=12"},"devDependencies":{"@types/mocha":"^8.2.2","@types/node":"^14.14.41","@typescript-eslint/eslint-plugin":"^4.0.1","@typescript-eslint/parser":"^4.0.1","eslint":"^7.8.0","eslint-config-prettier":"^6.11.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-functional":"^3.0.2","eslint-plugin-import":"^2.22.0","expect":"^26.6.2","mocha":"^8.3.2","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-node":"^9.1.1","typescript":"^4.0.2"},"prettier":{"singleQuote":true},"dependencies":{"@changesets/cli":"^2.16.0"},"gitHead":"4492f73ff326eed995b3d26fdfecb66541dcda5c","bugs":{"url":"https://github.com/yaacovCR/value-or-promise/issues"},"homepage":"https://github.com/yaacovCR/value-or-promise#readme","_id":"value-or-promise@1.0.4","_nodeVersion":"16.0.0","_npmVersion":"7.10.0","dist":{"shasum":"283e592f3c6154c9f3764e35b5c3e276f9f43db9","size":4781,"noattachment":false,"key":"/value-or-promise/-/value-or-promise-1.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/value-or-promise/download/value-or-promise-1.0.4.tgz"},"_npmUser":{"name":"yaacovcr","email":"yaacovcr@gmail.com"},"directories":{},"maintainers":[{"name":"yaacovcr","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/value-or-promise_1.0.4_1619552552686_0.12592394653772687"},"_hasShrinkwrap":false,"publish_time":1619552552832,"_cnpm_publish_time":1619552552832},"1.0.3":{"name":"value-or-promise","version":"1.0.3","description":"A thenable to streamline a possibly sync / possibly async workflow.","main":"build/main/index.js","typings":"build/main/index.d.ts","module":"build/module/index.js","repository":{"type":"git","url":"git+https://github.com/yaacovCR/value-or-promise.git"},"license":"MIT","keywords":[],"scripts":{"build":"run-p build:*","build:main":"tsc -p tsconfig.json","build:module":"tsc -p tsconfig.module.json","fix":"run-s fix:*","fix:prettier":"prettier \"src/**/*.ts\" --write","fix:lint":"eslint src --ext .ts --fix","test":"run-s build test:*","test:lint":"eslint src --ext .ts","test:prettier":"prettier \"src/**/*.ts\" --list-different","test:mocha":"mocha --require ts-node/register \"src/**/*.spec.ts\"","watch:build":"tsc -p tsconfig.json -w","watch:test":"mocha --require ts-node/register --watch --watch-extensions ts --watch-files src \"src/**/*.spec.ts\" "},"engines":{"node":">=12"},"devDependencies":{"@types/mocha":"^8.2.2","@types/node":"^14.14.41","@typescript-eslint/eslint-plugin":"^4.0.1","@typescript-eslint/parser":"^4.0.1","eslint":"^7.8.0","eslint-config-prettier":"^6.11.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-functional":"^3.0.2","eslint-plugin-import":"^2.22.0","expect":"^26.6.2","mocha":"^8.3.2","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-node":"^9.1.1","typescript":"^4.0.2"},"prettier":{"singleQuote":true},"dependencies":{"@changesets/cli":"^2.16.0"},"gitHead":"2f7b2b9e246de3e9a3cff7433a27e058d9d850c0","bugs":{"url":"https://github.com/yaacovCR/value-or-promise/issues"},"homepage":"https://github.com/yaacovCR/value-or-promise#readme","_id":"value-or-promise@1.0.3","_nodeVersion":"16.0.0","_npmVersion":"7.10.0","dist":{"shasum":"6e2c0b8bec5a0277f344264c5c777b303c09d27d","size":4763,"noattachment":false,"key":"/value-or-promise/-/value-or-promise-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/value-or-promise/download/value-or-promise-1.0.3.tgz"},"_npmUser":{"name":"yaacovcr","email":"yaacovcr@gmail.com"},"directories":{},"maintainers":[{"name":"yaacovcr","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/value-or-promise_1.0.3_1619551936798_0.8766021161555142"},"_hasShrinkwrap":false,"publish_time":1619551936942,"_cnpm_publish_time":1619551936942},"1.0.2":{"name":"value-or-promise","version":"1.0.2","description":"A thenable to streamline a possibly sync / possibly async workflow.","main":"build/main/index.js","typings":"build/main/index.d.ts","module":"build/module/index.js","repository":{"type":"git","url":"git+https://github.com/yaacovCR/value-or-promise.git"},"license":"MIT","keywords":[],"scripts":{"build":"run-p build:*","build:main":"tsc -p tsconfig.json","build:module":"tsc -p tsconfig.module.json","fix":"run-s fix:*","fix:prettier":"prettier \"src/**/*.ts\" --write","fix:lint":"eslint src --ext .ts --fix","test":"run-s build test:*","test:lint":"eslint src --ext .ts","test:prettier":"prettier \"src/**/*.ts\" --list-different","test:mocha":"mocha --require ts-node/register \"src/**/*.spec.ts\"","watch:build":"tsc -p tsconfig.json -w","watch:test":"mocha --require ts-node/register --watch --watch-extensions ts --watch-files src \"src/**/*.spec.ts\" "},"engines":{"node":">=12"},"devDependencies":{"@types/mocha":"^8.2.2","@types/node":"^14.14.41","@typescript-eslint/eslint-plugin":"^4.0.1","@typescript-eslint/parser":"^4.0.1","eslint":"^7.8.0","eslint-config-prettier":"^6.11.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-functional":"^3.0.2","eslint-plugin-import":"^2.22.0","expect":"^26.6.2","mocha":"^8.3.2","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-node":"^9.1.1","typescript":"^4.0.2"},"prettier":{"singleQuote":true},"dependencies":{"@changesets/cli":"^2.16.0"},"gitHead":"e712ab8466e1ec15fb502aff81c25641849185fd","bugs":{"url":"https://github.com/yaacovCR/value-or-promise/issues"},"homepage":"https://github.com/yaacovCR/value-or-promise#readme","_id":"value-or-promise@1.0.2","_nodeVersion":"16.0.0","_npmVersion":"7.10.0","dist":{"shasum":"aaa1b711de77a7c3f0395fb58809aaad72f28c26","size":6309,"noattachment":false,"key":"/value-or-promise/-/value-or-promise-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/value-or-promise/download/value-or-promise-1.0.2.tgz"},"_npmUser":{"name":"yaacovcr","email":"yaacovcr@gmail.com"},"directories":{},"maintainers":[{"name":"yaacovcr","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/value-or-promise_1.0.2_1619549285079_0.9268276122018941"},"_hasShrinkwrap":false,"publish_time":1619549285182,"_cnpm_publish_time":1619549285182},"1.0.1":{"name":"value-or-promise","version":"1.0.1","description":"A thenable to streamline a possibly sync / possibly async workflow.","main":"build/main/index.js","typings":"build/main/index.d.ts","module":"build/module/index.js","repository":{"type":"git","url":"git+https://github.com/yaacovCR/value-or-promise.git"},"license":"MIT","keywords":[],"scripts":{"build":"run-p build:*","build:main":"tsc -p tsconfig.json","build:module":"tsc -p tsconfig.module.json","fix":"run-s fix:*","fix:prettier":"prettier \"src/**/*.ts\" --write","fix:lint":"eslint src --ext .ts --fix","test":"run-s build test:*","test:lint":"eslint src --ext .ts","test:prettier":"prettier \"src/**/*.ts\" --list-different","test:mocha":"mocha --require ts-node/register \"src/**/*.spec.ts\"","watch:build":"tsc -p tsconfig.json -w","watch:test":"mocha --require ts-node/register --watch --watch-extensions ts --watch-files src \"src/**/*.spec.ts\" "},"engines":{"node":">=12"},"devDependencies":{"@types/mocha":"^8.2.2","@types/node":"^14.14.41","@typescript-eslint/eslint-plugin":"^4.0.1","@typescript-eslint/parser":"^4.0.1","eslint":"^7.8.0","eslint-config-prettier":"^6.11.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-functional":"^3.0.2","eslint-plugin-import":"^2.22.0","expect":"^26.6.2","mocha":"^8.3.2","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-node":"^9.1.1","typescript":"^4.0.2"},"prettier":{"singleQuote":true},"dependencies":{"@changesets/cli":"^2.16.0"},"gitHead":"d1a87c2b6f69887ba30fe4e2f516e152b43d5e2c","bugs":{"url":"https://github.com/yaacovCR/value-or-promise/issues"},"homepage":"https://github.com/yaacovCR/value-or-promise#readme","_id":"value-or-promise@1.0.1","_nodeVersion":"16.0.0","_npmVersion":"7.10.0","dist":{"shasum":"7021919262c7a13605da701bcbd3c9ae8219bf68","size":5240,"noattachment":false,"key":"/value-or-promise/-/value-or-promise-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/value-or-promise/download/value-or-promise-1.0.1.tgz"},"_npmUser":{"name":"yaacovcr","email":"yaacovcr@gmail.com"},"directories":{},"maintainers":[{"name":"yaacovcr","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/value-or-promise_1.0.1_1619468116110_0.5773088236608281"},"_hasShrinkwrap":false,"publish_time":1619468116278,"_cnpm_publish_time":1619468116278},"1.0.0":{"name":"value-or-promise","version":"1.0.0","description":"A thenable to streamline a possibly sync / possibly async workflow.","main":"build/main/index.js","typings":"build/main/index.d.ts","module":"build/module/index.js","repository":{"type":"git","url":"git+https://github.com/yaacovCR/value-or-promise.git"},"license":"MIT","keywords":[],"scripts":{"build":"run-p build:*","build:main":"tsc -p tsconfig.json","build:module":"tsc -p tsconfig.module.json","fix":"run-s fix:*","fix:prettier":"prettier \"src/**/*.ts\" --write","fix:lint":"eslint src --ext .ts --fix","test":"run-s build test:*","test:lint":"eslint src --ext .ts","test:prettier":"prettier \"src/**/*.ts\" --list-different","test:mocha":"mocha --require ts-node/register \"src/**/*.spec.ts\"","watch:build":"tsc -p tsconfig.json -w","watch:test":"mocha --require ts-node/register --watch --watch-extensions ts --watch-files src \"src/**/*.spec.ts\" "},"engines":{"node":">=12"},"devDependencies":{"@types/mocha":"^8.2.2","@types/node":"^14.14.41","@typescript-eslint/eslint-plugin":"^4.0.1","@typescript-eslint/parser":"^4.0.1","eslint":"^7.8.0","eslint-config-prettier":"^6.11.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-functional":"^3.0.2","eslint-plugin-import":"^2.22.0","expect":"^26.6.2","mocha":"^8.3.2","npm-run-all":"^4.1.5","prettier":"^2.1.1","ts-node":"^9.1.1","typescript":"^4.0.2"},"prettier":{"singleQuote":true},"dependencies":{"@changesets/cli":"^2.16.0"},"gitHead":"f81522ab28e18022c9c56a5a3330055817f1e81b","bugs":{"url":"https://github.com/yaacovCR/value-or-promise/issues"},"homepage":"https://github.com/yaacovCR/value-or-promise#readme","_id":"value-or-promise@1.0.0","_nodeVersion":"16.0.0","_npmVersion":"7.10.0","dist":{"shasum":"31e8e7c3575014538577e326d81b877a5dd7e9eb","size":5433,"noattachment":false,"key":"/value-or-promise/-/value-or-promise-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/value-or-promise/download/value-or-promise-1.0.0.tgz"},"_npmUser":{"name":"yaacovcr","email":"yaacovcr@gmail.com"},"directories":{},"maintainers":[{"name":"yaacovcr","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/value-or-promise_1.0.0_1619466806029_0.48581485148120374"},"_hasShrinkwrap":false,"publish_time":1619466806242,"_cnpm_publish_time":1619466806242}},"readme":"# value-or-promise\r\n\r\nA thenable to streamline a possibly sync / possibly async workflow.\r\n\r\n# Installation\r\n\r\n`yarn add value-or-promise` or `npm install value-or-promise`\r\n\r\n# Basic Motivation\r\n\r\nInstead of writing:\r\n\r\n```js\r\nfunction myFunction() {\r\n    const valueOrPromise = getValueOrPromise();\r\n\r\n    if (isPromise(valueOrPromise)) {\r\n        return valueOrPromise.then(v => onValue(v));\r\n    }\r\n    \r\n    return onValue(valueOrPromise);\r\n}\r\n```\r\n\r\n...write:\r\n\r\n```js\r\nfunction myFunction() {\r\n    return new ValueOrPromise(getValueOrPromise)\r\n        .then(v => onValue(v))\r\n        .resolve();\r\n}\r\n```\r\n\r\nWhen working with functions that may or may not return promises, we usually have to duplicate handlers in both the synchronous and asynchronous code paths. In the most basic scenario included above, using `value-or-promise` already provides some code savings, i.e. we only have to reference `doSomethingWithValue` once.\r\n\r\n# More Chaining\r\n\r\nThings start to get even more beneficial when we add more sync-or-async functions to the chain.\r\n\r\nInstead of writing:\r\n\r\n```js\r\nfunction myFunction() {\r\n    const valueOrPromise = getValueOrPromise();\r\n\r\n    if (isPromise(valueOrPromise)) {\r\n        return valueOrPromise\r\n            .then(v => first(v))\r\n            .then(v => second(v));\r\n    }\r\n\r\n    const nextValueOrPromise = first(ValueOrPromise)\r\n\r\n    if (isPromise(nextValueOrPromise)) {\r\n        return nextValueOrPromise.then(v => second(v));\r\n    }\r\n    \r\n    return second(nextValueOrPromise);\r\n}\r\n```\r\n\r\n...write:\r\n\r\n```js\r\nfunction myFunction() {\r\n    return new ValueOrPromise(getValueOrPromise)\r\n        .then(v => first(v))\r\n        .then(v => second(v))\r\n        .resolve();\r\n}\r\n```\r\n\r\n# Error Handling\r\n\r\nEven with shorter chains, `value-or-promise` comes in handy when managing errors.\r\n\r\nInstead of writing:\r\n\r\n```js\r\nfunction myFunction() {\r\n    try {\r\n        const valueOrPromise = getValueOrPromise();\r\n\r\n        if (isPromise(valueOrPromise)) {\r\n            return valueOrPromise\r\n                .then(v => onValue(v))\r\n                .catch(error => console.log(error));\r\n        }\r\n    \r\n        const nextValueOrPromise = onValue(valueOrPromise);\r\n\r\n        if (isPromise(nextValueOrPromise)) {\r\n            return nextValueOrPromise\r\n                .catch(error => console.log(error));\r\n        }\r\n\r\n        return nextValueOrPromise;\r\n    } catch (error) {\r\n        console.log(error);\r\n    }\r\n}\r\n```\r\n\r\n...write:\r\n\r\n```js\r\nfunction myFunction() {\r\n    return new ValueOrPromise(getValueOrPromise)\r\n        .then(v => onValue(v))\r\n        .catch(error => console.log(error))\r\n        .resolve();\r\n}\r\n```\r\n\r\n# Alternatives\r\n\r\nA simpler way of streamlining the above is to always return a promise.\r\n\r\nInstead of writing:\r\n\r\n```js\r\nfunction myFunction() {\r\n    const valueOrPromise = getValueOrPromise();\r\n\r\n    if (isPromise(valueOrPromise)) {\r\n        return valueOrPromise.then(v => onValue(v));\r\n    }\r\n    \r\n    return onValue(valueOrPromise);\r\n}\r\n```\r\n\r\n...or writing:\r\n\r\n```js\r\nfunction myFunction() {\r\n    return new ValueOrPromise(getValueOrPromise)\r\n        .then(v => onValue(v))\r\n        .resolve();\r\n}\r\n```\r\n\r\n...we could write:\r\n\r\n```js\r\nfunction myFunction() {\r\n    return Promise.resolve(getValueOrPromise)\r\n        .then(v => onValue(v));\r\n}\r\n```\r\n\r\n...but then we would always have to return a promise! If we are trying to avoid the event loop when possible, this will not suffice.\r\n\r\n# `ValueOrPromise.all(...)?`\r\n\r\nWe can use `ValueOrPromise.all(...)` analogous to `Promise.all(...)` to create a new `ValueOrPromise` object that will either resolve to an array of values, if none of the passed `ValueOrPromise` objects contain underlying promises, or to a new promise, if one or more of the `ValueOrPromise` objects contain an underlying promise, where the new promise will resolve when all of the potential promises have resolved.\r\n\r\nFor example:\r\n\r\n```js\r\nfunction myFunction() {\r\n    const first = new ValueOrPromise(getFirst);\r\n    const second = new ValueOrPromise(getSecond);\r\n    return ValueOrPromise.all([first, second]).then(\r\n        all => onAll(all)\r\n    ).resolve();\r\n}\r\n```\r\n\r\n`myFunction` with return a value if and only if `getFirst` and `getSecond` both return values. If either returns a promise, `myFunction` will return a promise. If both `getFirst` and `getSecond` return promises, the new promise returned by `myFunction` will resolve only after both promises resolve, just like with `Promise.all`. \r\n\r\n# Inspiration\r\n\r\nThe `value-to-promise` concept is by [Ivan Goncharov](https://github.com/IvanGoncharov).\r\n\r\nImplementation errors are my own.","_attachments":{},"homepage":"https://github.com/yaacovCR/value-or-promise#readme","bugs":{"url":"https://github.com/yaacovCR/value-or-promise/issues"},"license":"MIT"}