@k5cjs/router 0.0.1-alpha.0

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/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # Router
2
+
3
+ This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 16.2.0.
4
+
5
+ ## Code scaffolding
6
+
7
+ Run `ng generate component component-name --project router` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project router`.
8
+ > Note: Don't forget to add `--project router` or else it will be added to the default project in your `angular.json` file.
9
+
10
+ ## Build
11
+
12
+ Run `ng build router` to build the project. The build artifacts will be stored in the `dist/` directory.
13
+
14
+ ## Publishing
15
+
16
+ After building your library with `ng build router`, go to the dist folder `cd dist/router` and run `npm publish`.
17
+
18
+ ## Running unit tests
19
+
20
+ Run `ng test router` to execute the unit tests via [Karma](https://karma-runner.github.io).
21
+
22
+ ## Further help
23
+
24
+ To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './public-api';
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiazVjanMtcm91dGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vcHJvamVjdHMvcm91dGVyL3NyYy9rNWNqcy1yb3V0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcbiJdfQ==
@@ -0,0 +1,8 @@
1
+ export const relativeToByComponentName = (route, name) => {
2
+ if (route.component?.name === name)
3
+ return route;
4
+ if (!route.parent)
5
+ return route;
6
+ return relativeToByComponentName(route.parent, name);
7
+ };
8
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVsYXRpdmUtdG8tYnktY29tcG9uZW50LW5hbWUuaGVscGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvcm91dGVyL3NyYy9saWIvcmVsYXRpdmUtdG8tYnktY29tcG9uZW50LW5hbWUuaGVscGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE1BQU0sQ0FBQyxNQUFNLHlCQUF5QixHQUFHLENBQUMsS0FBcUIsRUFBRSxJQUFZLEVBQWtCLEVBQUU7SUFDL0YsSUFBSSxLQUFLLENBQUMsU0FBUyxFQUFFLElBQUksS0FBSyxJQUFJO1FBQUUsT0FBTyxLQUFLLENBQUM7SUFFakQsSUFBSSxDQUFDLEtBQUssQ0FBQyxNQUFNO1FBQUUsT0FBTyxLQUFLLENBQUM7SUFFaEMsT0FBTyx5QkFBeUIsQ0FBQyxLQUFLLENBQUMsTUFBTSxFQUFFLElBQUksQ0FBQyxDQUFDO0FBQ3ZELENBQUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEFjdGl2YXRlZFJvdXRlIH0gZnJvbSAnQGFuZ3VsYXIvcm91dGVyJztcblxuZXhwb3J0IGNvbnN0IHJlbGF0aXZlVG9CeUNvbXBvbmVudE5hbWUgPSAocm91dGU6IEFjdGl2YXRlZFJvdXRlLCBuYW1lOiBzdHJpbmcpOiBBY3RpdmF0ZWRSb3V0ZSA9PiB7XG4gIGlmIChyb3V0ZS5jb21wb25lbnQ/Lm5hbWUgPT09IG5hbWUpIHJldHVybiByb3V0ZTtcblxuICBpZiAoIXJvdXRlLnBhcmVudCkgcmV0dXJuIHJvdXRlO1xuXG4gIHJldHVybiByZWxhdGl2ZVRvQnlDb21wb25lbnROYW1lKHJvdXRlLnBhcmVudCwgbmFtZSk7XG59O1xuIl19
@@ -0,0 +1,5 @@
1
+ /*
2
+ * Public API Surface of router
3
+ */
4
+ export * from './lib/relative-to-by-component-name.helper';
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL3JvdXRlci9zcmMvcHVibGljLWFwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsNENBQTRDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKlxuICogUHVibGljIEFQSSBTdXJmYWNlIG9mIHJvdXRlclxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vbGliL3JlbGF0aXZlLXRvLWJ5LWNvbXBvbmVudC1uYW1lLmhlbHBlcic7XG4iXX0=
@@ -0,0 +1,18 @@
1
+ const relativeToByComponentName = (route, name) => {
2
+ if (route.component?.name === name)
3
+ return route;
4
+ if (!route.parent)
5
+ return route;
6
+ return relativeToByComponentName(route.parent, name);
7
+ };
8
+
9
+ /*
10
+ * Public API Surface of router
11
+ */
12
+
13
+ /**
14
+ * Generated bundle index. Do not edit.
15
+ */
16
+
17
+ export { relativeToByComponentName };
18
+ //# sourceMappingURL=k5cjs-router.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"k5cjs-router.mjs","sources":["../../../projects/router/src/lib/relative-to-by-component-name.helper.ts","../../../projects/router/src/public-api.ts","../../../projects/router/src/k5cjs-router.ts"],"sourcesContent":["import { ActivatedRoute } from '@angular/router';\n\nexport const relativeToByComponentName = (route: ActivatedRoute, name: string): ActivatedRoute => {\n if (route.component?.name === name) return route;\n\n if (!route.parent) return route;\n\n return relativeToByComponentName(route.parent, name);\n};\n","/*\n * Public API Surface of router\n */\n\nexport * from './lib/relative-to-by-component-name.helper';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"MAEa,yBAAyB,GAAG,CAAC,KAAqB,EAAE,IAAY,KAAoB;AAC/F,IAAA,IAAI,KAAK,CAAC,SAAS,EAAE,IAAI,KAAK,IAAI;AAAE,QAAA,OAAO,KAAK,CAAC;IAEjD,IAAI,CAAC,KAAK,CAAC,MAAM;AAAE,QAAA,OAAO,KAAK,CAAC;IAEhC,OAAO,yBAAyB,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AACvD;;ACRA;;AAEG;;ACFH;;AAEG;;;;"}
package/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@k5cjs/router" />
5
+ export * from './public-api';
@@ -0,0 +1,2 @@
1
+ import { ActivatedRoute } from '@angular/router';
2
+ export declare const relativeToByComponentName: (route: ActivatedRoute, name: string) => ActivatedRoute;
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "@k5cjs/router",
3
+ "version": "0.0.1-alpha.0",
4
+ "peerDependencies": {
5
+ "@angular/router": "^16.2.0"
6
+ },
7
+ "dependencies": {
8
+ "tslib": "^2.3.0"
9
+ },
10
+ "sideEffects": false,
11
+ "module": "fesm2022/k5cjs-router.mjs",
12
+ "typings": "index.d.ts",
13
+ "exports": {
14
+ "./package.json": {
15
+ "default": "./package.json"
16
+ },
17
+ ".": {
18
+ "types": "./index.d.ts",
19
+ "esm2022": "./esm2022/k5cjs-router.mjs",
20
+ "esm": "./esm2022/k5cjs-router.mjs",
21
+ "default": "./fesm2022/k5cjs-router.mjs"
22
+ }
23
+ }
24
+ }
@@ -0,0 +1 @@
1
+ export * from './lib/relative-to-by-component-name.helper';