From c45d446b4cb491aa415a2ea3f7cd9861f245a3ce Mon Sep 17 00:00:00 2001 From: Ardalan Date: Sun, 20 May 2018 21:30:03 +0430 Subject: [PATCH] Added multiple new methods to `Object.prototype` --- API.md | 36 ++++ CHANGELOG.md | 9 + lib/object/camelCaseKeys/index.ts | 22 ++ lib/object/camelCaseKeys/method.ts | 11 + lib/object/camelCaseKeys/test.ts | 11 + lib/object/index.ts | 3 + lib/object/kebabCaseKeys/index.ts | 22 ++ lib/object/kebabCaseKeys/method.ts | 11 + lib/object/kebabCaseKeys/test.ts | 11 + lib/object/methods.ts | 6 + lib/object/snakeCaseKeys/index.ts | 22 ++ lib/object/snakeCaseKeys/method.ts | 11 + lib/object/snakeCaseKeys/test.ts | 11 + package-lock.json | 326 +++++++++++++++-------------- package.json | 8 +- 15 files changed, 356 insertions(+), 164 deletions(-) create mode 100644 lib/object/camelCaseKeys/index.ts create mode 100644 lib/object/camelCaseKeys/method.ts create mode 100644 lib/object/camelCaseKeys/test.ts create mode 100644 lib/object/kebabCaseKeys/index.ts create mode 100644 lib/object/kebabCaseKeys/method.ts create mode 100644 lib/object/kebabCaseKeys/test.ts create mode 100644 lib/object/snakeCaseKeys/index.ts create mode 100644 lib/object/snakeCaseKeys/method.ts create mode 100644 lib/object/snakeCaseKeys/test.ts diff --git a/API.md b/API.md index 65a9fa1b..d736a185 100644 --- a/API.md +++ b/API.md @@ -1234,15 +1234,29 @@ Number.isInstance(2); // true * [Object](#Object) : object * _instance_ + * [.$camelCaseKeys()](#Object+$camelCaseKeys) ⇒ [Object](#Object) * [.$invert()](#Object+$invert) ⇒ [Object](#Object) + * [.$kebabCaseKeys()](#Object+$kebabCaseKeys) ⇒ [Object](#Object) * [.$lowerCaseKeys()](#Object+$lowerCaseKeys) ⇒ [Object](#Object) * [.$map(fn)](#Object+$map) ⇒ [Object](#Object) * [.$mapKeys(fn)](#Object+$mapKeys) ⇒ [Object](#Object) * [.$merge(...objects)](#Object+$merge) ⇒ [Object](#Object) * [.$size()](#Object+$size) ⇒ [Object](#Object) + * [.$snakeCaseKeys()](#Object+$snakeCaseKeys) ⇒ [Object](#Object) * _static_ * [.isInstance](#Object.isInstance) ⇒ boolean + + +### object.$camelCaseKeys() ⇒ [Object](#Object) +Creates a new object from the specified object, where all the keys are in camel-case + +**Kind**: instance method of [Object](#Object) +**Example** +```javascript +const myObj = { First_name: "Adam", "last-name": "Smith" }; +const myObjLower = myObj.$camelCaseKeys(); // {firstName: "Adam", lastName: "Smith"} +``` ### object.$invert() ⇒ [Object](#Object) @@ -1253,6 +1267,17 @@ Inverts the key-value pairs of the object, without mutating it ```javascript { name: "John", age: 20 }.$invert(); // { 20: "age", John: "name" } ``` + + +### object.$kebabCaseKeys() ⇒ [Object](#Object) +Creates a new object from the specified object, where all the keys are in kebab-case + +**Kind**: instance method of [Object](#Object) +**Example** +```javascript +const myObj = { First_name: "Adam", lastName: "Smith" }; +const myObjLower = myObj.$kebabCaseKeys(); // {first-name: "Adam", last-name: "Smith"} +``` ### object.$lowerCaseKeys() ⇒ [Object](#Object) @@ -1334,6 +1359,17 @@ Get size of the object ```javascript { one: 1, two: 2, three: 3 }.$size(); // 3 ``` + + +### object.$snakeCaseKeys() ⇒ [Object](#Object) +Creates a new object from the specified object, where all the keys are in snake-case + +**Kind**: instance method of [Object](#Object) +**Example** +```javascript +const myObj = { FirstName: "Adam", "last-name": "Smith" }; +const myObjLower = myObj.$snakeCaseKeys(); // {first_name: "Adam", last_name: "Smith"} +``` ### Object.isInstance ⇒ boolean diff --git a/CHANGELOG.md b/CHANGELOG.md index dd60db9a..70a3bf14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog + +## [v0.7.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.7.0) *(2018-05-20)* +**Implemented enhancements:** +- `Object.prototype` + - function `camelCaseKeys` added + - function `kebabCaseKeys` added + - function `snakeCaseKeys` added + + ## [v0.6.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.6.0) *(2018-05-11)* **Implemented enhancements:** - `Array.prototype` diff --git a/lib/object/camelCaseKeys/index.ts b/lib/object/camelCaseKeys/index.ts new file mode 100644 index 00000000..d4f9e3f8 --- /dev/null +++ b/lib/object/camelCaseKeys/index.ts @@ -0,0 +1,22 @@ +import * as method from "./method"; +import { addPrototype } from "../utils"; + +declare global { + interface Object { + $camelCaseKeys(): object; + } +} + +/** + * Creates a new object from the specified object, where all the keys are in camel-case + * @memberof Object.prototype + * @returns {Object} + * @example + * const myObj = { First_name: "Adam", "last-name": "Smith" }; + * const myObjLower = myObj.$camelCaseKeys(); // {firstName: "Adam", lastName: "Smith"} + */ +function $camelCaseKeys(this: object): object { + return method(this); +} + +addPrototype("$camelCaseKeys", $camelCaseKeys); diff --git a/lib/object/camelCaseKeys/method.ts b/lib/object/camelCaseKeys/method.ts new file mode 100644 index 00000000..7dfd8abe --- /dev/null +++ b/lib/object/camelCaseKeys/method.ts @@ -0,0 +1,11 @@ +import * as camelCase from "../../string/camelCase/method"; + +const method = (obj: { [key: string]: any }): object => { + return Object.keys(obj).reduce((acc: { [key: string]: any }, key) => { + acc[camelCase(key)] = obj[key]; + + return acc; + }, {}); +}; + +export = method; diff --git a/lib/object/camelCaseKeys/test.ts b/lib/object/camelCaseKeys/test.ts new file mode 100644 index 00000000..58fd36a4 --- /dev/null +++ b/lib/object/camelCaseKeys/test.ts @@ -0,0 +1,11 @@ +import "./index"; + +describe("Object.prototype.$camelCaseKeys", () => { + test( + "{ First_name: \"Adam\", \"last-name\": \"Smith\" }.$camelCaseKeys() returns " + + "{firstName: \"Adam\", lastName: \"Smith\"}", + () => { + expect({ "First_name": "Adam", "last-name": "Smith" }.$camelCaseKeys()) + .toEqual({ firstName: "Adam", lastName: "Smith" }); + }); +}); diff --git a/lib/object/index.ts b/lib/object/index.ts index a51740b7..4e06940b 100644 --- a/lib/object/index.ts +++ b/lib/object/index.ts @@ -1,9 +1,12 @@ /** @namespace Object */ +import "./camelCaseKeys"; import "./invert"; import "./isInstance"; +import "./kebabCaseKeys"; import "./lowerCaseKeys"; import "./map"; import "./mapKeys"; import "./merge"; import "./size"; +import "./snakeCaseKeys"; diff --git a/lib/object/kebabCaseKeys/index.ts b/lib/object/kebabCaseKeys/index.ts new file mode 100644 index 00000000..acf9709f --- /dev/null +++ b/lib/object/kebabCaseKeys/index.ts @@ -0,0 +1,22 @@ +import * as method from "./method"; +import { addPrototype } from "../utils"; + +declare global { + interface Object { + $kebabCaseKeys(): object; + } +} + +/** + * Creates a new object from the specified object, where all the keys are in kebab-case + * @memberof Object.prototype + * @returns {Object} + * @example + * const myObj = { First_name: "Adam", lastName: "Smith" }; + * const myObjLower = myObj.$kebabCaseKeys(); // {first-name: "Adam", last-name: "Smith"} + */ +function $kebabCaseKeys(this: object): object { + return method(this); +} + +addPrototype("$kebabCaseKeys", $kebabCaseKeys); diff --git a/lib/object/kebabCaseKeys/method.ts b/lib/object/kebabCaseKeys/method.ts new file mode 100644 index 00000000..fda4ad82 --- /dev/null +++ b/lib/object/kebabCaseKeys/method.ts @@ -0,0 +1,11 @@ +import * as kebabCase from "../../string/kebabCase/method"; + +const method = (obj: { [key: string]: any }): object => { + return Object.keys(obj).reduce((acc: { [key: string]: any }, key) => { + acc[kebabCase(key)] = obj[key]; + + return acc; + }, {}); +}; + +export = method; diff --git a/lib/object/kebabCaseKeys/test.ts b/lib/object/kebabCaseKeys/test.ts new file mode 100644 index 00000000..dce2ec65 --- /dev/null +++ b/lib/object/kebabCaseKeys/test.ts @@ -0,0 +1,11 @@ +import "./index"; + +describe("Object.prototype.$kebabCaseKeys", () => { + test( + "{ First_name: \"Adam\", lastName: \"Smith\" }.$kebabCaseKeys() returns " + + "{firstName: \"Adam\", lastName: \"Smith\"}", + () => { + expect({ First_name: "Adam", lastName: "Smith" }.$kebabCaseKeys()) + .toEqual({ "first-name": "Adam", "last-name": "Smith" }); + }); +}); diff --git a/lib/object/methods.ts b/lib/object/methods.ts index d48ed42c..f142937a 100644 --- a/lib/object/methods.ts +++ b/lib/object/methods.ts @@ -1,17 +1,23 @@ +import * as camelCaseKeys from "./camelCaseKeys/method"; import * as invert from "./invert/method"; import * as isInstance from "./isInstance/method"; +import * as kebabCaseKeys from "./kebabCaseKeys/method"; import * as lowerCaseKeys from "./lowerCaseKeys/method"; import * as map from "./map/method"; import * as mapKeys from "./mapKeys/method"; import * as merge from "./merge/method"; import * as size from "./size/method"; +import * as snakeCaseKeys from "./snakeCaseKeys/method"; export { + camelCaseKeys, invert, isInstance, + kebabCaseKeys, lowerCaseKeys, map, mapKeys, merge, size, + snakeCaseKeys, }; diff --git a/lib/object/snakeCaseKeys/index.ts b/lib/object/snakeCaseKeys/index.ts new file mode 100644 index 00000000..19fa2631 --- /dev/null +++ b/lib/object/snakeCaseKeys/index.ts @@ -0,0 +1,22 @@ +import * as method from "./method"; +import { addPrototype } from "../utils"; + +declare global { + interface Object { + $snakeCaseKeys(): object; + } +} + +/** + * Creates a new object from the specified object, where all the keys are in snake-case + * @memberof Object.prototype + * @returns {Object} + * @example + * const myObj = { FirstName: "Adam", "last-name": "Smith" }; + * const myObjLower = myObj.$snakeCaseKeys(); // {first_name: "Adam", last_name: "Smith"} + */ +function $snakeCaseKeys(this: object): object { + return method(this); +} + +addPrototype("$snakeCaseKeys", $snakeCaseKeys); diff --git a/lib/object/snakeCaseKeys/method.ts b/lib/object/snakeCaseKeys/method.ts new file mode 100644 index 00000000..bbbf984f --- /dev/null +++ b/lib/object/snakeCaseKeys/method.ts @@ -0,0 +1,11 @@ +import * as snakeCase from "../../string/snakeCase/method"; + +const method = (obj: { [key: string]: any }): object => { + return Object.keys(obj).reduce((acc: { [key: string]: any }, key) => { + acc[snakeCase(key)] = obj[key]; + + return acc; + }, {}); +}; + +export = method; diff --git a/lib/object/snakeCaseKeys/test.ts b/lib/object/snakeCaseKeys/test.ts new file mode 100644 index 00000000..b7a580ea --- /dev/null +++ b/lib/object/snakeCaseKeys/test.ts @@ -0,0 +1,11 @@ +import "./index"; + +describe("Object.prototype.$snakeCaseKeys", () => { + test( + "{ FirstName: \"Adam\", \"last-name\": \"Smith\" }.$snakeCaseKeys() returns " + + "{first_name: \"Adam\", last_name: \"Smith\"}", + () => { + expect({ "FirstName": "Adam", "last-name": "Smith" }.$snakeCaseKeys()) + .toEqual({ first_name: "Adam", last_name: "Smith" }); + }); +}); diff --git a/package-lock.json b/package-lock.json index 3eea9c32..7d39d498 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,22 +1,22 @@ { "name": "prototyped.js", - "version": "0.6.0", + "version": "0.7.0", "lockfileVersion": 1, "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.0.0-beta.46", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.46.tgz", - "integrity": "sha512-7BKRkmYaPZm3Yff5HGZJKCz7RqZ5jUjknsXT6Gz5YKG23J3uq9hAj0epncCB0rlqmnZ8Q+UUpQB2tCR5mT37vw==", + "version": "7.0.0-beta.47", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.47.tgz", + "integrity": "sha512-W7IeG4MoVf4oUvWfHUx9VG9if3E0xSUDf1urrnNYtC2ow1dz2ptvQ6YsJfyVXDuPTFXz66jkHhzMW7a5Eld7TA==", "dev": true, "requires": { - "@babel/highlight": "7.0.0-beta.46" + "@babel/highlight": "7.0.0-beta.47" } }, "@babel/highlight": { - "version": "7.0.0-beta.46", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.46.tgz", - "integrity": "sha512-r4snW6Q8ICL3Y8hGzYJRvyG/+sc+kvkewXNedG9tQjoHmUFMwMSv/o45GWQUQswevGnWghiGkpRPivFfOuMsOA==", + "version": "7.0.0-beta.47", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.47.tgz", + "integrity": "sha512-d505K3Hth1eg0b2swfEF7oFMw3J9M8ceFg0s6dhCSxOOF+07WDvJ0HKT/YbK/Jk9wn8Wyr6HIRAUPKJ9Wfv8Rg==", "dev": true, "requires": { "chalk": "^2.0.0", @@ -62,9 +62,9 @@ "dev": true }, "@types/node": { - "version": "9.6.15", - "resolved": "https://registry.npmjs.org/@types/node/-/node-9.6.15.tgz", - "integrity": "sha512-16zIiQkIZBc1ZpfrOZZZ/6LKDixPiAIZq5q1YE1stxG4Ic1VmQlkNNWGBydqBFcX8eS+m/Dd4z5HzDa+q0b2Xg==", + "version": "9.6.18", + "resolved": "https://registry.npmjs.org/@types/node/-/node-9.6.18.tgz", + "integrity": "sha512-lywCnJQRSsu0kitHQ5nkb7Ay/ScdJPQjhWRtuf+G1DmNKJnPcdVyP0pYvdiDFKjzReC6NLWLgSyimno3kKfIig==", "dev": true }, "@types/pluralize": { @@ -576,9 +576,9 @@ "dev": true }, "atob": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.0.tgz", - "integrity": "sha512-SuiKH8vbsOyCALjA/+EINmt/Kdl+TQPrtFgW7XZZcwtryFu9e5kQoX3bjCW6mIvGH1fbeAZZuvwGR5IlBRznGw==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.1.tgz", + "integrity": "sha1-ri1acpR38onWDdf5amMUoi3Wwio=", "dev": true }, "aws-sign2": { @@ -785,13 +785,13 @@ } }, "babel-jest": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-22.4.3.tgz", - "integrity": "sha512-BgSjmtl3mW3i+VeVHEr9d2zFSAT66G++pJcHQiUjd00pkW+voYXFctIm/indcqOWWXw5a1nUpR1XWszD9fJ1qg==", + "version": "22.4.4", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-22.4.4.tgz", + "integrity": "sha512-A9NB6/lZhYyypR9ATryOSDcqBaqNdzq4U+CN+/wcMsLcmKkPxQEoTKLajGfd3IkxNyVBT8NewUK2nWyGbSzHEQ==", "dev": true, "requires": { "babel-plugin-istanbul": "^4.1.5", - "babel-preset-jest": "^22.4.3" + "babel-preset-jest": "^22.4.4" } }, "babel-messages": { @@ -825,9 +825,9 @@ } }, "babel-plugin-jest-hoist": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-22.4.3.tgz", - "integrity": "sha512-zhvv4f6OTWy2bYevcJftwGCWXMFe7pqoz41IhMi4xna7xNsX5NygdagsrE0y6kkfuXq8UalwvPwKTyAxME2E/g==", + "version": "22.4.4", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-22.4.4.tgz", + "integrity": "sha512-DUvGfYaAIlkdnygVIEl0O4Av69NtuQWcrjMOv6DODPuhuGLDnbsARz3AwiiI/EkIMMlxQDUcrZ9yoyJvTNjcVQ==", "dev": true }, "babel-plugin-syntax-async-functions": { @@ -1168,12 +1168,12 @@ } }, "babel-preset-jest": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-22.4.3.tgz", - "integrity": "sha512-a+M3LTEXTq3gxv0uBN9Qm6ahUl7a8pj923nFbCUdqFUSsf3YrX8Uc+C3MEwji5Af3LiQjSC7w4ooYewlz8HRTA==", + "version": "22.4.4", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-22.4.4.tgz", + "integrity": "sha512-+dxMtOFwnSYWfum0NaEc0O03oSdwBsjx4tMSChRDPGwu/4wSY6Q6ANW3wkjKpJzzguaovRs/DODcT4hbSN8yiA==", "dev": true, "requires": { - "babel-plugin-jest-hoist": "^22.4.3", + "babel-plugin-jest-hoist": "^22.4.4", "babel-plugin-syntax-object-rest-spread": "^6.13.0" } }, @@ -1470,6 +1470,15 @@ "integrity": "sha512-gJZIfmkuy84agOeAZc7WJOexZhisZaBSFk96gkGM6TkH7+1mBfr/MSPnXC8lO0g7guh/ucbswYjruvDbzc6i0g==", "dev": true }, + "capture-exit": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-1.2.0.tgz", + "integrity": "sha1-HF/MSJ/QqwDU8ax64QcuMXP7q28=", + "dev": true, + "requires": { + "rsvp": "^3.3.3" + } + }, "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", @@ -1692,9 +1701,9 @@ "dev": true }, "compare-versions": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.1.0.tgz", - "integrity": "sha512-4hAxDSBypT/yp2ySFD346So6Ragw5xmBn/e/agIGl3bZr6DLUqnoRZPusxKrXdYRZpgexO9daejmIenlq/wrIQ==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.2.1.tgz", + "integrity": "sha512-2y2nHcopMG/NAyk6vWXlLs86XeM9sik4jmx1tKIgzMi9/RQ2eo758RGpxQO3ErihHmg0RlQITPqgz73y6s7quA==", "dev": true }, "component-emitter": { @@ -2298,14 +2307,14 @@ } }, "fill-range": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", - "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", + "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", "dev": true, "requires": { "is-number": "^2.1.0", "isobject": "^2.0.0", - "randomatic": "^1.1.3", + "randomatic": "^3.0.0", "repeat-element": "^1.1.2", "repeat-string": "^1.5.2" } @@ -2417,14 +2426,14 @@ "dev": true }, "fsevents": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.2.tgz", - "integrity": "sha512-iownA+hC4uHFp+7gwP/y5SzaiUo7m2vpa0dhpzw8YuKtiZsz7cIXsFbXpLEeBM6WuCQyw1MH4RRe6XI8GFUctQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", + "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", "dev": true, "optional": true, "requires": { "nan": "^2.9.2", - "node-pre-gyp": "^0.9.0" + "node-pre-gyp": "^0.10.0" }, "dependencies": { "abbrev": { @@ -2505,7 +2514,7 @@ } }, "deep-extend": { - "version": "0.4.2", + "version": "0.5.1", "bundled": true, "dev": true, "optional": true @@ -2683,7 +2692,7 @@ } }, "node-pre-gyp": { - "version": "0.9.1", + "version": "0.10.0", "bundled": true, "dev": true, "optional": true, @@ -2792,12 +2801,12 @@ "optional": true }, "rc": { - "version": "1.2.6", + "version": "1.2.7", "bundled": true, "dev": true, "optional": true, "requires": { - "deep-extend": "~0.4.0", + "deep-extend": "^0.5.1", "ini": "~1.3.0", "minimist": "^1.2.0", "strip-json-comments": "~2.0.1" @@ -3693,13 +3702,13 @@ } }, "jest": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest/-/jest-22.4.3.tgz", - "integrity": "sha512-FFCdU/pXOEASfHxFDOWUysI/+FFoqiXJADEIXgDKuZyqSmBD3tZ4BEGH7+M79v7czj7bbkhwtd2LaEDcJiM/GQ==", + "version": "22.4.4", + "resolved": "https://registry.npmjs.org/jest/-/jest-22.4.4.tgz", + "integrity": "sha512-eBhhW8OS/UuX3HxgzNBSVEVhSuRDh39Z1kdYkQVWna+scpgsrD7vSeBI7tmEvsguPDMnfJodW28YBnhv/BzSew==", "dev": true, "requires": { "import-local": "^1.0.0", - "jest-cli": "^22.4.3" + "jest-cli": "^22.4.4" }, "dependencies": { "ansi-regex": { @@ -3729,9 +3738,9 @@ } }, "jest-cli": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-22.4.3.tgz", - "integrity": "sha512-IiHybF0DJNqZPsbjn4Cy4vcqcmImpoFwNFnkehzVw8lTUSl4axZh5DHewu5bdpZF2Y5gUqFKYzH0FH4Qx2k+UA==", + "version": "22.4.4", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-22.4.4.tgz", + "integrity": "sha512-I9dsgkeyjVEEZj9wrGrqlH+8OlNob9Iptyl+6L5+ToOLJmHm4JwOPatin1b2Bzp5R5YRQJ+oiedx7o1H7wJzhA==", "dev": true, "requires": { "ansi-escapes": "^3.0.0", @@ -3745,20 +3754,20 @@ "istanbul-lib-coverage": "^1.1.1", "istanbul-lib-instrument": "^1.8.0", "istanbul-lib-source-maps": "^1.2.1", - "jest-changed-files": "^22.4.3", - "jest-config": "^22.4.3", - "jest-environment-jsdom": "^22.4.3", - "jest-get-type": "^22.4.3", - "jest-haste-map": "^22.4.3", - "jest-message-util": "^22.4.3", - "jest-regex-util": "^22.4.3", - "jest-resolve-dependencies": "^22.4.3", - "jest-runner": "^22.4.3", - "jest-runtime": "^22.4.3", - "jest-snapshot": "^22.4.3", - "jest-util": "^22.4.3", - "jest-validate": "^22.4.3", - "jest-worker": "^22.4.3", + "jest-changed-files": "^22.2.0", + "jest-config": "^22.4.4", + "jest-environment-jsdom": "^22.4.1", + "jest-get-type": "^22.1.0", + "jest-haste-map": "^22.4.2", + "jest-message-util": "^22.4.0", + "jest-regex-util": "^22.1.0", + "jest-resolve-dependencies": "^22.1.0", + "jest-runner": "^22.4.4", + "jest-runtime": "^22.4.4", + "jest-snapshot": "^22.4.0", + "jest-util": "^22.4.1", + "jest-validate": "^22.4.4", + "jest-worker": "^22.2.2", "micromatch": "^2.3.11", "node-notifier": "^5.2.1", "realpath-native": "^1.0.0", @@ -3800,22 +3809,22 @@ } }, "jest-config": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-22.4.3.tgz", - "integrity": "sha512-KSg3EOToCgkX+lIvenKY7J8s426h6ahXxaUFJxvGoEk0562Z6inWj1TnKoGycTASwiLD+6kSYFALcjdosq9KIQ==", + "version": "22.4.4", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-22.4.4.tgz", + "integrity": "sha512-9CKfo1GC4zrXSoMLcNeDvQBfgtqGTB1uP8iDIZ97oB26RCUb886KkKWhVcpyxVDOUxbhN+uzcBCeFe7w+Iem4A==", "dev": true, "requires": { "chalk": "^2.0.1", "glob": "^7.1.1", - "jest-environment-jsdom": "^22.4.3", - "jest-environment-node": "^22.4.3", - "jest-get-type": "^22.4.3", - "jest-jasmine2": "^22.4.3", - "jest-regex-util": "^22.4.3", - "jest-resolve": "^22.4.3", - "jest-util": "^22.4.3", - "jest-validate": "^22.4.3", - "pretty-format": "^22.4.3" + "jest-environment-jsdom": "^22.4.1", + "jest-environment-node": "^22.4.1", + "jest-get-type": "^22.1.0", + "jest-jasmine2": "^22.4.4", + "jest-regex-util": "^22.1.0", + "jest-resolve": "^22.4.2", + "jest-util": "^22.4.1", + "jest-validate": "^22.4.4", + "pretty-format": "^22.4.0" }, "dependencies": { "ansi-styles": { @@ -3944,21 +3953,21 @@ } }, "jest-jasmine2": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-22.4.3.tgz", - "integrity": "sha512-yZCPCJUcEY6R5KJB/VReo1AYI2b+5Ky+C+JA1v34jndJsRcLpU4IZX4rFJn7yDTtdNbO/nNqg+3SDIPNH2ecnw==", + "version": "22.4.4", + "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-22.4.4.tgz", + "integrity": "sha512-nK3vdUl50MuH7vj/8at7EQVjPGWCi3d5+6aCi7Gxy/XMWdOdbH1qtO/LjKbqD8+8dUAEH+BVVh7HkjpCWC1CSw==", "dev": true, "requires": { "chalk": "^2.0.1", "co": "^4.6.0", - "expect": "^22.4.3", + "expect": "^22.4.0", "graceful-fs": "^4.1.11", "is-generator-fn": "^1.0.0", - "jest-diff": "^22.4.3", - "jest-matcher-utils": "^22.4.3", - "jest-message-util": "^22.4.3", - "jest-snapshot": "^22.4.3", - "jest-util": "^22.4.3", + "jest-diff": "^22.4.0", + "jest-matcher-utils": "^22.4.0", + "jest-message-util": "^22.4.0", + "jest-snapshot": "^22.4.0", + "jest-util": "^22.4.1", "source-map-support": "^0.5.0" }, "dependencies": { @@ -3989,9 +3998,9 @@ "dev": true }, "source-map-support": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.5.tgz", - "integrity": "sha512-mR7/Nd5l1z6g99010shcXJiNEaf3fEtmLhRB/sBcQVJGodcHCULPp2y4Sfa43Kv2zq7T+Izmfp/WHCR6dYkQCA==", + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.6.tgz", + "integrity": "sha512-N4KXEz7jcKqPf2b2vZF11lQIz9W5ZMuUcIOGj243lduidkf2fjkVKJS9vNxVWn3u/uxX38AcE8U9nnH9FPcq+g==", "dev": true, "requires": { "buffer-from": "^1.0.0", @@ -4167,43 +4176,43 @@ } }, "jest-runner": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-22.4.3.tgz", - "integrity": "sha512-U7PLlQPRlWNbvOHWOrrVay9sqhBJmiKeAdKIkvX4n1G2tsvzLlf77nBD28GL1N6tGv4RmuTfI8R8JrkvCa+IBg==", + "version": "22.4.4", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-22.4.4.tgz", + "integrity": "sha512-5S/OpB51igQW9xnkM5Tgd/7ZjiAuIoiJAVtvVTBcEBiXBIFzWM3BAMPBM19FX68gRV0KWyFuGKj0EY3M3aceeQ==", "dev": true, "requires": { "exit": "^0.1.2", - "jest-config": "^22.4.3", - "jest-docblock": "^22.4.3", - "jest-haste-map": "^22.4.3", - "jest-jasmine2": "^22.4.3", - "jest-leak-detector": "^22.4.3", - "jest-message-util": "^22.4.3", - "jest-runtime": "^22.4.3", - "jest-util": "^22.4.3", - "jest-worker": "^22.4.3", + "jest-config": "^22.4.4", + "jest-docblock": "^22.4.0", + "jest-haste-map": "^22.4.2", + "jest-jasmine2": "^22.4.4", + "jest-leak-detector": "^22.4.0", + "jest-message-util": "^22.4.0", + "jest-runtime": "^22.4.4", + "jest-util": "^22.4.1", + "jest-worker": "^22.2.2", "throat": "^4.0.0" } }, "jest-runtime": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-22.4.3.tgz", - "integrity": "sha512-Eat/esQjevhx9BgJEC8udye+FfoJ2qvxAZfOAWshYGS22HydHn5BgsvPdTtt9cp0fSl5LxYOFA1Pja9Iz2Zt8g==", + "version": "22.4.4", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-22.4.4.tgz", + "integrity": "sha512-WRTj9m///npte1YjuphCYX7GRY/c2YvJImU9t7qOwFcqHr4YMzmX6evP/3Sehz5DKW2Vi8ONYPCFWe36JVXxfw==", "dev": true, "requires": { "babel-core": "^6.0.0", - "babel-jest": "^22.4.3", + "babel-jest": "^22.4.4", "babel-plugin-istanbul": "^4.1.5", "chalk": "^2.0.1", "convert-source-map": "^1.4.0", "exit": "^0.1.2", "graceful-fs": "^4.1.11", - "jest-config": "^22.4.3", - "jest-haste-map": "^22.4.3", - "jest-regex-util": "^22.4.3", - "jest-resolve": "^22.4.3", - "jest-util": "^22.4.3", - "jest-validate": "^22.4.3", + "jest-config": "^22.4.4", + "jest-haste-map": "^22.4.2", + "jest-regex-util": "^22.1.0", + "jest-resolve": "^22.4.2", + "jest-util": "^22.4.1", + "jest-validate": "^22.4.4", "json-stable-stringify": "^1.0.1", "micromatch": "^2.3.11", "realpath-native": "^1.0.0", @@ -4354,16 +4363,16 @@ } }, "jest-validate": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-22.4.3.tgz", - "integrity": "sha512-CfFM18W3GSP/xgmA4UouIx0ljdtfD2mjeBC6c89Gg17E44D4tQhAcTrZmf9djvipwU30kSTnk6CzcxdCCeSXfA==", + "version": "22.4.4", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-22.4.4.tgz", + "integrity": "sha512-dmlf4CIZRGvkaVg3fa0uetepcua44DHtktHm6rcoNVtYlpwe6fEJRkMFsaUVcFHLzbuBJ2cPw9Gl9TKfnzMVwg==", "dev": true, "requires": { "chalk": "^2.0.1", - "jest-config": "^22.4.3", - "jest-get-type": "^22.4.3", + "jest-config": "^22.4.4", + "jest-get-type": "^22.1.0", "leven": "^2.1.0", - "pretty-format": "^22.4.3" + "pretty-format": "^22.4.0" }, "dependencies": { "ansi-styles": { @@ -4541,9 +4550,9 @@ } }, "jsdom": { - "version": "11.9.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.9.0.tgz", - "integrity": "sha512-sb3omwJTJ+HwAltLZevM/KQBusY+l2Ar5UfnTCWk9oUVBiDnQPBNiG1BaTAKttCnneonYbNo7vi4EFDY2lBfNA==", + "version": "11.10.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.10.0.tgz", + "integrity": "sha512-x5No5FpJgBg3j5aBwA8ka6eGuS5IxbC8FOkmyccKvObtFT0bDMict/LOxINZsZGZSfGdNomLZ/qRV9Bpq/GIBA==", "dev": true, "requires": { "abab": "^1.0.4", @@ -4777,9 +4786,9 @@ } }, "lru-cache": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.2.tgz", - "integrity": "sha512-wgeVXhrDwAWnIF/yZARsFnMBtdFXOg1b8RIrhilp+0iDYN4mdQcNZElDZ0e4B64BhaxeQ5zN7PMyvu7we1kPeQ==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", + "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", "dev": true, "requires": { "pseudomap": "^1.0.2", @@ -4816,6 +4825,12 @@ "integrity": "sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg==", "dev": true }, + "math-random": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", + "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=", + "dev": true + }, "mem": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", @@ -5443,43 +5458,27 @@ "dev": true }, "randomatic": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", - "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.0.0.tgz", + "integrity": "sha512-VdxFOIEY3mNO5PtSRkkle/hPJDHvQhK21oa73K4yAc9qmp6N429gAyF1gZMOTMeS0/AYzaV/2Trcef+NaIonSA==", "dev": true, "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" + "is-number": "^4.0.0", + "kind-of": "^6.0.0", + "math-random": "^1.0.1" }, "dependencies": { "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true }, "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true } } }, @@ -5834,6 +5833,12 @@ "glob": "^7.0.5" } }, + "rsvp": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-3.6.2.tgz", + "integrity": "sha512-OfWGQTb9vnwRjwtA2QwpG2ICclHC3pgXZO5xt8H2EfgDquO0qVdSb5T88L4qJVAEugbS56pAuV4XZM58UX8ulw==", + "dev": true + }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -5850,15 +5855,16 @@ } }, "sane": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/sane/-/sane-2.5.0.tgz", - "integrity": "sha512-glfKd7YH4UCrh/7dD+UESsr8ylKWRE7UQPoXuz28FgmcF0ViJQhCTCCZHICRKxf8G8O1KdLEn20dcICK54c7ew==", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/sane/-/sane-2.5.2.tgz", + "integrity": "sha1-tNwYYcIbQn6SlQej51HiosuKs/o=", "dev": true, "requires": { "anymatch": "^2.0.0", + "capture-exit": "^1.2.0", "exec-sh": "^0.2.0", "fb-watchman": "^2.0.0", - "fsevents": "^1.1.1", + "fsevents": "^1.2.3", "micromatch": "^3.1.4", "minimist": "^1.1.1", "walker": "~1.0.5", @@ -6367,12 +6373,12 @@ "dev": true }, "source-map-resolve": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.1.tgz", - "integrity": "sha512-0KW2wvzfxm8NCTb30z0LMNyPqWCdDGE2viwzUaucqJdkTRXtZiSY3I+2A6nVAjmdOy0I4gU8DwnVVGsk9jvP2A==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", "dev": true, "requires": { - "atob": "^2.0.0", + "atob": "^2.1.1", "decode-uri-component": "^0.2.0", "resolve-url": "^0.2.1", "source-map-url": "^0.4.0", @@ -7191,9 +7197,9 @@ } }, "uglify-js": { - "version": "3.3.24", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.3.24.tgz", - "integrity": "sha512-hS7+TDiqIqvWScCcKRybCQzmMnEzJ4ryl9ErRmW4GFyG48p0/dKZiy/5mVLbsFzU8CCnCgQdxMiJzZythvLzCg==", + "version": "3.3.25", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.3.25.tgz", + "integrity": "sha512-hobogryjDV36VrLK3Y69ou4REyrTApzUblVFmdQOYRe8cYaSmFJXMb4dR9McdvYDSbeNdzUgYr2YVukJaErJcA==", "dev": true, "requires": { "commander": "~2.15.0", diff --git a/package.json b/package.json index 780abf66..a84195d4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prototyped.js", - "version": "0.6.0", + "version": "0.7.0", "description": "Common typescript ready prototypes available in both es5 and es6", "author": "Ardalan Amini ", "license": "MIT", @@ -130,20 +130,20 @@ }, "devDependencies": { "@types/jest": "^22.2.3", - "@types/node": "^9.6.15", + "@types/node": "^9.6.18", "@types/pluralize": "0.0.28", "babel-core": "^6.26.0", "babel-preset-env": "^1.7.0", "coveralls": "^3.0.1", "fs-extra": "^5.0.0", "fs-readdir-recursive": "^1.1.0", - "jest": "^22.4.3", + "jest": "^22.4.4", "jsdoc-to-markdown": "^3.0.4", "rimraf": "^2.6.2", "tslint": "^5.10.0", "typescript": "^2.8.1", "uglify-es": "^3.3.10", - "uglify-js": "^3.3.24" + "uglify-js": "^3.3.25" }, "jest": { "moduleFileExtensions": [