[Pkg-javascript-commits] [node-object-visit] 01/05: Import Upstream version 0.3.4

Sruthi Chandran srud-guest at moszumanska.debian.org
Mon Oct 17 06:41:12 UTC 2016


This is an automated email from the git hooks/post-receive script.

srud-guest pushed a commit to branch master
in repository node-object-visit.

commit 896277504841a264bea2f5379c1d0493e2adf55e
Author: Sruthi <srud at disroot.org>
Date:   Mon Oct 17 12:00:06 2016 +0530

    Import Upstream version 0.3.4
---
 LICENSE      | 21 ++++++++++++++++++
 README.md    | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 index.js     | 30 +++++++++++++++++++++++++
 package.json | 54 +++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 176 insertions(+)

diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..65f90ac
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2015, Jon Schlinkert.
+
+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/README.md b/README.md
new file mode 100644
index 0000000..14d577c
--- /dev/null
+++ b/README.md
@@ -0,0 +1,71 @@
+# object-visit [![NPM version](https://badge.fury.io/js/object-visit.svg)](http://badge.fury.io/js/object-visit)  [![Build Status](https://travis-ci.org/jonschlinkert/object-visit.svg)](https://travis-ci.org/jonschlinkert/object-visit)
+
+> Call a specified method on each value in the given object.
+
+## Install
+
+Install with [npm](https://www.npmjs.com/)
+
+```sh
+$ npm i object-visit --save
+```
+
+## Usage
+
+```js
+var visit = require('object-visit');
+
+var ctx = {
+  data: {},
+  set: function (key, value) {
+    if (typeof key === 'object') {
+      visit(ctx, 'set', key);
+    } else {
+      ctx.data[key] = value;
+    }
+  }
+};
+
+ctx.set('a', 'a');
+ctx.set('b', 'b');
+ctx.set('c', 'c');
+ctx.set({d: {e: 'f'}});
+
+console.log(ctx.data);
+//=> {a: 'a', b: 'b', c: 'c', d: { e: 'f' }};
+```
+
+## Related projects
+
+* [base-methods](https://www.npmjs.com/package/base-methods): Starter for creating a node.js application with a handful of common methods, like `set`, `get`,… [more](https://www.npmjs.com/package/base-methods) | [homepage](https://github.com/jonschlinkert/base-methods)
+* [collection-visit](https://www.npmjs.com/package/collection-visit): Visit a method over the items in an object, or map visit over the objects… [more](https://www.npmjs.com/package/collection-visit) | [homepage](https://github.com/jonschlinkert/collection-visit)
+* [define-property](https://www.npmjs.com/package/define-property): Define a non-enumerable property on an object. | [homepage](https://github.com/jonschlinkert/define-property)
+* [map-visit](https://www.npmjs.com/package/map-visit): Map `visit` over an array of objects. | [homepage](https://github.com/jonschlinkert/map-visit)
+
+## Running tests
+
+Install dev dependencies:
+
+```sh
+$ npm i -d && npm test
+```
+
+## Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/object-visit/issues/new).
+
+## Author
+
+**Jon Schlinkert**
+
++ [github/jonschlinkert](https://github.com/jonschlinkert)
++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
+
+## License
+
+Copyright © 2015 Jon Schlinkert
+Released under the MIT license.
+
+***
+
+_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on November 09, 2015._
\ No newline at end of file
diff --git a/index.js b/index.js
new file mode 100644
index 0000000..50b5800
--- /dev/null
+++ b/index.js
@@ -0,0 +1,30 @@
+/*!
+ * object-visit <https://github.com/jonschlinkert/object-visit>
+ *
+ * Copyright (c) 2015, Jon Schlinkert.
+ * Licensed under the MIT License.
+ */
+
+'use strict';
+
+var isObject = require('isobject');
+
+module.exports = function visit(thisArg, method, target) {
+  if (!isObject(thisArg) && typeof thisArg !== 'function') {
+    throw new Error('object-visit expects `thisArg` to be an object.');
+  }
+
+  if (typeof method !== 'string') {
+    throw new Error('object-visit expects `method` name to be a string');
+  }
+
+  if (typeof thisArg[method] !== 'function') {
+    return thisArg;
+  }
+
+  target = target || {};
+  for (var key in target) {
+    thisArg[method](key, target[key]);
+  }
+  return thisArg;
+};
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..9fcd5f0
--- /dev/null
+++ b/package.json
@@ -0,0 +1,54 @@
+{
+  "name": "object-visit",
+  "description": "Call a specified method on each value in the given object.",
+  "version": "0.3.4",
+  "homepage": "https://github.com/jonschlinkert/object-visit",
+  "author": "Jon Schlinkert (https://github.com/jonschlinkert)",
+  "repository": "jonschlinkert/object-visit",
+  "bugs": {
+    "url": "https://github.com/jonschlinkert/object-visit/issues"
+  },
+  "license": "MIT",
+  "files": [
+    "index.js"
+  ],
+  "main": "index.js",
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "scripts": {
+    "test": "mocha"
+  },
+  "dependencies": {
+    "isobject": "^2.0.0"
+  },
+  "devDependencies": {
+    "gulp": "^3.9.0",
+    "gulp-eslint": "^1.0.0",
+    "gulp-istanbul": "^0.10.1",
+    "gulp-mocha": "^2.1.3",
+    "mocha": "*",
+    "should": "*"
+  },
+  "keywords": [
+    "context",
+    "function",
+    "helper",
+    "key",
+    "method",
+    "object",
+    "value",
+    "visit",
+    "visitor"
+  ],
+  "verb": {
+    "related": {
+      "list": [
+        "collection-visit",
+        "map-visit",
+        "define-property",
+        "base-methods"
+      ]
+    }
+  }
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-object-visit.git



More information about the Pkg-javascript-commits mailing list