🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

deep-map

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deep-map - npm Package Compare versions

Comparing version

to
1.5.0

14

lib/deep-map.d.ts

@@ -0,1 +1,5 @@

export interface DeepMapModule {
<T>(object: any, mapFn: MapFn, options?: Opts): T;
default<T>(object: any, mapFn: MapFn, options?: Opts): T;
}
export interface MapFn {

@@ -8,10 +12,2 @@ (value: any, key: string | number): any;

}
export declare class DeepMap {
private mapFn;
private opts;
private cache;
constructor(mapFn: MapFn, opts: Opts);
map(value: any, key?: string | number): any;
private mapArray(arr);
private mapObject(obj);
}
export declare const deepMapModule: DeepMapModule;
"use strict";
var WeakMap = require('es6-weak-map');
var lodash_1 = require('lodash');
Object.defineProperty(exports, "__esModule", { value: true });
var WeakMap = require("es6-weak-map");
var lodash_1 = require("lodash");
exports.deepMapModule = function deepMap(object, mapFn, options) {
options = lodash_1.isNil(options) ? {} : options;
if (!mapFn) {
throw new Error('mapFn is required');
}
else if (!lodash_1.isFunction(mapFn)) {
throw new TypeError('mapFn must be a function');
}
else if (!lodash_1.isObject(options)) {
throw new TypeError('options must be an object');
}
return new DeepMap(mapFn, options).map(object);
};
exports.deepMapModule.default = exports.deepMapModule;
var DeepMap = (function () {

@@ -42,3 +57,2 @@ function DeepMap(mapFn, opts) {

}());
exports.DeepMap = DeepMap;
//# sourceMappingURL=deep-map.js.map

@@ -1,4 +0,2 @@

import { MapFn, Opts } from './deep-map';
declare function deepMap<T>(object: T, mapFn: MapFn, options?: Opts): T;
declare function deepMap<T>(object: any, mapFn: MapFn, options?: Opts): T;
export = deepMap;
import { deepMapModule } from './deep-map';
export = deepMapModule;
"use strict";
var lodash_1 = require('lodash');
var deep_map_1 = require('./deep-map');
function deepMap(object, mapFn, options) {
options = lodash_1.isNil(options) ? {} : options;
if (!mapFn) {
throw new Error('mapFn is required');
}
else if (!lodash_1.isFunction(mapFn)) {
throw new TypeError('mapFn must be a function');
}
else if (!lodash_1.isObject(options)) {
throw new TypeError('options must be an object');
}
return new deep_map_1.DeepMap(mapFn, options).map(object);
}
module.exports = deepMap;
var deep_map_1 = require("./deep-map");
module.exports = deep_map_1.deepMapModule;
//# sourceMappingURL=index.js.map
{
"name": "deep-map",
"version": "1.4.2",
"version": "1.5.0",
"description": "Transforms nested values of complex objects",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"types": "lib/index.d.ts",
"scripts": {
"build:compile": "tsc",
"build:compile": "tsc -p tsconfig.build.json",
"build:remove": "rimraf lib",
"build": "npm run build:remove && npm run build:compile",
"test:lint": "tslint 'src/**/*.ts'",
"test:unit": "istanbul cover -e .ts -x '*.test.ts' _mocha -- src --opts mocha.opts",
"test:lint": "tslint \"src/**/*.ts\"",
"test:unit": "istanbul cover -e .ts -x \"*.test.ts\" _mocha -- --opts mocha.opts",
"test:report": "npm test && open coverage/lcov-report/index.html",
"test": "npm run test:lint && npm run test:unit",
"ci:typings": "typings install",
"ci:coveralls": "cat coverage/lcov.info | coveralls"
},
"engines": {
"node": ">=0.10"
"node": ">=4"
},
"repository": {
"type": "git",
"url": "git+https://github.com/akim-mcmath/deep-map.git"
"url": "git+https://github.com/mcmath/deep-map.git"
},

@@ -41,22 +40,29 @@ "keywords": [

"bugs": {
"url": "https://github.com/akim-mcmath/deep-map/issues"
"url": "https://github.com/mcmath/deep-map/issues"
},
"homepage": "https://github.com/akim-mcmath/deep-map#readme",
"homepage": "https://github.com/mcmath/deep-map#readme",
"devDependencies": {
"@types/chai": "^3.5.0",
"@types/es6-weak-map": "^1.2.0",
"@types/lodash": "^4.14.62",
"@types/mocha": "^2.2.40",
"@types/sinon": "^2.1.2",
"@types/sinon-chai": "^2.7.27",
"chai": "^3.5.0",
"coveralls": "^2.11.12",
"coveralls": "^2.13.0",
"es6-weak-map": "^2.0.2",
"istanbul": "1.1.0-alpha.1",
"mocha": "^3.0.2",
"rimraf": "^2.5.4",
"sinon": "^1.17.5",
"sinon-chai": "^2.8.0",
"mocha": "^3.2.0",
"rimraf": "^2.6.1",
"sinon": "^2.1.0",
"sinon-chai": "^2.9.0",
"ts-node": "~1.2.3",
"tslint": "^3.14.0",
"typescript": "^1.8.10",
"typings": "^1.3.2"
"tslint": "^5.1.0",
"typescript": "^2.2.2"
},
"dependencies": {
"es6-weak-map": "^2.0.1",
"lodash": "^4.15.0"
"es6-weak-map": "^2.0.2",
"lodash": "^4.17.4",
"tslib": "^1.6.0"
}
}

@@ -184,16 +184,16 @@ # Deep Map

Copyright &copy; 2016 Akim McMath. Licensed under the [MIT License][license].
Copyright &copy; 2016&ndash;2017 Akim McMath. Licensed under the [MIT License][license].
[version-badge]: https://img.shields.io/npm/v/deep-map.svg?style=flat-square
[license-badge]: https://img.shields.io/npm/l/deep-map.svg?style=flat-square
[build-badge]: https://img.shields.io/travis/akim-mcmath/deep-map/master.svg?style=flat-square
[coverage-badge]: https://img.shields.io/coveralls/akim-mcmath/deep-map/master.svg?style=flat-square&service=github
[dependencies-badge]: https://img.shields.io/gemnasium/akim-mcmath/deep-map.svg?style=flat-square
[build-badge]: https://img.shields.io/travis/mcmath/deep-map/master.svg?style=flat-square
[coverage-badge]: https://img.shields.io/coveralls/mcmath/deep-map/master.svg?style=flat-square&service=github
[dependencies-badge]: https://img.shields.io/gemnasium/mcmath/deep-map.svg?style=flat-square
[npm]: https://www.npmjs.com/package/deep-map
[license]: LICENSE
[travis]: https://travis-ci.org/akim-mcmath/deep-map
[coveralls]: https://coveralls.io/github/akim-mcmath/deep-map?branch=master
[gemnasium]: https://gemnasium.com/akim-mcmath/deep-map
[deep-map-keys]: https://github.com/akim-mcmath/deep-map-keys
[travis]: https://travis-ci.org/mcmath/deep-map
[coveralls]: https://coveralls.io/github/mcmath/deep-map?branch=master
[gemnasium]: https://gemnasium.com/mcmath/deep-map
[deep-map-keys]: https://github.com/mcmath/deep-map-keys
[typescript]: http://www.typescriptlang.org/
[array-prototype-map]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map

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