summaryrefslogtreecommitdiffstats
path: root/node_modules/undefsafe
diff options
context:
space:
mode:
authorGravatar Piotr Russ <mail@pruss.it> 2020-11-18 23:26:45 +0100
committerGravatar Piotr Russ <mail@pruss.it> 2020-11-18 23:26:45 +0100
commit81ddf9b700bc48a1f8e472209f080f9c1d9a9b09 (patch)
tree8b959d50c5a614cbf9fcb346ed556140374d4b6d /node_modules/undefsafe
parent1870f3fdf43707a15fda0f609a021f516f45eb63 (diff)
downloadwebsite_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.gz
website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.bz2
website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.zip
rm node_modules
Diffstat (limited to 'node_modules/undefsafe')
-rw-r--r--node_modules/undefsafe/.jscsrc13
-rw-r--r--node_modules/undefsafe/.jshintrc16
-rw-r--r--node_modules/undefsafe/.npmignore2
-rw-r--r--node_modules/undefsafe/.travis.yml18
-rw-r--r--node_modules/undefsafe/LICENSE22
-rw-r--r--node_modules/undefsafe/README.md63
-rw-r--r--node_modules/undefsafe/example.js14
-rw-r--r--node_modules/undefsafe/lib/undefsafe.js125
-rw-r--r--node_modules/undefsafe/package.json67
9 files changed, 0 insertions, 340 deletions
diff --git a/node_modules/undefsafe/.jscsrc b/node_modules/undefsafe/.jscsrc
deleted file mode 100644
index 9e01c9b..0000000
--- a/node_modules/undefsafe/.jscsrc
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "preset": "node-style-guide",
- "requireCapitalizedComments": null,
- "requireSpacesInAnonymousFunctionExpression": {
- "beforeOpeningCurlyBrace": true,
- "beforeOpeningRoundBrace": true
- },
- "disallowSpacesInNamedFunctionExpression": {
- "beforeOpeningRoundBrace": true
- },
- "excludeFiles": ["node_modules/**"],
- "disallowSpacesInFunction": null
-}
diff --git a/node_modules/undefsafe/.jshintrc b/node_modules/undefsafe/.jshintrc
deleted file mode 100644
index b47f672..0000000
--- a/node_modules/undefsafe/.jshintrc
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "browser": false,
- "camelcase": true,
- "curly": true,
- "devel": true,
- "eqeqeq": true,
- "forin": true,
- "indent": 2,
- "noarg": true,
- "node": true,
- "quotmark": "single",
- "undef": true,
- "strict": false,
- "unused": true
-}
-
diff --git a/node_modules/undefsafe/.npmignore b/node_modules/undefsafe/.npmignore
deleted file mode 100644
index 5f6a848..0000000
--- a/node_modules/undefsafe/.npmignore
+++ /dev/null
@@ -1,2 +0,0 @@
-# .npmignore file
-test/
diff --git a/node_modules/undefsafe/.travis.yml b/node_modules/undefsafe/.travis.yml
deleted file mode 100644
index a1ace24..0000000
--- a/node_modules/undefsafe/.travis.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-sudo: false
-language: node_js
-cache:
- directories:
- - node_modules
-notifications:
- email: false
-node_js:
- - '4'
-before_install:
- - npm i -g npm@^2.0.0
-before_script:
- - npm prune
-after_success:
- - npm run semantic-release
-branches:
- except:
- - "/^v\\d+\\.\\d+\\.\\d+$/"
diff --git a/node_modules/undefsafe/LICENSE b/node_modules/undefsafe/LICENSE
deleted file mode 100644
index caaf03a..0000000
--- a/node_modules/undefsafe/LICENSE
+++ /dev/null
@@ -1,22 +0,0 @@
-The MIT License (MIT)
-
-Copyright © 2016 Remy Sharp, http://remysharp.com <remy@remysharp.com>
-
-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.
diff --git a/node_modules/undefsafe/README.md b/node_modules/undefsafe/README.md
deleted file mode 100644
index 46a706b..0000000
--- a/node_modules/undefsafe/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-# undefsafe
-
-Simple *function* for retrieving deep object properties without getting "Cannot read property 'X' of undefined"
-
-Can also be used to safely set deep values.
-
-## Usage
-
-```js
-var object = {
- a: {
- b: {
- c: 1,
- d: [1,2,3],
- e: 'remy'
- }
- }
-};
-
-console.log(undefsafe(object, 'a.b.e')); // "remy"
-console.log(undefsafe(object, 'a.b.not.found')); // undefined
-```
-
-Demo: [https://jsbin.com/eroqame/3/edit?js,console](https://jsbin.com/eroqame/3/edit?js,console)
-
-## Setting
-
-```js
-var object = {
- a: {
- b: [1,2,3]
- }
-};
-
-// modified object
-var res = undefsafe(object, 'a.b.0', 10);
-
-console.log(object); // { a: { b: [10, 2, 3] } }
-console.log(res); // 1 - previous value
-```
-
-## Star rules in paths
-
-As of 1.2.0, `undefsafe` supports a `*` in the path if you want to search all of the properties (or array elements) for a particular element.
-
-The function will only return a single result, either the 3rd argument validation value, or the first positive match. For example, the following github data:
-
-```js
-const githubData = {
- commits: [{
- modified: [
- "one",
- "two"
- ]
- }, /* ... */ ]
- };
-
-// first modified file found in the first commit
-console.log(undefsafe(githubData, 'commits.*.modified.0'));
-
-// returns `two` or undefined if not found
-console.log(undefsafe(githubData, 'commits.*.modified.*', 'two'));
-```
diff --git a/node_modules/undefsafe/example.js b/node_modules/undefsafe/example.js
deleted file mode 100644
index ed93c23..0000000
--- a/node_modules/undefsafe/example.js
+++ /dev/null
@@ -1,14 +0,0 @@
-var undefsafe = require('undefsafe');
-
-var object = {
- a: {
- b: {
- c: 1,
- d: [1, 2, 3],
- e: 'remy'
- }
- }
-};
-
-console.log(undefsafe(object, 'a.b.e')); // "remy"
-console.log(undefsafe(object, 'a.b.not.found')); // undefined
diff --git a/node_modules/undefsafe/lib/undefsafe.js b/node_modules/undefsafe/lib/undefsafe.js
deleted file mode 100644
index 7446878..0000000
--- a/node_modules/undefsafe/lib/undefsafe.js
+++ /dev/null
@@ -1,125 +0,0 @@
-'use strict';
-
-function undefsafe(obj, path, value, __res) {
- // I'm not super keen on this private function, but it's because
- // it'll also be use in the browser and I wont *one* function exposed
- function split(path) {
- var res = [];
- var level = 0;
- var key = '';
-
- for (var i = 0; i < path.length; i++) {
- var c = path.substr(i, 1);
-
- if (level === 0 && (c === '.' || c === '[')) {
- if (c === '[') {
- level++;
- i++;
- c = path.substr(i, 1);
- }
-
- if (key) {
- // the first value could be a string
- res.push(key);
- }
- key = '';
- continue;
- }
-
- if (c === ']') {
- level--;
- key = key.slice(0, -1);
- continue;
- }
-
- key += c;
- }
-
- res.push(key);
-
- return res;
- }
-
- // bail if there's nothing
- if (obj === undefined || obj === null) {
- return undefined;
- }
-
- var parts = split(path);
- var key = null;
- var type = typeof obj;
- var root = obj;
- var parent = obj;
-
- var star =
- parts.filter(function(_) {
- return _ === '*';
- }).length > 0;
-
- // we're dealing with a primitive
- if (type !== 'object' && type !== 'function') {
- return obj;
- } else if (path.trim() === '') {
- return obj;
- }
-
- key = parts[0];
- var i = 0;
- for (; i < parts.length; i++) {
- key = parts[i];
- parent = obj;
-
- if (key === '*') {
- // loop through each property
- var prop = '';
- var res = __res || [];
-
- for (prop in parent) {
- var shallowObj = undefsafe(
- obj[prop],
- parts.slice(i + 1).join('.'),
- value,
- res
- );
- if (shallowObj && shallowObj !== res) {
- if ((value && shallowObj === value) || value === undefined) {
- if (value !== undefined) {
- return shallowObj;
- }
-
- res.push(shallowObj);
- }
- }
- }
-
- if (res.length === 0) {
- return undefined;
- }
-
- return res;
- }
-
- if (Object.getOwnPropertyNames(obj).indexOf(key) == -1) {
- return undefined;
- }
-
- obj = obj[key];
- if (obj === undefined || obj === null) {
- break;
- }
- }
-
- // if we have a null object, make sure it's the one the user was after,
- // if it's not (i.e. parts has a length) then give undefined back.
- if (obj === null && i !== parts.length - 1) {
- obj = undefined;
- } else if (!star && value) {
- key = path.split('.').pop();
- parent[key] = value;
- }
- return obj;
-}
-
-if (typeof module !== 'undefined') {
- module.exports = undefsafe;
-}
diff --git a/node_modules/undefsafe/package.json b/node_modules/undefsafe/package.json
deleted file mode 100644
index d037515..0000000
--- a/node_modules/undefsafe/package.json
+++ /dev/null
@@ -1,67 +0,0 @@
-{
- "_from": "undefsafe@^2.0.2",
- "_id": "undefsafe@2.0.3",
- "_inBundle": false,
- "_integrity": "sha512-nrXZwwXrD/T/JXeygJqdCO6NZZ1L66HrxM/Z7mIq2oPanoN0F1nLx3lwJMu6AwJY69hdixaFQOuoYsMjE5/C2A==",
- "_location": "/undefsafe",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "undefsafe@^2.0.2",
- "name": "undefsafe",
- "escapedName": "undefsafe",
- "rawSpec": "^2.0.2",
- "saveSpec": null,
- "fetchSpec": "^2.0.2"
- },
- "_requiredBy": [
- "/nodemon"
- ],
- "_resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.3.tgz",
- "_shasum": "6b166e7094ad46313b2202da7ecc2cd7cc6e7aae",
- "_spec": "undefsafe@^2.0.2",
- "_where": "/home/pruss/Dev/3-minute-website/node_modules/nodemon",
- "author": {
- "name": "Remy Sharp"
- },
- "bugs": {
- "url": "https://github.com/remy/undefsafe/issues"
- },
- "bundleDependencies": false,
- "dependencies": {
- "debug": "^2.2.0"
- },
- "deprecated": false,
- "description": "Undefined safe way of extracting object properties",
- "devDependencies": {
- "semantic-release": "^4.3.5",
- "tap": "^5.7.1",
- "tap-only": "0.0.5"
- },
- "directories": {
- "test": "test"
- },
- "homepage": "https://github.com/remy/undefsafe#readme",
- "keywords": [
- "undefined"
- ],
- "license": "MIT",
- "main": "lib/undefsafe.js",
- "name": "undefsafe",
- "prettier": {
- "trailingComma": "none",
- "singleQuote": true
- },
- "repository": {
- "type": "git",
- "url": "git+https://github.com/remy/undefsafe.git"
- },
- "scripts": {
- "cover": "tap test/*.test.js --cov --coverage-report=lcov",
- "semantic-release": "semantic-release pre && npm publish && semantic-release post",
- "test": "tap test/**/*.test.js -R spec"
- },
- "tonicExampleFilename": "example.js",
- "version": "2.0.3"
-}