From 4b81672e12e8f50798da12382c6d679b81299f3d Mon Sep 17 00:00:00 2001 From: Marcus Williams Date: Fri, 22 Jun 2018 09:09:53 +0100 Subject: [PATCH] Update to Angular 6 RXJS 6 --- .angular-cli.json | 91 - angular.json | 253 + karma.conf.js | 10 +- package.json | 41 +- src/app/browse/browse-breadcrumbs.resolver.ts | 31 +- src/app/browse/browse.component.ts | 18 +- src/app/browse/browse.service.ts | 39 +- src/app/person/edit/person-edit.component.ts | 4 +- src/app/person/list/person-list.component.ts | 2 +- src/app/person/person.service.ts | 26 +- src/lib/mc-breadcrumbs/index.ts | 6 +- src/lib/mc-breadcrumbs/ng-package.json | 1 + .../lodash._reinterpolate/LICENSE.txt | 22 + .../lodash._reinterpolate/README.md | 20 + .../lodash._reinterpolate/index.js | 13 + .../lodash._reinterpolate/package.json | 76 + .../node_modules/lodash.template/LICENSE | 47 + .../node_modules/lodash.template/README.md | 18 + .../node_modules/lodash.template/index.js | 1132 ++++ .../node_modules/lodash.template/package.json | 73 + .../lodash.templatesettings/LICENSE | 47 + .../lodash.templatesettings/README.md | 18 + .../lodash.templatesettings/index.js | 280 + .../lodash.templatesettings/package.json | 72 + src/lib/mc-breadcrumbs/package-lock.json | 30 + src/lib/mc-breadcrumbs/package.json | 10 +- .../src/component/mc-breadcrumbs.component.ts | 12 +- .../src/mc-breadcrumbs.module.ts | 15 +- .../src/mc-breadcrumbs.shared.ts | 44 +- .../src/service/mc-breadcrumbs.config.ts | 11 +- .../src/service/mc-breadcrumbs.resolver.ts | 47 +- .../src/service/mc-breadcrumbs.service.ts | 92 +- src/tsconfig.spec.json | 3 +- tslint.json | 3 +- yarn.lock | 4990 ++++++++++------- 35 files changed, 5301 insertions(+), 2296 deletions(-) delete mode 100644 .angular-cli.json create mode 100644 angular.json create mode 100644 src/lib/mc-breadcrumbs/node_modules/lodash._reinterpolate/LICENSE.txt create mode 100644 src/lib/mc-breadcrumbs/node_modules/lodash._reinterpolate/README.md create mode 100644 src/lib/mc-breadcrumbs/node_modules/lodash._reinterpolate/index.js create mode 100644 src/lib/mc-breadcrumbs/node_modules/lodash._reinterpolate/package.json create mode 100644 src/lib/mc-breadcrumbs/node_modules/lodash.template/LICENSE create mode 100644 src/lib/mc-breadcrumbs/node_modules/lodash.template/README.md create mode 100644 src/lib/mc-breadcrumbs/node_modules/lodash.template/index.js create mode 100644 src/lib/mc-breadcrumbs/node_modules/lodash.template/package.json create mode 100644 src/lib/mc-breadcrumbs/node_modules/lodash.templatesettings/LICENSE create mode 100644 src/lib/mc-breadcrumbs/node_modules/lodash.templatesettings/README.md create mode 100644 src/lib/mc-breadcrumbs/node_modules/lodash.templatesettings/index.js create mode 100644 src/lib/mc-breadcrumbs/node_modules/lodash.templatesettings/package.json create mode 100644 src/lib/mc-breadcrumbs/package-lock.json diff --git a/.angular-cli.json b/.angular-cli.json deleted file mode 100644 index ec0de1a..0000000 --- a/.angular-cli.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "$schema": "./node_modules/@angular/cli/lib/config/schema.json", - "project": { - "name": "ngx-breadcrumbs" - }, - "apps": [ - { - "name": "app", - "root": "src", - "outDir": "dist", - "assets": [ - "assets", - "favicon.ico" - ], - "index": "index.html", - "main": "main.ts", - "polyfills": "polyfills.ts", - "test": "test.ts", - "tsconfig": "tsconfig.app.json", - "testTsconfig": "tsconfig.spec.json", - "prefix": "app", - "styles": [ - "../node_modules/bootstrap/dist/css/bootstrap.min.css", - "styles.css" - ], - "scripts": [], - "environmentSource": "environments/environment.ts", - "environments": { - "dev": "environments/environment.ts", - "prod": "environments/environment.prod.ts" - } - }, - { - "name": "integration", - "root": "src", - "outDir": "dist", - "assets": [ - "assets", - "favicon.ico" - ], - "index": "index.html", - "main": "main.ts", - "polyfills": "polyfills.ts", - "test": "test.ts", - "tsconfig": "tsconfig.integration.json", - "testTsconfig": "tsconfig.spec.json", - "prefix": "app", - "styles": [ - "../node_modules/bootstrap/dist/css/bootstrap.min.css", - "styles.css" - ], - "scripts": [], - "environmentSource": "environments/environment.ts", - "environments": { - "dev": "environments/environment.ts", - "prod": "environments/environment.prod.ts" - } - } - ], - "e2e": { - "protractor": { - "config": "./protractor.conf.js" - } - }, - "lint": [ - { - "project": "src/tsconfig.app.json", - "exclude": "**/node_modules/**" - }, - { - "project": "src/tsconfig.spec.json", - "exclude": "**/node_modules/**" - }, - { - "project": "e2e/tsconfig.e2e.json", - "exclude": "**/node_modules/**" - } - ], - "test": { - "karma": { - "config": "./karma.conf.js" - } - }, - "defaults": { - "styleExt": "css", - "component": {}, - "serve": { - "port": 4288 - } - } -} diff --git a/angular.json b/angular.json new file mode 100644 index 0000000..ecef48e --- /dev/null +++ b/angular.json @@ -0,0 +1,253 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "version": 1, + "newProjectRoot": "projects", + "projects": { + "app": { + "root": "", + "sourceRoot": "src", + "projectType": "application", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:browser", + "options": { + "outputPath": "dist", + "index": "src/index.html", + "main": "src/main.ts", + "tsConfig": "src/tsconfig.app.json", + "polyfills": "src/polyfills.ts", + "assets": [ + "src/assets", + "src/favicon.ico" + ], + "styles": [ + "node_modules/bootstrap/dist/css/bootstrap.min.css", + "src/styles.css" + ], + "scripts": [] + }, + "configurations": { + "production": { + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "extractCss": true, + "namedChunks": false, + "aot": true, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": true, + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.ts" + } + ] + } + } + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "options": { + "browserTarget": "app:build", + "port": 4288 + }, + "configurations": { + "production": { + "browserTarget": "app:build:production" + } + } + }, + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n", + "options": { + "browserTarget": "app:build" + } + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "main": "src/test.ts", + "karmaConfig": "./karma.conf.js", + "polyfills": "src/polyfills.ts", + "tsConfig": "src/tsconfig.spec.json", + "scripts": [], + "styles": [ + "node_modules/bootstrap/dist/css/bootstrap.min.css", + "src/styles.css" + ], + "assets": [ + "src/assets", + "src/favicon.ico" + ] + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "src/tsconfig.app.json", + "src/tsconfig.spec.json" + ], + "exclude": [ + "**/node_modules/**" + ] + } + } + } + }, + "app-e2e": { + "root": "", + "sourceRoot": "e2e", + "projectType": "application", + "architect": { + "e2e": { + "builder": "@angular-devkit/build-angular:protractor", + "options": { + "protractorConfig": "./protractor.conf.js", + "devServerTarget": "app:serve" + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "e2e/tsconfig.e2e.json" + ], + "exclude": [ + "**/node_modules/**" + ] + } + } + } + }, + "integration": { + "root": "", + "sourceRoot": "src", + "projectType": "application", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:browser", + "options": { + "outputPath": "dist", + "index": "src/index.html", + "main": "src/main.ts", + "tsConfig": "src/tsconfig.integration.json", + "polyfills": "src/polyfills.ts", + "assets": [ + "src/assets", + "src/favicon.ico" + ], + "styles": [ + "node_modules/bootstrap/dist/css/bootstrap.min.css", + "src/styles.css" + ], + "scripts": [] + }, + "configurations": { + "production": { + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "extractCss": true, + "namedChunks": false, + "aot": true, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": true, + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.ts" + } + ] + } + } + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "options": { + "browserTarget": "integration:build", + "port": 4288 + }, + "configurations": { + "production": { + "browserTarget": "integration:build:production" + } + } + }, + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n", + "options": { + "browserTarget": "integration:build" + } + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "main": "src/test.ts", + "karmaConfig": "./karma.conf.js", + "polyfills": "src/polyfills.ts", + "tsConfig": "src/tsconfig.spec.json", + "scripts": [], + "styles": [ + "node_modules/bootstrap/dist/css/bootstrap.min.css", + "src/styles.css" + ], + "assets": [ + "src/assets", + "src/favicon.ico" + ] + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "src/tsconfig.app.json", + "src/tsconfig.spec.json" + ], + "exclude": [ + "**/node_modules/**" + ] + } + } + } + }, + "integration-e2e": { + "root": "", + "sourceRoot": "e2e", + "projectType": "application", + "architect": { + "e2e": { + "builder": "@angular-devkit/build-angular:protractor", + "options": { + "protractorConfig": "./protractor.conf.js", + "devServerTarget": "integration:serve" + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "e2e/tsconfig.e2e.json" + ], + "exclude": [ + "**/node_modules/**" + ] + } + } + } + } + }, + "defaultProject": "app", + "schematics": { + "@schematics/angular:component": { + "prefix": "app", + "styleext": "css" + }, + "@schematics/angular:directive": { + "prefix": "app" + } + } +} \ No newline at end of file diff --git a/karma.conf.js b/karma.conf.js index af139fa..0840f6c 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -4,24 +4,22 @@ module.exports = function (config) { config.set({ basePath: '', - frameworks: ['jasmine', '@angular/cli'], + frameworks: ['jasmine', '@angular-devkit/build-angular'], plugins: [ require('karma-jasmine'), require('karma-chrome-launcher'), require('karma-jasmine-html-reporter'), require('karma-coverage-istanbul-reporter'), - require('@angular/cli/plugins/karma') + require('@angular-devkit/build-angular/plugins/karma') ], client:{ clearContext: false // leave Jasmine Spec Runner output visible in browser }, coverageIstanbulReporter: { - reports: [ 'html', 'lcovonly' ], + dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ], fixWebpackSourcePaths: true }, - angularCli: { - environment: 'dev' - }, + reporters: ['progress', 'kjhtml'], port: 9876, colors: true, diff --git a/package.json b/package.json index cef27ef..19c2888 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ngx-breadcrumbs", "license": "MIT", - "version": "0.0.3", + "version": "0.0.4", "description": "Angular 4+ routing breadcrumbs", "author": { "name": "(null) McNull", @@ -24,35 +24,36 @@ "build": "ng build", "build:pkg": "rimraf ./build && ng-packagr -p src/lib/mc-breadcrumbs/ng-package.json && cp {README.md,LICENSE} build/ngx-breadcrumbs", "link:pkg": "./link.sh", - "build:integration": "npm run build:pkg && npm run link:pkg && ng build --aot --app integration", + "build:integration": "npm run build:pkg && npm run link:pkg && ng build --prod", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { - "@angular/animations": "^4.2.4", - "@angular/common": "^4.2.4", - "@angular/compiler": "^4.2.4", - "@angular/core": "^4.2.4", - "@angular/forms": "^4.2.4", - "@angular/http": "^4.2.4", - "@angular/platform-browser": "^4.2.4", - "@angular/platform-browser-dynamic": "^4.2.4", - "@angular/router": "^4.3.6", - "bootstrap": "4.0.0-beta", + "@angular/animations": "^6.0.6", + "@angular/common": "^6.0.6", + "@angular/compiler": "^6.0.6", + "@angular/core": "^6.0.6", + "@angular/forms": "^6.0.6", + "@angular/http": "^6.0.6", + "@angular/platform-browser": "^6.0.6", + "@angular/platform-browser-dynamic": "^6.0.6", + "@angular/router": "^6.0.6", + "bootstrap": "^4.1.1", "core-js": "^2.4.1", - "rxjs": "^5.4.2", - "zone.js": "^0.8.14" + "rxjs": "^6.2.1", + "zone.js": "^0.8.26" }, "devDependencies": { - "@angular/cli": "1.3.2", - "@angular/compiler-cli": "^4.2.4", - "@angular/language-service": "^4.2.4", + "@angular-devkit/build-angular": "~0.6.8", + "@angular/cli": "^6.0.8", + "@angular/compiler-cli": "^6.0.6", + "@angular/language-service": "^6.0.6", "@types/jasmine": "~2.5.53", "@types/jasminewd2": "~2.0.2", "@types/node": "~6.0.60", - "codelyzer": "~3.1.1", + "codelyzer": "^4.3.0", "jasmine-core": "~2.6.2", "jasmine-spec-reporter": "~4.1.0", "karma": "~1.7.0", @@ -61,10 +62,10 @@ "karma-coverage-istanbul-reporter": "^1.2.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", - "ng-packagr": "^1.0.0-pre.16", + "ng-packagr": "^3.0.3", "protractor": "~5.1.2", "ts-node": "~3.2.0", "tslint": "~5.3.2", - "typescript": "~2.3.3" + "typescript": "~2.7.2" } } diff --git a/src/app/browse/browse-breadcrumbs.resolver.ts b/src/app/browse/browse-breadcrumbs.resolver.ts index 80c7926..742c4e8 100644 --- a/src/app/browse/browse-breadcrumbs.resolver.ts +++ b/src/app/browse/browse-breadcrumbs.resolver.ts @@ -1,26 +1,33 @@ import { Injectable } from '@angular/core'; -import { Observable } from 'rxjs/Observable'; +import { Observable } from 'rxjs'; import { BrowseService } from './browse.service'; -import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router'; +import { + ActivatedRouteSnapshot, + Resolve, + RouterStateSnapshot +} from '@angular/router'; import { IBreadcrumb, McBreadcrumbsResolver } from 'ngx-breadcrumbs'; +import { map } from 'rxjs/operators'; @Injectable() export class BrowseBreadcrumbsResolver extends McBreadcrumbsResolver { - constructor(private service: BrowseService) { super(); } - resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { - + resolve( + route: ActivatedRouteSnapshot, + state: RouterStateSnapshot + ): Observable { const id = route.params.id; - return this.service.getPath(id) - .map((folders) => - folders.map((folder) => ({ - text: folder.name, - path: super.getFullPath(route.parent) + '/' + folder.id - }) - )); + return this.service.getPath(id).pipe( + map(folders => + folders.map(folder => ({ + text: folder.name, + path: super.getFullPath(route.parent) + '/' + folder.id + })) + ) + ); } } diff --git a/src/app/browse/browse.component.ts b/src/app/browse/browse.component.ts index 5161da0..9d28aec 100644 --- a/src/app/browse/browse.component.ts +++ b/src/app/browse/browse.component.ts @@ -1,15 +1,10 @@ -import { Subscription } from 'rxjs/Rx'; import { ActivatedRoute, Router } from '@angular/router'; -import { BehaviorSubject } from 'rxjs/BehaviorSubject'; -import { Observable } from 'rxjs/Observable'; +import { Observable, Subscription } from 'rxjs'; import { Component, Injectable, OnDestroy } from '@angular/core'; import { utils } from '../shared/utils'; import { BrowseService, IFolder } from './browse.service'; -import 'rxjs/add/operator/filter'; -import 'rxjs/add/operator/map'; -import 'rxjs/add/operator/do'; -import { BrowseBreadcrumbsResolver } from "./browse-breadcrumbs.resolver"; +import { BrowseBreadcrumbsResolver } from './browse-breadcrumbs.resolver'; //////////////////////////////////////////////////////////////////// @@ -17,13 +12,11 @@ import { BrowseBreadcrumbsResolver } from "./browse-breadcrumbs.resolver"; templateUrl: './browse.component.html' }) export class BrowseComponent implements OnDestroy { - folders: Observable; subscriptions = new Array(); constructor(private service: BrowseService, route: ActivatedRoute) { - - const s = route.params.subscribe((x) => { + const s = route.params.subscribe(x => { const parentId = x.id || null; this.folders = this.service.getChilds(parentId); }); @@ -32,9 +25,6 @@ export class BrowseComponent implements OnDestroy { } public ngOnDestroy(): void { - this.subscriptions.forEach((x) => x.unsubscribe()); + this.subscriptions.forEach(x => x.unsubscribe()); } } - - - diff --git a/src/app/browse/browse.service.ts b/src/app/browse/browse.service.ts index cc4e35a..9badaae 100644 --- a/src/app/browse/browse.service.ts +++ b/src/app/browse/browse.service.ts @@ -1,15 +1,10 @@ import { Injectable } from '@angular/core'; -import { BehaviorSubject } from "rxjs/BehaviorSubject"; -import { utils } from "../shared/utils"; -import { Observable } from "rxjs/Observable"; -import { Observer } from "rxjs/Observer"; - -import 'rxjs/add/operator/expand'; -import 'rxjs/add/operator/takeWhile'; +import { BehaviorSubject, Observable, Observer } from 'rxjs'; +import { utils } from '../shared/utils'; +import { map, expand, takeWhile, toArray } from 'rxjs/operators'; @Injectable() export class BrowseService { - private folders = new BehaviorSubject([]); constructor() { @@ -17,28 +12,31 @@ export class BrowseService { } get(id: string): Observable { - return this.folders.map(x => x.find(y => y.id === id)); + return this.folders.pipe(map(x => x.find(y => y.id === id))); } getChilds(parentId: string): Observable { - return this.folders.map((x) => { - return x.filter((y) => y.parentId === parentId); - }); + return this.folders.pipe( + map(x => { + return x.filter(y => y.parentId === parentId); + }) + ); } getPath(leafId: string): Observable { - return this.get(leafId) - .expand(x => this.get(x.parentId)) - .takeWhile(x => !!x) - .toArray() - .map(x => x.reverse()); + return this.get(leafId).pipe( + expand(x => this.get(x.parentId)), + takeWhile(x => !!x), + toArray(), + map(x => x.reverse()) + ); } } export interface IFolder { - id: string, - parentId: string, - name: string + id: string; + parentId: string; + name: string; } const folders: Array = []; @@ -64,4 +62,3 @@ function createFolders(parentId: string, level: number) { } createFolders(null, levels); - diff --git a/src/app/person/edit/person-edit.component.ts b/src/app/person/edit/person-edit.component.ts index d26e6c3..2efcef2 100644 --- a/src/app/person/edit/person-edit.component.ts +++ b/src/app/person/edit/person-edit.component.ts @@ -3,8 +3,8 @@ import { PersonService } from '../person.service'; import { ActivatedRoute, ActivatedRouteSnapshot, Resolve, Router, RouterStateSnapshot } from '@angular/router'; import { Component, Injectable, OnDestroy, OnInit } from '@angular/core'; -import 'rxjs/add/operator/first'; -import { Observable } from "rxjs/Observable"; + +import { Observable } from "rxjs"; @Component({ templateUrl: './person-edit.component.html', diff --git a/src/app/person/list/person-list.component.ts b/src/app/person/list/person-list.component.ts index d5f9d01..888d8f8 100644 --- a/src/app/person/list/person-list.component.ts +++ b/src/app/person/list/person-list.component.ts @@ -1,4 +1,4 @@ -import { Observable } from 'rxjs/Observable'; +import { Observable } from 'rxjs'; import { PersonService } from '../person.service'; import { Component, OnInit } from '@angular/core'; import { IPerson } from "../person.model"; diff --git a/src/app/person/person.service.ts b/src/app/person/person.service.ts index 9a76848..8b8bf15 100644 --- a/src/app/person/person.service.ts +++ b/src/app/person/person.service.ts @@ -1,16 +1,13 @@ import { ActivatedRouteSnapshot } from '@angular/router'; -import { Observable } from 'rxjs/Observable'; -import { BehaviorSubject } from 'rxjs/BehaviorSubject'; +import { Observable, BehaviorSubject } from 'rxjs'; import { IPerson } from './person.model'; import { Injectable } from '@angular/core'; -import { utils } from "../shared/utils"; - -import 'rxjs/add/operator/delay'; -import 'rxjs/add/operator/toPromise'; +import { utils } from '../shared/utils'; +import { map, first } from 'rxjs/operators'; @Injectable() export class PersonService { - constructor() { } + constructor() {} private persons = new BehaviorSubject(persons); @@ -20,21 +17,22 @@ export class PersonService { get(id: string): Promise { return this.persons - .map(x => x.find(y => y.id === id)) - .first() + .pipe( + map(x => x.find(y => y.id === id)), + first() + ) .toPromise(); } - save(person: IPerson) : Promise { - - return new Promise((resolve) => { - let persons = [... this.persons.getValue()]; + save(person: IPerson): Promise { + return new Promise(resolve => { + let persons = [...this.persons.getValue()]; if (!person.id) { person.id = utils.guid(); persons.push(person); } else { - let idx = persons.findIndex((x) => x.id === person.id); + let idx = persons.findIndex(x => x.id === person.id); persons.splice(idx, 1, person); } diff --git a/src/lib/mc-breadcrumbs/index.ts b/src/lib/mc-breadcrumbs/index.ts index 6a9130a..e129b88 100644 --- a/src/lib/mc-breadcrumbs/index.ts +++ b/src/lib/mc-breadcrumbs/index.ts @@ -1,6 +1,8 @@ -export { McBreadcrumbsComponent } from './src/component/mc-breadcrumbs.component' +export { + McBreadcrumbsComponent +} from './src/component/mc-breadcrumbs.component'; export { McBreadcrumbsService } from './src/service/mc-breadcrumbs.service'; export { McBreadcrumbsConfig } from './src/service/mc-breadcrumbs.config'; export { IBreadcrumb } from './src/mc-breadcrumbs.shared'; -export { McBreadcrumbsResolver } from './src/service/mc-breadcrumbs.resolver' +export { McBreadcrumbsResolver } from './src/service/mc-breadcrumbs.resolver'; export { McBreadcrumbsModule } from './src/mc-breadcrumbs.module'; diff --git a/src/lib/mc-breadcrumbs/ng-package.json b/src/lib/mc-breadcrumbs/ng-package.json index b8d9e4a..b58eea2 100644 --- a/src/lib/mc-breadcrumbs/ng-package.json +++ b/src/lib/mc-breadcrumbs/ng-package.json @@ -1,6 +1,7 @@ { "$schema": "../../../node_modules/ng-packagr/ng-package.schema.json", "dest": "../../../build/ngx-breadcrumbs", + "whitelistedNonPeerDependencies": ["."], "lib": { "externals": { "lodash.template": "lodash.template", diff --git a/src/lib/mc-breadcrumbs/node_modules/lodash._reinterpolate/LICENSE.txt b/src/lib/mc-breadcrumbs/node_modules/lodash._reinterpolate/LICENSE.txt new file mode 100644 index 0000000..1776432 --- /dev/null +++ b/src/lib/mc-breadcrumbs/node_modules/lodash._reinterpolate/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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/src/lib/mc-breadcrumbs/node_modules/lodash._reinterpolate/README.md b/src/lib/mc-breadcrumbs/node_modules/lodash._reinterpolate/README.md new file mode 100644 index 0000000..1423e50 --- /dev/null +++ b/src/lib/mc-breadcrumbs/node_modules/lodash._reinterpolate/README.md @@ -0,0 +1,20 @@ +# lodash._reinterpolate v3.0.0 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `reInterpolate` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._reinterpolate +``` + +In Node.js/io.js: + +```js +var reInterpolate = require('lodash._reinterpolate'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash._reinterpolate) for more details. diff --git a/src/lib/mc-breadcrumbs/node_modules/lodash._reinterpolate/index.js b/src/lib/mc-breadcrumbs/node_modules/lodash._reinterpolate/index.js new file mode 100644 index 0000000..5c06abc --- /dev/null +++ b/src/lib/mc-breadcrumbs/node_modules/lodash._reinterpolate/index.js @@ -0,0 +1,13 @@ +/** + * lodash 3.0.0 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.7.0 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** Used to match template delimiters. */ +var reInterpolate = /<%=([\s\S]+?)%>/g; + +module.exports = reInterpolate; diff --git a/src/lib/mc-breadcrumbs/node_modules/lodash._reinterpolate/package.json b/src/lib/mc-breadcrumbs/node_modules/lodash._reinterpolate/package.json new file mode 100644 index 0000000..8b1fd03 --- /dev/null +++ b/src/lib/mc-breadcrumbs/node_modules/lodash._reinterpolate/package.json @@ -0,0 +1,76 @@ +{ + "_from": "lodash._reinterpolate@~3.0.0", + "_id": "lodash._reinterpolate@3.0.0", + "_inBundle": false, + "_integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=", + "_location": "/lodash._reinterpolate", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "lodash._reinterpolate@~3.0.0", + "name": "lodash._reinterpolate", + "escapedName": "lodash._reinterpolate", + "rawSpec": "~3.0.0", + "saveSpec": null, + "fetchSpec": "~3.0.0" + }, + "_requiredBy": [ + "/lodash.template", + "/lodash.templatesettings" + ], + "_resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", + "_shasum": "0ccf2d89166af03b3663c796538b75ac6e114d9d", + "_spec": "lodash._reinterpolate@~3.0.0", + "_where": "/Users/marcuswilliams/Hosts/modules/ngx-breadcrumbs/src/lib/mc-breadcrumbs/node_modules/lodash.template", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "deprecated": false, + "description": "The modern build of lodash’s internal `reInterpolate` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "name": "lodash._reinterpolate", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "3.0.0" +} diff --git a/src/lib/mc-breadcrumbs/node_modules/lodash.template/LICENSE b/src/lib/mc-breadcrumbs/node_modules/lodash.template/LICENSE new file mode 100644 index 0000000..e0c69d5 --- /dev/null +++ b/src/lib/mc-breadcrumbs/node_modules/lodash.template/LICENSE @@ -0,0 +1,47 @@ +Copyright jQuery Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +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. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/src/lib/mc-breadcrumbs/node_modules/lodash.template/README.md b/src/lib/mc-breadcrumbs/node_modules/lodash.template/README.md new file mode 100644 index 0000000..251b387 --- /dev/null +++ b/src/lib/mc-breadcrumbs/node_modules/lodash.template/README.md @@ -0,0 +1,18 @@ +# lodash.template v4.4.0 + +The [lodash](https://lodash.com/) method `_.template` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.template +``` + +In Node.js: +```js +var template = require('lodash.template'); +``` + +See the [documentation](https://lodash.com/docs#template) or [package source](https://github.com/lodash/lodash/blob/4.4.0-npm-packages/lodash.template) for more details. diff --git a/src/lib/mc-breadcrumbs/node_modules/lodash.template/index.js b/src/lib/mc-breadcrumbs/node_modules/lodash.template/index.js new file mode 100644 index 0000000..5fba1b0 --- /dev/null +++ b/src/lib/mc-breadcrumbs/node_modules/lodash.template/index.js @@ -0,0 +1,1132 @@ +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ +var reInterpolate = require('lodash._reinterpolate'), + templateSettings = require('lodash.templatesettings'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + symbolTag = '[object Symbol]'; + +/** Used to match empty string literals in compiled template source. */ +var reEmptyStringLeading = /\b__p \+= '';/g, + reEmptyStringMiddle = /\b(__p \+=) '' \+/g, + reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; + +/** + * Used to match + * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). + */ +var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** Used to ensure capturing order of template delimiters. */ +var reNoMatch = /($^)/; + +/** Used to match unescaped characters in compiled string literals. */ +var reUnescapedString = /['\n\r\u2028\u2029\\]/g; + +/** Used to escape characters for inclusion in compiled string literals. */ +var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\u2028': 'u2028', + '\u2029': 'u2029' +}; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +/** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function arrayMap(array, iteratee) { + var index = -1, + length = array ? array.length : 0, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; +} + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ +function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); +} + +/** + * Used by `_.template` to escape characters for inclusion in compiled string literals. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ +function escapeStringChar(chr) { + return '\\' + stringEscapes[chr]; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Built-in value references. */ +var Symbol = root.Symbol, + propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + // Safari 9 makes `arguments.length` enumerable in strict mode. + var result = (isArray(value) || isArguments(value)) + ? baseTimes(value.length, String) + : []; + + var length = result.length, + skipIndexes = !!length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + result.push(key); + } + } + return result; +} + +/** + * Used by `_.defaults` to customize its `_.assignIn` use. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to assign. + * @param {Object} object The parent object of `objValue`. + * @returns {*} Returns the value to assign. + */ +function assignInDefaults(objValue, srcValue, key, object) { + if (objValue === undefined || + (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { + return srcValue; + } + return objValue; +} + +/** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + object[key] = value; + } +} + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +/** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; +} + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ +function baseRest(func, start) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = array; + return apply(func, this, otherArgs); + }; +} + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ +function copyObject(source, props, object, customizer) { + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + assignValue(object, key, newValue === undefined ? source[key] : newValue); + } + return object; +} + +/** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ +function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; +} + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +/** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; +} + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +function isArguments(value) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +/** + * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, + * `SyntaxError`, `TypeError`, or `URIError` object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an error object, else `false`. + * @example + * + * _.isError(new Error); + * // => true + * + * _.isError(Error); + * // => false + */ +function isError(value) { + if (!isObjectLike(value)) { + return false; + } + return (objectToString.call(value) == errorTag) || + (typeof value.message == 'string' && typeof value.name == 'string'); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +/** + * This method is like `_.assignIn` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extendWith + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignInWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ +var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keysIn(source), object, customizer); +}); + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +/** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ +function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); +} + +/** + * Creates a compiled template function that can interpolate data properties + * in "interpolate" delimiters, HTML-escape interpolated data properties in + * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data + * properties may be accessed as free variables in the template. If a setting + * object is given, it takes precedence over `_.templateSettings` values. + * + * **Note:** In the development build `_.template` utilizes + * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) + * for easier debugging. + * + * For more information on precompiling templates see + * [lodash's custom builds documentation](https://lodash.com/custom-builds). + * + * For more information on Chrome extension sandboxes see + * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The template string. + * @param {Object} [options={}] The options object. + * @param {RegExp} [options.escape=_.templateSettings.escape] + * The HTML "escape" delimiter. + * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] + * The "evaluate" delimiter. + * @param {Object} [options.imports=_.templateSettings.imports] + * An object to import into the template as free variables. + * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] + * The "interpolate" delimiter. + * @param {string} [options.sourceURL='templateSources[n]'] + * The sourceURL of the compiled template. + * @param {string} [options.variable='obj'] + * The data object variable name. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the compiled template function. + * @example + * + * // Use the "interpolate" delimiter to create a compiled template. + * var compiled = _.template('hello <%= user %>!'); + * compiled({ 'user': 'fred' }); + * // => 'hello fred!' + * + * // Use the HTML "escape" delimiter to escape data property values. + * var compiled = _.template('<%- value %>'); + * compiled({ 'value': '