@angular-wave/angular.ts 0.0.53 → 0.0.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular-ts.esm.js +2 -2
- package/dist/angular-ts.umd.js +2 -2
- package/package.json +1 -1
- package/src/angular.spec.js +0 -8
- package/src/animations/animate-cache.js +48 -23
- package/src/animations/animate-children-directive.js +5 -0
- package/src/animations/animate-css-driver.js +28 -27
- package/src/animations/animate-css.html +40 -0
- package/src/animations/animate-css.js +14 -20
- package/src/animations/animate-queue.js +2 -4
- package/src/animations/animate.md +933 -0
- package/src/animations/animation.js +3 -3
- package/src/animations/module.js +0 -754
- package/src/animations/shared.js +5 -0
- package/src/binding.spec.js +0 -2
- package/src/core/animate/animate-runner.js +1 -1
- package/src/core/animate/animate.spec.js +0 -1
- package/src/core/compile/compile.spec.js +3 -5
- package/src/core/location/location.spec.js +7 -7
- package/src/core/url-utils/url-utils.spec.js +1 -3
- package/src/directive/options/options.js +2 -3
- package/src/directive/repeat/repeat.spec.js +1 -1
- package/src/exts/messages/messages.js +1 -2
- package/src/loader.js +0 -1
- package/src/public.js +0 -7
- package/src/router/params/param-type.js +0 -1
- package/src/router/params/param-types.js +1 -1
- package/src/router/params/param.js +6 -3
- package/src/router/resolve/resolve-context.js +0 -1
- package/src/router/state/state.spec.js +0 -3
- package/src/router/transition/transition-event-type.js +0 -1
- package/src/router/transition/transition.js +0 -1
- package/src/router/url/url-matcher.js +0 -2
- package/src/services/cookie-reader.js +2 -6
- package/src/services/http-backend/http-backend.js +0 -1
- package/src/shared/common.js +1 -12
- package/src/shared/hof.js +0 -1
- package/src/shared/utils.js +1 -89
- package/types/animations/animate-cache.d.ts +38 -5
- package/types/animations/animate-children-directive.d.ts +5 -3
- package/types/animations/animate-css-driver.d.ts +1 -1
- package/types/animations/animate-queue.d.ts +1 -1
- package/types/animations/module.d.ts +0 -749
- package/types/animations/shared.d.ts +6 -1
- package/types/core/animate/animate-runner.d.ts +1 -2
- package/types/directive/options/options.d.ts +1 -1
- package/types/services/cookie-reader.d.ts +1 -6
- package/types/services/http-backend/http-backend.d.ts +0 -1
- package/types/shared/common.d.ts +0 -1
- package/types/shared/utils.d.ts +1 -89
- package/src/services/document.js +0 -67
- package/types/services/document.d.ts +0 -41
package/src/animations/shared.js
CHANGED
|
@@ -303,6 +303,11 @@ export function resolveElementClasses(existing, toAdd, toRemove) {
|
|
|
303
303
|
return classes;
|
|
304
304
|
}
|
|
305
305
|
|
|
306
|
+
/**
|
|
307
|
+
*
|
|
308
|
+
* @param {JQLite|Element} element
|
|
309
|
+
* @returns {Element}
|
|
310
|
+
*/
|
|
306
311
|
export function getDomNode(element) {
|
|
307
312
|
return element instanceof JQLite ? element[0] : element;
|
|
308
313
|
}
|
package/src/binding.spec.js
CHANGED
|
@@ -9,7 +9,6 @@ describe("binding", () => {
|
|
|
9
9
|
$rootScope,
|
|
10
10
|
$compile,
|
|
11
11
|
$exceptionHandler,
|
|
12
|
-
$document,
|
|
13
12
|
errors = [];
|
|
14
13
|
|
|
15
14
|
function childNode(element, index) {
|
|
@@ -27,7 +26,6 @@ describe("binding", () => {
|
|
|
27
26
|
$rootScope = $injector.get("$rootScope");
|
|
28
27
|
$compile = $injector.get("$compile");
|
|
29
28
|
$exceptionHandler = $injector.get("$exceptionHandler");
|
|
30
|
-
$document = $injector.get("$document");
|
|
31
29
|
this.compileToHtml = function (content) {
|
|
32
30
|
let html;
|
|
33
31
|
content = JQLite(content);
|
|
@@ -483,7 +483,6 @@ describe("$animate", () => {
|
|
|
483
483
|
|
|
484
484
|
element = JQLite('<svg><g class="test-class4"></g></svg>');
|
|
485
485
|
const target = element.children().eq(0);
|
|
486
|
-
debugger;
|
|
487
486
|
$animate.addClass(target, "test-class1");
|
|
488
487
|
$animate.removeClass(target, "test-class1");
|
|
489
488
|
$animate.addClass(target, "test-class2");
|
|
@@ -55,8 +55,7 @@ describe("$compile", () => {
|
|
|
55
55
|
$compile,
|
|
56
56
|
$templateCache,
|
|
57
57
|
log,
|
|
58
|
-
$sce
|
|
59
|
-
$document;
|
|
58
|
+
$sce;
|
|
60
59
|
|
|
61
60
|
beforeEach(() => {
|
|
62
61
|
log = [];
|
|
@@ -68,7 +67,6 @@ describe("$compile", () => {
|
|
|
68
67
|
$rootScope = injector.get("$rootScope");
|
|
69
68
|
$compile = injector.get("$compile");
|
|
70
69
|
$templateCache = injector.get("$templateCache");
|
|
71
|
-
$document = injector.get("$document");
|
|
72
70
|
$sce = injector.get("$sce");
|
|
73
71
|
});
|
|
74
72
|
|
|
@@ -187,7 +185,6 @@ describe("$compile", () => {
|
|
|
187
185
|
$rootScope = injector.get("$rootScope");
|
|
188
186
|
$compile = injector.get("$compile");
|
|
189
187
|
$templateCache = injector.get("$templateCache");
|
|
190
|
-
$document = injector.get("$document");
|
|
191
188
|
$sce = injector.get("$sce");
|
|
192
189
|
}
|
|
193
190
|
|
|
@@ -4971,7 +4968,8 @@ describe("$compile", () => {
|
|
|
4971
4968
|
describe("compile phase", () => {
|
|
4972
4969
|
// NO ELEMENT ATTACHMENTS
|
|
4973
4970
|
// it("should attach scope to the document node when it is compiled explicitly", () => {
|
|
4974
|
-
// $
|
|
4971
|
+
// let $document = JQLite(document);
|
|
4972
|
+
// $document = $compile($document)($rootScope);
|
|
4975
4973
|
// expect($document.scope()).toBe($rootScope);
|
|
4976
4974
|
// });
|
|
4977
4975
|
|
|
@@ -2361,7 +2361,7 @@ describe("$location", () => {
|
|
|
2361
2361
|
// $compile,
|
|
2362
2362
|
// $browser,
|
|
2363
2363
|
// $rootElement,
|
|
2364
|
-
//
|
|
2364
|
+
//
|
|
2365
2365
|
// $location,
|
|
2366
2366
|
// ) => {
|
|
2367
2367
|
// // we need to do this otherwise we can't simulate events
|
|
@@ -2402,7 +2402,7 @@ describe("$location", () => {
|
|
|
2402
2402
|
// $compile,
|
|
2403
2403
|
// $browser,
|
|
2404
2404
|
// $rootElement,
|
|
2405
|
-
//
|
|
2405
|
+
//
|
|
2406
2406
|
// $location,
|
|
2407
2407
|
// ) => {
|
|
2408
2408
|
// // we need to do this otherwise we can't simulate events
|
|
@@ -2477,7 +2477,7 @@ describe("$location", () => {
|
|
|
2477
2477
|
// $compile,
|
|
2478
2478
|
// $browser,
|
|
2479
2479
|
// $rootElement,
|
|
2480
|
-
//
|
|
2480
|
+
//
|
|
2481
2481
|
// $location,
|
|
2482
2482
|
// ) => {
|
|
2483
2483
|
// // make IE happy
|
|
@@ -2499,7 +2499,7 @@ describe("$location", () => {
|
|
|
2499
2499
|
|
|
2500
2500
|
// // regression https://github.com/angular/angular.js/issues/1058
|
|
2501
2501
|
// it("should not throw if element was removed", inject((
|
|
2502
|
-
//
|
|
2502
|
+
//
|
|
2503
2503
|
// $rootElement,
|
|
2504
2504
|
// $location,
|
|
2505
2505
|
// ) => {
|
|
@@ -2532,7 +2532,7 @@ describe("$location", () => {
|
|
|
2532
2532
|
// $compile,
|
|
2533
2533
|
// $browser,
|
|
2534
2534
|
// $rootElement,
|
|
2535
|
-
//
|
|
2535
|
+
//
|
|
2536
2536
|
// $location,
|
|
2537
2537
|
// ) => {
|
|
2538
2538
|
// // we need to do this otherwise we can't simulate events
|
|
@@ -3440,7 +3440,7 @@ describe("$location", () => {
|
|
|
3440
3440
|
// return win;
|
|
3441
3441
|
// };
|
|
3442
3442
|
// $browserProvider.$get = function (
|
|
3443
|
-
//
|
|
3443
|
+
//
|
|
3444
3444
|
// $window,
|
|
3445
3445
|
// $log,
|
|
3446
3446
|
// $sniffer,
|
|
@@ -3449,7 +3449,7 @@ describe("$location", () => {
|
|
|
3449
3449
|
// /* global Browser: false */
|
|
3450
3450
|
// browser = new Browser(
|
|
3451
3451
|
// $window,
|
|
3452
|
-
//
|
|
3452
|
+
//
|
|
3453
3453
|
// $log,
|
|
3454
3454
|
// $sniffer,
|
|
3455
3455
|
// $$taskTrackerFactory,
|
|
@@ -5,8 +5,6 @@ import {
|
|
|
5
5
|
urlIsAllowedOriginFactory,
|
|
6
6
|
} from "./url-utils";
|
|
7
7
|
|
|
8
|
-
let $document = window.document;
|
|
9
|
-
|
|
10
8
|
describe("urlUtils", () => {
|
|
11
9
|
describe("urlResolve", () => {
|
|
12
10
|
it("should returned already parsed URLs unchanged", () => {
|
|
@@ -67,7 +65,7 @@ describe("urlUtils", () => {
|
|
|
67
65
|
|
|
68
66
|
expectIsSameOrigin("path", true);
|
|
69
67
|
|
|
70
|
-
const origin = urlResolve(
|
|
68
|
+
const origin = urlResolve(window.document.location.href);
|
|
71
69
|
expectIsSameOrigin(`//${origin.host}/path`, true);
|
|
72
70
|
|
|
73
71
|
// Different domain.
|
|
@@ -180,9 +180,8 @@ const NG_OPTIONS_REGEXP =
|
|
|
180
180
|
|
|
181
181
|
export const ngOptionsDirective = [
|
|
182
182
|
"$compile",
|
|
183
|
-
"$document",
|
|
184
183
|
"$parse",
|
|
185
|
-
function ($compile, $
|
|
184
|
+
function ($compile, $parse) {
|
|
186
185
|
function parseOptionsExpression(optionsExp, selectElement, scope) {
|
|
187
186
|
const match = optionsExp.match(NG_OPTIONS_REGEXP);
|
|
188
187
|
if (!match) {
|
|
@@ -404,7 +403,7 @@ export const ngOptionsDirective = [
|
|
|
404
403
|
// This stores the newly created options before they are appended to the select.
|
|
405
404
|
// Since the contents are removed from the fragment when it is appended,
|
|
406
405
|
// we only need to create it once.
|
|
407
|
-
const listFragment =
|
|
406
|
+
const listFragment = document.createDocumentFragment();
|
|
408
407
|
|
|
409
408
|
// Overwrite the implementation. ngOptions doesn't use hashes
|
|
410
409
|
selectCtrl.generateUnknownOptionValue = () => "?";
|
|
@@ -223,9 +223,8 @@ export function initMessageModule() {
|
|
|
223
223
|
|
|
224
224
|
.directive("ngMessagesInclude", [
|
|
225
225
|
"$templateRequest",
|
|
226
|
-
"$document",
|
|
227
226
|
"$compile",
|
|
228
|
-
function ($templateRequest, $
|
|
227
|
+
function ($templateRequest, $compile) {
|
|
229
228
|
return {
|
|
230
229
|
restrict: "AE",
|
|
231
230
|
require: "^^ngMessages", // we only require this for validation sake
|
package/src/loader.js
CHANGED
package/src/public.js
CHANGED
|
@@ -55,7 +55,6 @@ import { ngEventDirectives } from "./directive/events/events";
|
|
|
55
55
|
import { AnchorScrollProvider } from "./services/anchor-scroll";
|
|
56
56
|
import {
|
|
57
57
|
AnimateProvider,
|
|
58
|
-
CoreAnimateJsProvider,
|
|
59
58
|
CoreAnimateQueueProvider,
|
|
60
59
|
} from "./core/animate/animate";
|
|
61
60
|
import { BrowserProvider } from "./services/browser";
|
|
@@ -70,10 +69,6 @@ import {
|
|
|
70
69
|
TemplateCacheProvider,
|
|
71
70
|
} from "./services/cache-factory";
|
|
72
71
|
import { $ControllerProvider } from "./core/controller/controller";
|
|
73
|
-
import {
|
|
74
|
-
$DocumentProvider,
|
|
75
|
-
$$IsDocumentHiddenProvider,
|
|
76
|
-
} from "./services/document";
|
|
77
72
|
import { $ExceptionHandlerProvider } from "./core/exception-handler";
|
|
78
73
|
import { $FilterProvider } from "./core/filter/filter";
|
|
79
74
|
import { $IntervalProvider } from "./core/interval/interval";
|
|
@@ -177,14 +172,12 @@ export function publishExternalAPI() {
|
|
|
177
172
|
$anchorScroll: AnchorScrollProvider,
|
|
178
173
|
$animate: AnimateProvider,
|
|
179
174
|
$animateCss: CoreAnimateCssProvider,
|
|
180
|
-
$$animateJs: CoreAnimateJsProvider,
|
|
181
175
|
$$animateQueue: CoreAnimateQueueProvider,
|
|
182
176
|
$$AnimateRunner: AnimateRunnerFactoryProvider,
|
|
183
177
|
$$animateAsyncRun: AnimateAsyncRunFactoryProvider,
|
|
184
178
|
$browser: BrowserProvider,
|
|
185
179
|
$cacheFactory: CacheFactoryProvider,
|
|
186
180
|
$controller: $ControllerProvider,
|
|
187
|
-
$document: $DocumentProvider,
|
|
188
181
|
$exceptionHandler: $ExceptionHandlerProvider,
|
|
189
182
|
$filter: $FilterProvider,
|
|
190
183
|
$interpolate: $InterpolateProvider,
|
|
@@ -87,7 +87,7 @@ function initDefaultTypes() {
|
|
|
87
87
|
decode: valToString,
|
|
88
88
|
is: is(String),
|
|
89
89
|
pattern: /.*/,
|
|
90
|
-
|
|
90
|
+
|
|
91
91
|
equals: (a, b) => a == b, // allow coersion for null/undefined/""
|
|
92
92
|
};
|
|
93
93
|
return Object.assign({}, defaultTypeBase, def);
|
|
@@ -4,10 +4,12 @@ import { isInjectable } from "../../shared/predicates";
|
|
|
4
4
|
import { isDefined, isUndefined, isString } from "../../shared/utils";
|
|
5
5
|
import { services } from "../common/coreservices";
|
|
6
6
|
import { ParamType } from "./param-type";
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
const isShorthand = (cfg) =>
|
|
9
|
-
["value", "type", "squash", "array", "dynamic"].filter(
|
|
10
|
-
.
|
|
9
|
+
["value", "type", "squash", "array", "dynamic"].filter(
|
|
10
|
+
Object.prototype.hasOwnProperty.bind(cfg || {}),
|
|
11
|
+
).length === 0;
|
|
12
|
+
|
|
11
13
|
var DefType;
|
|
12
14
|
(function (DefType) {
|
|
13
15
|
DefType[(DefType["PATH"] = 0)] = "PATH";
|
|
@@ -15,6 +17,7 @@ var DefType;
|
|
|
15
17
|
DefType[(DefType["CONFIG"] = 2)] = "CONFIG";
|
|
16
18
|
})(DefType || (DefType = {}));
|
|
17
19
|
export { DefType };
|
|
20
|
+
|
|
18
21
|
function getParamDeclaration(paramName, location, state) {
|
|
19
22
|
const noReloadOnSearch =
|
|
20
23
|
(state.reloadOnSearch === false && location === DefType.SEARCH) ||
|
|
@@ -21,7 +21,6 @@ export let resolvePolicies = {
|
|
|
21
21
|
const whens = resolvePolicies.when;
|
|
22
22
|
const ALL_WHENS = [whens.EAGER, whens.LAZY];
|
|
23
23
|
const EAGER_WHENS = [whens.EAGER];
|
|
24
|
-
// tslint:disable-next-line:no-inferrable-types
|
|
25
24
|
export const NATIVE_INJECTOR_TOKEN = "Native Injector";
|
|
26
25
|
/**
|
|
27
26
|
* Encapsulates Dependency Injection for a path of nodes
|
|
@@ -431,15 +431,12 @@ describe("$state", () => {
|
|
|
431
431
|
$stateProvider.state(childNoParam);
|
|
432
432
|
|
|
433
433
|
$transitions.onEnter({}, function (trans, state) {
|
|
434
|
-
console.log("enter");
|
|
435
434
|
dynlog += "enter:" + state.name + ";";
|
|
436
435
|
});
|
|
437
436
|
$transitions.onExit({}, function (trans, state) {
|
|
438
|
-
console.log("exit");
|
|
439
437
|
dynlog += "exit:" + state.name + ";";
|
|
440
438
|
});
|
|
441
439
|
$transitions.onSuccess({}, function () {
|
|
442
|
-
console.log("success");
|
|
443
440
|
dynlog += "success;";
|
|
444
441
|
});
|
|
445
442
|
|
|
@@ -455,7 +455,6 @@ export class Transition {
|
|
|
455
455
|
redirect(targetState) {
|
|
456
456
|
let redirects = 1,
|
|
457
457
|
trans = this;
|
|
458
|
-
// tslint:disable-next-line:no-conditional-assignment
|
|
459
458
|
while ((trans = trans.redirectedFrom()) != null) {
|
|
460
459
|
if (++redirects > 20)
|
|
461
460
|
throw new Error(`Too many consecutive Transition redirects (20+)`);
|
|
@@ -249,7 +249,6 @@ export class UrlMatcher {
|
|
|
249
249
|
};
|
|
250
250
|
let details;
|
|
251
251
|
let segment;
|
|
252
|
-
// tslint:disable-next-line:no-conditional-assignment
|
|
253
252
|
while ((matchArray = placeholder.exec(pattern))) {
|
|
254
253
|
details = matchDetails(matchArray, false);
|
|
255
254
|
if (details.segment.indexOf("?") >= 0) break; // we're into the search part
|
|
@@ -269,7 +268,6 @@ export class UrlMatcher {
|
|
|
269
268
|
segment = segment.substring(0, i);
|
|
270
269
|
if (search.length > 0) {
|
|
271
270
|
last = 0;
|
|
272
|
-
// tslint:disable-next-line:no-conditional-assignment
|
|
273
271
|
while ((matchArray = searchPlaceholder.exec(search))) {
|
|
274
272
|
details = matchDetails(matchArray, true);
|
|
275
273
|
checkParamErrors(details.id);
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { isUndefined } from "../shared/utils";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @name $$cookieReader
|
|
5
|
-
* @requires $document
|
|
6
4
|
*
|
|
7
5
|
* @description
|
|
8
6
|
* This is a private service for reading cookies used by $http and ngCookies
|
|
9
7
|
*
|
|
10
8
|
* @return {Object} a key/value map of the current cookies
|
|
11
9
|
*/
|
|
12
|
-
export function $$CookieReader(
|
|
13
|
-
const rawDocument =
|
|
10
|
+
export function $$CookieReader() {
|
|
11
|
+
const rawDocument = window.document;
|
|
14
12
|
let lastCookies = {};
|
|
15
13
|
let lastCookieString = "";
|
|
16
14
|
|
|
@@ -64,8 +62,6 @@ export function $$CookieReader($document) {
|
|
|
64
62
|
};
|
|
65
63
|
}
|
|
66
64
|
|
|
67
|
-
$$CookieReader.$inject = ["$document"];
|
|
68
|
-
|
|
69
65
|
export function CookieReaderProvider() {
|
|
70
66
|
this.$get = $$CookieReader;
|
|
71
67
|
}
|
package/src/shared/common.js
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Random utility functions used in the ng-router code
|
|
3
|
-
*
|
|
4
|
-
* These functions are exported, but are subject to change without notice.
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
1
|
import { isDate, isFunction, isRegExp, isString } from "./utils";
|
|
8
2
|
import { all, any, prop, curry, not } from "./hof";
|
|
9
3
|
import { services } from "../router/common/coreservices";
|
|
10
|
-
export const root =
|
|
11
|
-
(typeof self === "object" && self.self === self && self) ||
|
|
12
|
-
(typeof global === "object" && global.global === global && global) ||
|
|
13
|
-
this;
|
|
14
4
|
export const fromJson = JSON.parse.bind(JSON);
|
|
15
5
|
export const toJson = JSON.stringify.bind(JSON);
|
|
16
6
|
export const forEach = _forEach;
|
|
@@ -158,7 +148,6 @@ export const mergeR = (memo, item) => Object.assign(memo, item);
|
|
|
158
148
|
*/
|
|
159
149
|
export function ancestors(first, second) {
|
|
160
150
|
const path = [];
|
|
161
|
-
// tslint:disable-next-line:forin
|
|
162
151
|
for (const n in first.path) {
|
|
163
152
|
if (first.path[n] !== second.path[n]) break;
|
|
164
153
|
path.push(first.path[n]);
|
|
@@ -476,7 +465,7 @@ function _equals(o1, o2) {
|
|
|
476
465
|
if (predicates.map(any).reduce((b, fn) => b || !!fn(tup), false))
|
|
477
466
|
return false;
|
|
478
467
|
const keys = {};
|
|
479
|
-
|
|
468
|
+
|
|
480
469
|
for (const key in o1) {
|
|
481
470
|
if (!_equals(o1[key], o2[key])) return false;
|
|
482
471
|
keys[key] = true;
|
package/src/shared/hof.js
CHANGED
|
@@ -133,7 +133,6 @@ export function or(fn1, fn2) {
|
|
|
133
133
|
* @returns a function which takes an array and returns true if `fn1` is true for all elements of the array
|
|
134
134
|
*/
|
|
135
135
|
export const all = (fn1) => (arr) => arr.reduce((b, x) => b && !!fn1(x), true);
|
|
136
|
-
// tslint:disable-next-line:variable-name
|
|
137
136
|
export const any = (fn1) => (arr) => arr.reduce((b, x) => b || !!fn1(x), false);
|
|
138
137
|
/** Given a class, returns a Predicate function that returns true if the object is of that class */
|
|
139
138
|
export const is = (ctor) => (obj) =>
|
package/src/shared/utils.js
CHANGED
|
@@ -69,10 +69,6 @@ export function isArrayLike(obj) {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
|
-
* @module angular
|
|
73
|
-
* @function isUndefined
|
|
74
|
-
*
|
|
75
|
-
* @description
|
|
76
72
|
* Determines if a reference is undefined.
|
|
77
73
|
*
|
|
78
74
|
* @param {*} value Reference to check.
|
|
@@ -83,10 +79,6 @@ export function isUndefined(value) {
|
|
|
83
79
|
}
|
|
84
80
|
|
|
85
81
|
/**
|
|
86
|
-
* @module angular
|
|
87
|
-
* @function isDefined
|
|
88
|
-
*
|
|
89
|
-
* @description
|
|
90
82
|
* Determines if a reference is defined.
|
|
91
83
|
*
|
|
92
84
|
* @param {*} value Reference to check.
|
|
@@ -97,10 +89,6 @@ export function isDefined(value) {
|
|
|
97
89
|
}
|
|
98
90
|
|
|
99
91
|
/**
|
|
100
|
-
* @module angular
|
|
101
|
-
* @function isObject
|
|
102
|
-
*
|
|
103
|
-
* @description
|
|
104
92
|
* Determines if a reference is an `Object`. Unlike `typeof` in JavaScript, `null`s are not
|
|
105
93
|
* considered to be objects. Note that JavaScript arrays are objects.
|
|
106
94
|
*
|
|
@@ -113,7 +101,7 @@ export function isObject(value) {
|
|
|
113
101
|
}
|
|
114
102
|
|
|
115
103
|
/**
|
|
116
|
-
*
|
|
104
|
+
* Determines if a value is an object with a null prototype
|
|
117
105
|
*
|
|
118
106
|
* @returns {boolean} True if `value` is an `Object` with a null prototype
|
|
119
107
|
*/
|
|
@@ -124,10 +112,6 @@ export function isBlankObject(value) {
|
|
|
124
112
|
}
|
|
125
113
|
|
|
126
114
|
/**
|
|
127
|
-
* @module angular
|
|
128
|
-
* @function isString
|
|
129
|
-
*
|
|
130
|
-
* @description
|
|
131
115
|
* Determines if a reference is a `String`.
|
|
132
116
|
*
|
|
133
117
|
* @param {*} value Reference to check.
|
|
@@ -138,10 +122,6 @@ export function isString(value) {
|
|
|
138
122
|
}
|
|
139
123
|
|
|
140
124
|
/**
|
|
141
|
-
* @module angular
|
|
142
|
-
* @function isNumber
|
|
143
|
-
*
|
|
144
|
-
* @description
|
|
145
125
|
* Determines if a reference is a `Number`.
|
|
146
126
|
*
|
|
147
127
|
* This includes the "special" numbers `NaN`, `+Infinity` and `-Infinity`.
|
|
@@ -172,7 +152,6 @@ export function isDate(value) {
|
|
|
172
152
|
}
|
|
173
153
|
|
|
174
154
|
/**
|
|
175
|
-
* @description
|
|
176
155
|
* Determines if a reference is an `Error`.
|
|
177
156
|
* Loosely based on https://www.npmjs.com/package/iserror
|
|
178
157
|
*
|
|
@@ -194,12 +173,6 @@ export function isError(value) {
|
|
|
194
173
|
}
|
|
195
174
|
|
|
196
175
|
/**
|
|
197
|
-
* @module angular
|
|
198
|
-
* @function isFunction
|
|
199
|
-
|
|
200
|
-
* @function
|
|
201
|
-
*
|
|
202
|
-
* @description
|
|
203
176
|
* Determines if a reference is a `Function`.
|
|
204
177
|
*
|
|
205
178
|
* @param {*} value Reference to check.
|
|
@@ -318,10 +291,6 @@ export function snakeCase(name, separator) {
|
|
|
318
291
|
}
|
|
319
292
|
|
|
320
293
|
/**
|
|
321
|
-
* @module angular
|
|
322
|
-
* @function forEach
|
|
323
|
-
*
|
|
324
|
-
* @description
|
|
325
294
|
* Invokes the `iterator` function once for each item in `obj` collection, which can be either an
|
|
326
295
|
* object or an array. The `iterator` function is invoked with `iterator(value, key, obj)`, where `value`
|
|
327
296
|
* is the value of an object property or an array element, `key` is the object property key or
|
|
@@ -455,12 +424,6 @@ export function baseExtend(dst, objs, deep) {
|
|
|
455
424
|
}
|
|
456
425
|
|
|
457
426
|
/**
|
|
458
|
-
* @module angular
|
|
459
|
-
* @function extend
|
|
460
|
-
|
|
461
|
-
* @function
|
|
462
|
-
*
|
|
463
|
-
* @description
|
|
464
427
|
* Extends the destination object `dst` by copying own enumerable properties from the `src` object(s)
|
|
465
428
|
* to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so
|
|
466
429
|
* by passing an empty object as the target: `let object = angular.extend({}, object1, object2)`.
|
|
@@ -477,12 +440,6 @@ export function extend(dst, ...src) {
|
|
|
477
440
|
}
|
|
478
441
|
|
|
479
442
|
/**
|
|
480
|
-
* @module angular
|
|
481
|
-
* @function merge
|
|
482
|
-
|
|
483
|
-
* @function
|
|
484
|
-
*
|
|
485
|
-
* @description
|
|
486
443
|
* Deeply extends the destination object `dst` by copying own enumerable properties from the `src` object(s)
|
|
487
444
|
* to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so
|
|
488
445
|
* by passing an empty object as the target: `let object = angular.merge({}, object1, object2)`.
|
|
@@ -540,29 +497,6 @@ export function inherit(parent, extra) {
|
|
|
540
497
|
}
|
|
541
498
|
|
|
542
499
|
/**
|
|
543
|
-
* @module angular
|
|
544
|
-
* @function identity
|
|
545
|
-
|
|
546
|
-
* @function
|
|
547
|
-
*
|
|
548
|
-
* @description
|
|
549
|
-
* A function that returns its first argument. This function is useful when writing code in the
|
|
550
|
-
* functional style.
|
|
551
|
-
*
|
|
552
|
-
```js
|
|
553
|
-
function transformer(transformationFn, value) {
|
|
554
|
-
return (transformationFn || angular.identity)(value);
|
|
555
|
-
};
|
|
556
|
-
|
|
557
|
-
// E.g.
|
|
558
|
-
function getResult(fn, input) {
|
|
559
|
-
return (fn || angular.identity)(input);
|
|
560
|
-
};
|
|
561
|
-
|
|
562
|
-
getResult(function(n) { return n * 2; }, 21); // returns 42
|
|
563
|
-
getResult(null, 21); // returns 21
|
|
564
|
-
getResult(undefined, 21); // returns 21
|
|
565
|
-
```
|
|
566
500
|
*
|
|
567
501
|
* @param {*} value to be returned.
|
|
568
502
|
* @returns {*} the value passed in.
|
|
@@ -645,12 +579,6 @@ export function simpleCompare(a, b) {
|
|
|
645
579
|
}
|
|
646
580
|
|
|
647
581
|
/**
|
|
648
|
-
* @module angular
|
|
649
|
-
* @function equals
|
|
650
|
-
|
|
651
|
-
* @function
|
|
652
|
-
*
|
|
653
|
-
* @description
|
|
654
582
|
* Determines if two objects or two values are equivalent. Supports value types, regular
|
|
655
583
|
* expressions, arrays and objects.
|
|
656
584
|
*
|
|
@@ -883,12 +811,6 @@ export function sliceArgs(args, startIndex) {
|
|
|
883
811
|
}
|
|
884
812
|
|
|
885
813
|
/**
|
|
886
|
-
* @module angular
|
|
887
|
-
* @function bind
|
|
888
|
-
|
|
889
|
-
* @function
|
|
890
|
-
*
|
|
891
|
-
* @description
|
|
892
814
|
* Returns a function which calls function `fn` bound to `self` (`self` becomes the `this` for
|
|
893
815
|
* `fn`). You can supply optional `args` that are prebound to the function. This feature is also
|
|
894
816
|
* known as [partial application](http://en.wikipedia.org/wiki/Partial_application), as
|
|
@@ -938,10 +860,6 @@ function toJsonReplacer(key, value) {
|
|
|
938
860
|
}
|
|
939
861
|
|
|
940
862
|
/**
|
|
941
|
-
* @module angular
|
|
942
|
-
* @function toJson
|
|
943
|
-
*
|
|
944
|
-
* @description
|
|
945
863
|
* Serializes input into a JSON-formatted string. Properties with leading $$ characters will be
|
|
946
864
|
* stripped since AngularJS uses this notation internally.
|
|
947
865
|
*
|
|
@@ -980,10 +898,6 @@ export function toJson(obj, pretty) {
|
|
|
980
898
|
}
|
|
981
899
|
|
|
982
900
|
/**
|
|
983
|
-
* @module angular
|
|
984
|
-
* @function fromJson
|
|
985
|
-
*
|
|
986
|
-
* @description
|
|
987
901
|
* Deserializes a JSON string.
|
|
988
902
|
*
|
|
989
903
|
* @param {string} json JSON string to deserialize.
|
|
@@ -1199,8 +1113,6 @@ export function assertArgFn(arg, name, acceptArrayAnnotation) {
|
|
|
1199
1113
|
export const minErrConfig = {};
|
|
1200
1114
|
|
|
1201
1115
|
/**
|
|
1202
|
-
* @description
|
|
1203
|
-
*
|
|
1204
1116
|
* This object provides a utility for producing rich Error messages within
|
|
1205
1117
|
* AngularJS. It can be called as follows:
|
|
1206
1118
|
*
|