diff options
author | Rebecca Turner <me@re-becca.org> | 2018-04-12 23:47:43 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2018-04-12 23:49:25 +0300 |
commit | 396afa99f61561424866d5c8dd7aedd6f91d611a (patch) | |
tree | eb56cdb39c2dc359ebb7b44c42629446de9603e4 /node_modules/cacache | |
parent | 0573d91e57c068635a3ad4187b9792afd7b5e22f (diff) |
figgy-pudding@3.1.0
Credit: @zkat
Diffstat (limited to 'node_modules/cacache')
5 files changed, 0 insertions, 402 deletions
diff --git a/node_modules/cacache/node_modules/figgy-pudding/CHANGELOG.md b/node_modules/cacache/node_modules/figgy-pudding/CHANGELOG.md deleted file mode 100644 index 02cf10f49..000000000 --- a/node_modules/cacache/node_modules/figgy-pudding/CHANGELOG.md +++ /dev/null @@ -1,66 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. - -<a name="3.1.0"></a> -# [3.1.0](https://github.com/zkat/figgy-pudding/compare/v3.0.0...v3.1.0) (2018-04-08) - - -### Features - -* **opts:** allow direct option fetching without .get() ([ca77aad](https://github.com/zkat/figgy-pudding/commit/ca77aad)) - - - -<a name="3.0.0"></a> -# [3.0.0](https://github.com/zkat/figgy-pudding/compare/v2.0.1...v3.0.0) (2018-04-06) - - -### Bug Fixes - -* **ci:** oops -- forgot to update CI config ([7a40563](https://github.com/zkat/figgy-pudding/commit/7a40563)) -* **get:** make provider lookup order like Object.assign ([33ff89b](https://github.com/zkat/figgy-pudding/commit/33ff89b)) - - -### Features - -* **concat:** add .concat() method to opts ([d310fce](https://github.com/zkat/figgy-pudding/commit/d310fce)) - - -### meta - -* drop support for node@4 and node@7 ([9f8a61c](https://github.com/zkat/figgy-pudding/commit/9f8a61c)) - - -### BREAKING CHANGES - -* node@4 and node@7 are no longer supported -* **get:** shadow order for properties in providers is reversed - - - -<a name="2.0.1"></a> -## [2.0.1](https://github.com/zkat/figgy-pudding/compare/v2.0.0...v2.0.1) (2018-03-16) - - -### Bug Fixes - -* **opts:** ignore non-object providers ([7b9c0f8](https://github.com/zkat/figgy-pudding/commit/7b9c0f8)) - - - -<a name="2.0.0"></a> -# [2.0.0](https://github.com/zkat/figgy-pudding/compare/v1.0.0...v2.0.0) (2018-03-16) - - -### Features - -* **api:** overhauled API with new opt handling concept ([e6cc929](https://github.com/zkat/figgy-pudding/commit/e6cc929)) -* **license:** relicense to ISC ([87479aa](https://github.com/zkat/figgy-pudding/commit/87479aa)) - - -### BREAKING CHANGES - -* **license:** the license has been changed from CC0-1.0 to ISC. -* **api:** this is a completely different approach than previously -used by this library. See the readme for the new API and an explanation. diff --git a/node_modules/cacache/node_modules/figgy-pudding/LICENSE.md b/node_modules/cacache/node_modules/figgy-pudding/LICENSE.md deleted file mode 100644 index 8d28acf86..000000000 --- a/node_modules/cacache/node_modules/figgy-pudding/LICENSE.md +++ /dev/null @@ -1,16 +0,0 @@ -ISC License - -Copyright (c) npm, Inc. - -Permission to use, copy, modify, and/or distribute this software for -any purpose with or without fee is hereby granted, provided that the -above copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE COPYRIGHT HOLDER DISCLAIMS -ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR -CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE -USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/cacache/node_modules/figgy-pudding/README.md b/node_modules/cacache/node_modules/figgy-pudding/README.md deleted file mode 100644 index 8fbc9e15a..000000000 --- a/node_modules/cacache/node_modules/figgy-pudding/README.md +++ /dev/null @@ -1,149 +0,0 @@ -# figgy-pudding [![npm version](https://img.shields.io/npm/v/figgy-pudding.svg)](https://npm.im/figgy-pudding) [![license](https://img.shields.io/npm/l/figgy-pudding.svg)](https://npm.im/figgy-pudding) [![Travis](https://img.shields.io/travis/zkat/figgy-pudding.svg)](https://travis-ci.org/zkat/figgy-pudding) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/zkat/figgy-pudding?svg=true)](https://ci.appveyor.com/project/zkat/figgy-pudding) [![Coverage Status](https://coveralls.io/repos/github/zkat/figgy-pudding/badge.svg?branch=latest)](https://coveralls.io/github/zkat/figgy-pudding?branch=latest) - -# Death to the God Object! Now Bring Us Some Figgy Pudding! - -[`figgy-pudding`](https://github.com/zkat/figgy-pudding) is a simple JavaScript library for managing and composing cascading options objects -- hiding what needs to be hidden from each layer, without having to do a lot of manual munging and passing of options. - -## Install - -`$ npm install figgy-pudding` - -## Table of Contents - -* [Example](#example) -* [Features](#features) -* [API](#api) - * [`figgyPudding(spec)`](#figgy-pudding) - * [`Opts(values)`](#opts) - * [`opts.get()`](#opts-get) - * [`opts.concat()`](#opts-concat) - -### Example - -```javascript -const puddin = require('figgyPudding') - -const RequestOpts = puddin({ - follow: { - default: true - }, - streaming: { - default: false - }, - log: { - default: require('npmlog') - } -}) - -const MyAppOpts = puddin({ - log: { - default: require('npmlog') - }, - cache: { - default: './cache' - } -}) - -function start (opts) { - opts = MyAppOpts(opts) - initCache(opts.get('cache')) - opts.get('streaming') // => undefined - reqStuff('https://npm.im/figgy-pudding', opts) -} - -function reqStuff (uri, opts) { - opts = RequestOpts(opts) - require('request').get(uri, opts) // can't see `cache` -} -``` - -### Features - -* Hide options from layer that didn't ask for it -* Shared multi-layer options - -### API - -#### <a name="figgy-pudding"></a> `> figgyPudding({ key: { default: val } | String }, [opts])` - -Defines an Options constructor that can be used to collect only the needed -options. - -An optional `default` property for specs can be used to specify default values -if nothing was passed in. - -If the value for a spec is a string, it will be treated as an alias to that -other key. - -##### Example - -```javascript -const MyAppOpts = figgyPudding({ - lg: 'log', - log: { - default: () => require('npmlog') - }, - cache: {} -}) -``` - -#### <a name="opts"></a> `> Opts(...providers)` - -Instantiates an options object defined by `figgyPudding()`, which uses -`providers`, in order, to find requested properties. - -Each provider can be either a plain object, a `Map`-like object (that is, one -with a `.get()` method) or another figgyPudding `Opts` object. - -When nesting `Opts` objects, their properties will not become available to the -new object, but any further nested `Opts` that reference that property _will_ be -able to read from their grandparent, as long as they define that key. Default -values for nested `Opts` parents will be used, if found. - -##### Example - -```javascript -const ReqOpts = figgyPudding({ - follow: {} -}) - -const opts = ReqOpts({ - follow: true, - log: require('npmlog') -}) - -opts.get('follow') // => true -opts.get('log') // => Error: ReqOpts does not define `log` - -const MoreOpts = figgyPudding({ - log: {} -}) -MoreOpts(opts).get('log') // => npmlog object (passed in from original plain obj) -MoreOpts(opts).get('follow') // => Error: MoreOpts does not define `follow` -``` - -#### <a name="opts-get"></a> `> opts.get(key)` - -Gets a value from the options object. - -##### Example - -```js -const opts = MyOpts(config) -opts.get('foo') // value of `foo` -``` - -#### <a name="opts-concat"></a> `> opts.concat(...moreProviders)` - -Creates a new opts object of the same type as `opts` with additional providers. -Providers further to the right shadow providers to the left, with properties in -the original `opts` being shadows by the new providers. - -##### Example - -```js -const opts = MyOpts({x: 1}) -opts.get('x') // 1 -opts.concat({x: 2}).get('x') // 2 -opts.get('x') // 1 (original opts object left intact) -``` diff --git a/node_modules/cacache/node_modules/figgy-pudding/index.js b/node_modules/cacache/node_modules/figgy-pudding/index.js deleted file mode 100644 index a3c9c94eb..000000000 --- a/node_modules/cacache/node_modules/figgy-pudding/index.js +++ /dev/null @@ -1,101 +0,0 @@ -'use strict' - -class FiggyPudding { - constructor (specs, opts, providers) { - this.__specs = specs || {} - this.__opts = opts || (() => false) - this.__providers = reverse((providers || []).filter( - x => x != null && typeof x === 'object' - )) - this.__isFiggyPudding = true - } - get (key) { - return pudGet(this, key, true) - } - concat (...moreConfig) { - return new FiggyPudding( - this.__specs, - this.__opts, - reverse(this.__providers).concat(moreConfig) - ) - } -} - -function pudGet (pud, key, validate) { - let spec = pud.__specs[key] - if (typeof spec === 'string') { - key = spec - spec = pud.__specs[key] - } - if (validate && !spec && (!pud.__opts.other || !pud.__opts.other(key))) { - throw new Error(`invalid config key requested: ${key}`) - } else { - if (!spec) { spec = {} } - let ret - for (let p of pud.__providers) { - if (p.__isFiggyPudding) { - ret = pudGet(p, key, false) - } else if (typeof p.get === 'function') { - ret = p.get(key) - } else { - ret = p[key] - } - if (ret !== undefined) { - break - } - } - if (ret === undefined && spec.default !== undefined) { - if (typeof spec.default === 'function') { - return spec.default() - } else { - return spec.default - } - } else { - return ret - } - } -} - -const proxyHandler = { - has (obj, prop) { - return pudGet(obj, prop, false) !== undefined - }, - get (obj, prop) { - if ( - prop === 'concat' || - prop === 'get' || - prop.slice(0, 2) === '__' - ) { - return obj[prop] - } - return obj.get(prop) - }, - set (obj, prop, value) { - if (prop.slice(0, 2) === '__') { - obj[prop] = value - } else { - throw new Error('figgyPudding options cannot be modified. Use .concat() instead.') - } - }, - delete () { - throw new Error('figgyPudding options cannot be deleted. Use .concat() and shadow them instead.') - } -} - -module.exports = figgyPudding -function figgyPudding (specs, opts) { - function factory (...providers) { - return new Proxy(new FiggyPudding( - specs, - opts, - providers - ), proxyHandler) - } - return factory -} - -function reverse (arr) { - const ret = [] - arr.forEach(x => ret.unshift(x)) - return ret -} diff --git a/node_modules/cacache/node_modules/figgy-pudding/package.json b/node_modules/cacache/node_modules/figgy-pudding/package.json deleted file mode 100644 index b4c4f4d24..000000000 --- a/node_modules/cacache/node_modules/figgy-pudding/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "_from": "figgy-pudding@^3.1.0", - "_id": "figgy-pudding@3.1.0", - "_inBundle": false, - "_integrity": "sha512-Gi2vIue0ec6P/7LNpueGhLuvfF2ztuterl8YFBQn1yKgIS46noGxCbi+vviPdObNYtgUSh5FpHy5q0Cw9XhxKQ==", - "_location": "/cacache/figgy-pudding", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "figgy-pudding@^3.1.0", - "name": "figgy-pudding", - "escapedName": "figgy-pudding", - "rawSpec": "^3.1.0", - "saveSpec": null, - "fetchSpec": "^3.1.0" - }, - "_requiredBy": [ - "/cacache" - ], - "_resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.1.0.tgz", - "_shasum": "a77ed2284175976c424b390b298569e9df86dd1e", - "_spec": "figgy-pudding@^3.1.0", - "_where": "/Users/rebecca/code/npm/node_modules/cacache", - "author": { - "name": "Kat Marchán", - "email": "kzm@sykosomatic.org" - }, - "bugs": { - "url": "https://github.com/zkat/figgy-pudding/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Delicious, festive, cascading config/opts definitions", - "devDependencies": { - "standard": "^11.0.1", - "standard-version": "^4.3.0", - "tap": "^11.1.2", - "weallbehave": "^1.2.0", - "weallcontribute": "^1.0.8" - }, - "files": [ - "*.js", - "lib" - ], - "homepage": "https://github.com/zkat/figgy-pudding#readme", - "keywords": [ - "config", - "options", - "yummy" - ], - "license": "ISC", - "main": "index.js", - "name": "figgy-pudding", - "repository": { - "type": "git", - "url": "git+https://github.com/zkat/figgy-pudding.git" - }, - "scripts": { - "postrelease": "npm publish && git push --follow-tags", - "prerelease": "npm t", - "pretest": "standard", - "release": "standard-version -s", - "test": "tap -J --coverage test/*.js", - "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", - "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" - }, - "version": "3.1.0" -} |