immutable-assign
Advanced tools
Comparing version 1.0.19 to 1.0.20
@@ -10,2 +10,4 @@ // Place your settings in this file to overwrite default and user settings. | ||
} | ||
, | ||
"typescript.check.workspaceVersion": false | ||
} |
// Karma configuration | ||
// Generated on Wed Aug 10 2016 13:14:23 GMT+1000 (AUS Eastern Standard Time) | ||
module.exports = function(config) { | ||
config.set({ | ||
module.exports = function (config) { | ||
// base path that will be used to resolve all patterns (eg. files, exclude) | ||
basePath: '', | ||
// var customLaunchers = { | ||
// // sl_opera: { | ||
// // base: 'SauceLabs', | ||
// // browserName: 'opera', | ||
// // platform: 'Windows 7', | ||
// // version: 'latest' | ||
// // } | ||
// } | ||
var customLaunchers = { | ||
sl_ie11: { | ||
base: 'SauceLabs', | ||
browserName: 'internet explorer', | ||
platform: 'Windows 10', | ||
version: 'latest' | ||
}, | ||
sl_edge: { | ||
base: 'SauceLabs', | ||
browserName: 'MicrosoftEdge', | ||
platform: 'Windows 10', | ||
version: 'latest' | ||
}, | ||
sl_chrome: { | ||
base: 'SauceLabs', | ||
browserName: 'chrome', | ||
platform: 'Windows 10', | ||
version: 'latest' | ||
}, | ||
sl_firefox: { | ||
base: 'SauceLabs', | ||
browserName: 'firefox', | ||
platform: 'Windows 10', | ||
version: 'latest' | ||
}, | ||
sl_mac_chrome: { | ||
base: 'SauceLabs', | ||
browserName: 'chrome', | ||
platform: 'macOS 10.12', | ||
version: 'latest' | ||
}, | ||
sl_mac_safari: { | ||
base: 'SauceLabs', | ||
browserName: 'safari', | ||
platform: 'macOS 10.12', | ||
version: 'latest' | ||
}, | ||
sl_mac_firefox: { | ||
base: 'SauceLabs', | ||
browserName: 'firefox', | ||
platform: 'macOS 10.12', | ||
version: 'latest' | ||
}, | ||
// frameworks to use | ||
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter | ||
frameworks: ['jasmine'], | ||
sl_ios_safari: { | ||
base: 'SauceLabs', | ||
browserName: 'iphone', | ||
platform: 'iOS 10', | ||
}, | ||
} | ||
config.set({ | ||
// base path that will be used to resolve all patterns (eg. files, exclude) | ||
basePath: '', | ||
// list of files / patterns to load in the browser | ||
files: [ | ||
'src/Libs/*.js', | ||
'node_modules/lodash/lodash.js', | ||
'src/*.js', | ||
'spec/**/*.js' | ||
], | ||
// frameworks to use | ||
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter | ||
frameworks: ['jasmine'], | ||
// list of files to exclude | ||
exclude: [ | ||
], | ||
// list of files / patterns to load in the browser | ||
files: [ | ||
'src/Libs/*.js', | ||
'node_modules/lodash/lodash.js', | ||
'src/*.js', | ||
'spec/**/*.js' | ||
], | ||
// preprocess matching files before serving them to the browser | ||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor | ||
preprocessors: { | ||
}, | ||
// list of files to exclude | ||
exclude: [ | ||
], | ||
// test results reporter to use | ||
// possible values: 'dots', 'progress' | ||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter | ||
reporters: ['progress'], | ||
// preprocess matching files before serving them to the browser | ||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor | ||
preprocessors: { | ||
}, | ||
// web server port | ||
port: 9876, | ||
// test results reporter to use | ||
// possible values: 'dots', 'progress' | ||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter | ||
reporters: ['progress'], | ||
// enable / disable colors in the output (reporters and logs) | ||
colors: true, | ||
// web server port | ||
port: 9876, | ||
// level of logging | ||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG | ||
logLevel: config.LOG_INFO, | ||
// enable / disable colors in the output (reporters and logs) | ||
colors: true, | ||
// enable / disable watching file and executing tests whenever any file changes | ||
autoWatch: true, | ||
// level of logging | ||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG | ||
logLevel: config.LOG_INFO, | ||
// start these browsers | ||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher | ||
// | ||
// If browsers are not installed to the default location, you need to set the environment variable pointing to the installation path. | ||
// E.g., SET FIREFOX_BIN="C:\Program Files (x86)\MozillaFirefox4x\firefox.exe" | ||
// Refer to http://karma-runner.github.io/1.0/config/browsers.html | ||
browsers: ["Chrome", "Firefox", "IE", "PhantomJS"], | ||
// To Run Edge, please install https://github.com/nicolasmccurdy/karma-edge-launcher manually. | ||
//browsers: ["Edge"], | ||
//browsers: ["Chrome", "Firefox", "IE", "Edge", "PhantomJS"], | ||
// enable / disable watching file and executing tests whenever any file changes | ||
autoWatch: true, | ||
// Continuous Integration mode | ||
// if true, Karma captures browsers, runs the tests and exits | ||
singleRun: true, | ||
sauceLabs: { | ||
testName: 'Immutable Assign Unit Tests', | ||
username: 'engineforce', | ||
accessKey: '61e43f6c-d263-4843-8561-a8ca4c482b70', | ||
startConnect: false, | ||
build: Math.random().toString() | ||
}, | ||
customLaunchers: customLaunchers, | ||
browsers: Object.keys(customLaunchers), | ||
reporters: ['dots', 'saucelabs'], | ||
// Concurrency level | ||
// how many browser should be started simultaneous | ||
concurrency: Infinity | ||
}) | ||
// start these browsers | ||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher | ||
// | ||
// If browsers are not installed to the default location, you need to set the environment variable pointing to the installation path. | ||
// E.g., SET FIREFOX_BIN="C:\Program Files (x86)\MozillaFirefox4x\firefox.exe" | ||
// Refer to http://karma-runner.github.io/1.0/config/browsers.html | ||
//browsers: ["Chrome", "Firefox", "IE", "PhantomJS"], | ||
// To Run Edge, please install https://github.com/nicolasmccurdy/karma-edge-launcher manually. | ||
//browsers: ["Edge"], | ||
//browsers: ["Chrome", "Firefox", "IE", "Edge", "PhantomJS"], | ||
// Continuous Integration mode | ||
// if true, Karma captures browsers, runs the tests and exits | ||
singleRun: true, | ||
captureTimeout: 300000, | ||
browserNoActivityTimeout: 300000, | ||
// Concurrency level | ||
// how many browser should be started simultaneous | ||
concurrency: 1 | ||
}) | ||
} |
{ | ||
"name": "immutable-assign", | ||
"version": "1.0.19", | ||
"version": "1.0.20", | ||
"description": "Lightweight immutable helper that allows you to continue working with Plain JavaScript Objects", | ||
@@ -54,2 +54,3 @@ "main": "src/iassign.js", | ||
"karma-safari-launcher": "^1.0.0", | ||
"karma-sauce-launcher": "^1.1.0", | ||
"lodash": "^4.13.1", | ||
@@ -56,0 +57,0 @@ "merge2": "^1.0.2", |
@@ -7,2 +7,4 @@ # immutable-assign (iassign.js) | ||
[![Sauce Test Status][7]][8] | ||
This library is trying to solve following problems: | ||
@@ -67,5 +69,3 @@ | ||
// | ||
// Calling iassign() to update map1.b | ||
// | ||
// 1: Calling iassign() to update map1.b | ||
var map2 = iassign( | ||
@@ -89,5 +89,4 @@ map1, | ||
// | ||
// 1. Calling iassign() to push items to list1 | ||
// | ||
// 2.1: Calling iassign() to push items to list1 | ||
var list2 = iassign( | ||
@@ -102,5 +101,4 @@ list1, | ||
// | ||
// 2. Calling iassign() to unshift item to list2 | ||
// | ||
// 2.2: Calling iassign() to unshift item to list2 | ||
var list3 = iassign( | ||
@@ -115,5 +113,4 @@ list2, | ||
// | ||
// 3. Calling iassign() to concat list1, list2 and list3 | ||
// | ||
// 2.3, Calling iassign() to concat list1, list2 and list3 | ||
var list4 = iassign( | ||
@@ -128,2 +125,13 @@ list1, | ||
// 2.4, Calling iassign() to concat sort list4 | ||
var list5 = iassign( | ||
list4, | ||
function (l) { return l; }, | ||
function (l) { return l.sort(); } | ||
); | ||
// list5 = [0, 1, 1, 1, 2, 2, 2, 3, 3, 4, 4, 5, 5] | ||
// list5 !== list4 | ||
``` | ||
@@ -138,5 +146,4 @@ | ||
// | ||
// Calling iassign() to assign d to nested1.a.b | ||
// | ||
// 3.1: Calling iassign() to assign d to nested1.a.b | ||
var nested2 = iassign( | ||
@@ -152,5 +159,3 @@ nested1, | ||
// | ||
// Calling iassign() to increment nested2.a.b.d | ||
// | ||
// 3.2: Calling iassign() to increment nested2.a.b.d | ||
var nested3 = iassign( | ||
@@ -166,5 +171,3 @@ nested2, | ||
// | ||
// Calling iassign() to push item to nested3.a.b.c | ||
// | ||
// 3.3: Calling iassign() to push item to nested3.a.b.c | ||
var nested4 = iassign( | ||
@@ -189,5 +192,4 @@ nested3, | ||
// | ||
// Calling iassign() and _.map() to increment to every item in "c" array | ||
// | ||
// 4.1: Calling iassign() and _.map() to increment to every item in "c" array | ||
var nested2 = iassign( | ||
@@ -205,5 +207,3 @@ nested1, | ||
// | ||
// Calling iassign() and _.flatMap() | ||
// | ||
// 4.2: Calling iassign() and _.flatMap() | ||
var nested3 = iassign( | ||
@@ -222,25 +222,5 @@ nested2, | ||
####Example 5: Update list/array 2 | ||
```javascript | ||
var iassign = require("immutable-assign"); | ||
####Advanced example 5: Update nested property | ||
var list1 = [3, 1, 4]; | ||
// | ||
// Calling iassign() to sort array | ||
// | ||
var list2 = iassign( | ||
list1, | ||
function (l) { return l; }, | ||
function (l) { return l.sort(); } | ||
); | ||
// list2 = [1, 3, 4]; | ||
// list2 !== list1 | ||
``` | ||
####Advanced example 6: Update nested property | ||
```javascript | ||
@@ -251,5 +231,3 @@ var iassign = require("immutable-assign"); | ||
// | ||
// Calling iassign() to increment o1.a.b.c[0][0].d | ||
// | ||
// 5: Calling iassign() to increment o1.a.b.c[0][0].d | ||
var o2 = iassign( | ||
@@ -289,3 +267,3 @@ o1, | ||
####Advanced example 7: Update array | ||
####Advanced example 6: Update array | ||
@@ -297,5 +275,3 @@ ```javascript | ||
// | ||
// Calling iassign() to push new item to o1.a.b.c[1] | ||
// | ||
// 6: Calling iassign() to push new item to o1.a.b.c[1] | ||
var o2 = iassign( | ||
@@ -335,3 +311,3 @@ o1, | ||
####Advanced example 8: Update nested property, referring to external context. | ||
####Advanced example 7: Update nested property, referring to external context. | ||
@@ -343,5 +319,3 @@ ```javascript | ||
// | ||
// Calling iassign() to push increment to o1.a.b.c[0].d | ||
// | ||
// 7: Calling iassign() to push increment to o1.a.b.c[0].d | ||
var external = { a: 0 }; | ||
@@ -392,2 +366,3 @@ | ||
* 1.0.20 - Added Travis-CI, Coveralls (coverage) and SauceLabs (browsers' tests) | ||
* 1.0.19 - Added TypeScript types to package.json | ||
@@ -404,1 +379,3 @@ * 1.0.18 - Tested on Mac (Safari 10 and Chrome 54) | ||
[6]: https://coveralls.io/github/engineforce/ImmutableAssign?branch=master | ||
[7]: https://saucelabs.com/browser-matrix/engineforce.svg | ||
[8]: https://saucelabs.com/u/engineforce |
@@ -241,6 +241,6 @@ "use strict"; | ||
iassign(o1, function (o) { return o.a.b.c[0]; }, function (ci) { ci[0].d++; return ci; }); | ||
}).toThrowError(TypeError, /Cannot|read only|read-only|extensible|readonly/i); | ||
}).toThrowError(TypeError, /Invalid|Cannot|read only|read-only|extensible|readonly/i); | ||
expect(function () { | ||
iassign(o1, function (o) { return o.a.b.c[0]; }, function (ci) { ci[0].g = 1; return ci; }); | ||
}).toThrowError(TypeError, /add|extensible|readonly/i); | ||
}).toThrowError(TypeError, /Invalid|add|extensible|readonly/i); | ||
expect(function () { | ||
@@ -367,6 +367,6 @@ iassign(o1, function (o) { return o.a.b.c; }, function (ci) { ci[0].pop(); return ci; }); | ||
iassign(o1, function (o) { return o.a.b.c[0]; }, function (ci) { ci[0].d++; return ci; }); | ||
}).toThrowError(TypeError, /Cannot|read only|read-only|extensible|readonly/i); | ||
}).toThrowError(TypeError, /Invalid|Cannot|read only|read-only|extensible|readonly/i); | ||
expect(function () { | ||
iassign(o1, function (o) { return o.a.b.c[0]; }, function (ci) { ci[0].g = 1; return ci; }); | ||
}).toThrowError(TypeError, /add|extensible|readonly/i); | ||
}).toThrowError(TypeError, /Invalid|add|extensible|readonly/i); | ||
expect(function () { | ||
@@ -401,6 +401,6 @@ iassign(o1, function (o) { return o.a.b.c; }, function (ci) { ci[0].pop(); return ci; }); | ||
o2.a.b.c[0][0].d++; | ||
}).toThrowError(TypeError, /Cannot|read only|read-only|extensible|readonly/i); | ||
}).toThrowError(TypeError, /Invalid|Cannot|read only|read-only|extensible|readonly/i); | ||
expect(function () { | ||
o2.a.b.c[0][0].g = 1; | ||
}).toThrowError(TypeError, /add|extensible|readonly/i); | ||
}).toThrowError(TypeError, /Invalid|add|extensible|readonly/i); | ||
expect(function () { | ||
@@ -407,0 +407,0 @@ o2.a.b.c[0].pop(); |
@@ -301,7 +301,7 @@ | ||
iassign(o1, function (o) { return o.a.b.c[0]; }, function (ci) { ci[0].d++; return ci; }); | ||
}).toThrowError(TypeError, /Cannot|read only|read-only|extensible|readonly/i); | ||
}).toThrowError(TypeError, /Invalid|Cannot|read only|read-only|extensible|readonly/i); | ||
expect(() => { | ||
iassign(o1, function (o) { return o.a.b.c[0]; }, function (ci) { (<any>ci[0]).g = 1; return ci; }); | ||
}).toThrowError(TypeError, /add|extensible|readonly/i); | ||
}).toThrowError(TypeError, /Invalid|add|extensible|readonly/i); | ||
@@ -485,7 +485,7 @@ expect(() => { | ||
iassign(o1, function (o) { return o.a.b.c[0]; }, function (ci) { ci[0].d++; return ci; }); | ||
}).toThrowError(TypeError, /Cannot|read only|read-only|extensible|readonly/i); | ||
}).toThrowError(TypeError, /Invalid|Cannot|read only|read-only|extensible|readonly/i); | ||
expect(() => { | ||
iassign(o1, function (o) { return o.a.b.c[0]; }, function (ci) { (<any>ci[0]).g = 1; return ci; }); | ||
}).toThrowError(TypeError, /add|extensible|readonly/i); | ||
}).toThrowError(TypeError, /Invalid|add|extensible|readonly/i); | ||
@@ -532,7 +532,7 @@ expect(() => { | ||
o2.a.b.c[0][0].d++; | ||
}).toThrowError(TypeError, /Cannot|read only|read-only|extensible|readonly/i); | ||
}).toThrowError(TypeError, /Invalid|Cannot|read only|read-only|extensible|readonly/i); | ||
expect(() => { | ||
(<any>o2.a.b.c[0][0]).g = 1; | ||
}).toThrowError(TypeError, /add|extensible|readonly/i); | ||
}).toThrowError(TypeError, /Invalid|add|extensible|readonly/i); | ||
@@ -539,0 +539,0 @@ expect(() => { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
830526
23835
19
363