Commit a8cd77a0 authored by Anthony Garritano's avatar Anthony Garritano

Merge branch 'export-value-by-key' into 'develop'

Export value by key

See merge request !14
parents 5782c0b1 e30a14a0
Pipeline #86014 passed with stages
in 4 minutes and 33 seconds
......@@ -2,6 +2,14 @@
Monorepo for building-block type utilities that don't have dependencies on any other `@psu` libraries.
- [Angular](https://git.psu.edu/ais-swe/ux/utils/tree/develop/libs/utils/angular)
- Before Unload directive
- Caps Lock directive
- Coalescing Component Factory Resolver
- ngLet directive
- Safe pipe
- Value By Key pipe
- Yes/No pipe
- [Browser](https://git.psu.edu/ais-swe/ux/utils/tree/develop/libs/utils/browser)
- Cache Interceptor
- Autofocus Directive
......
......@@ -141,11 +141,6 @@
"setupFile": "libs/utils/src/test-setup.ts"
}
}
},
"schematics": {
"@nrwl/angular:component": {
"styleext": "scss"
}
}
},
"utils-security": {
......@@ -169,11 +164,6 @@
"setupFile": "libs/utils/security/src/test-setup.ts"
}
}
},
"schematics": {
"@nrwl/angular:component": {
"styleext": "scss"
}
}
},
"utils-rx": {
......@@ -197,11 +187,6 @@
"setupFile": "libs/utils/rx/src/test-setup.ts"
}
}
},
"schematics": {
"@nrwl/angular:component": {
"styleext": "scss"
}
}
},
"utils-browser": {
......@@ -225,11 +210,6 @@
"setupFile": "libs/utils/browser/src/test-setup.ts"
}
}
},
"schematics": {
"@nrwl/angular:component": {
"styleext": "scss"
}
}
},
"utils-angular": {
......@@ -253,11 +233,6 @@
"setupFile": "libs/utils/angular/src/test-setup.ts"
}
}
},
"schematics": {
"@nrwl/angular:component": {
"styleext": "scss"
}
}
},
"utils-responsive": {
......@@ -281,11 +256,6 @@
"setupFile": "libs/utils/responsive/src/test-setup.ts"
}
}
},
"schematics": {
"@nrwl/angular:component": {
"styleext": "scss"
}
}
},
"utils-theming": {
......@@ -309,11 +279,6 @@
"setupFile": "libs/utils/theming/src/test-setup.ts"
}
}
},
"schematics": {
"@nrwl/angular:component": {
"styleext": "scss"
}
}
}
},
......@@ -331,14 +296,14 @@
"e2eTestRunner": "cypress"
},
"@nrwl/angular:library": {
"unitTestRunner": "jest",
"directory": "utils",
"simpleModuleName": true,
"style": "scss"
"style": "scss",
"unitTestRunner": "jest"
},
"@psu/schematics:ng-new": {
"workspaceType": "library"
}
},
"defaultProject": "demo"
"defaultProject": "utils"
}
module.exports = {
testMatch: ["**/+(*.)+(spec|test).+(ts|js)?(x)"],
testMatch: ['**/+(*.)+(spec|test).+(ts|js)?(x)'],
transform: {
"^.+\\.(ts|js|html)$": "ts-jest"
'^.+\\.(ts|js|html)$': 'ts-jest'
},
resolver: "@nrwl/jest/plugins/resolver",
moduleFileExtensions: ["ts", "js", "html"],
resolver: '@nrwl/jest/plugins/resolver',
moduleFileExtensions: ['ts', 'js', 'html'],
collectCoverage: true,
coverageReporters: ["html"]
coverageReporters: ['lcov', 'html', 'text']
};
# utils-angular
# Angular Utils
This library was generated with [Nx](https://nx.dev).
## before-unload directive
## Running unit tests
## caps-lock directive
Run `nx test utils-angular` to execute the unit tests.
## coalescing-component-factory-resolver
## ng-let directive
## safe pipe
## value-by-key pipe
Pipe that returns an object's value by key
### Usage
```js
let obj = {
a: { name: 'one' },
b: { name: 'two' },
c: { name: 'three' }
};
```
```html
<!-- Will output "one" -->
<span>{{ (obj | valueByKey : 'a')?.name }}</span>
```
## yes-no pipe
......@@ -7,5 +7,7 @@ export * from './lib/ng-let/ng-let.directive';
export * from './lib/ng-let/ng-let.module';
export * from './lib/safe-pipe/safe-pipe.module';
export * from './lib/safe-pipe/safe-pipe.pipe';
export { ValueByKeyModule } from './lib/value-by-key/value-by-key.module';
export { ValueByKeyPipe } from './lib/value-by-key/value-by-key.pipe';
export * from './lib/yes-no/yes-no.module';
export * from './lib/yes-no/yes-no.pipe';
......@@ -8,28 +8,28 @@
"nx.json": "*"
},
"projects": {
"demo-e2e": {
"demo": {
"tags": []
},
"demo": {
"demo-e2e": {
"tags": []
},
"utils": {
"tags": ["none"]
},
"utils-security": {
"utils-angular": {
"tags": []
},
"utils-rx": {
"utils-browser": {
"tags": []
},
"utils-browser": {
"utils-responsive": {
"tags": []
},
"utils-angular": {
"utils-rx": {
"tags": []
},
"utils-responsive": {
"utils-security": {
"tags": []
},
"utils-theming": {
......
......@@ -95,28 +95,28 @@
"url": "https://git.psu.edu/ais-swe/ux/utils"
},
"lint-staged": {
"*.json": [
"prettier --write",
"*.html": [
"html-beautify -qr",
"git add"
],
"*.ts": [
"*.json": [
"prettier --write",
"tslint --project tsconfig.json",
"git add"
],
"*.html": [
"html-beautify -qr",
"git add"
],
"*.scss": [
"css-beautify -qr",
"git add"
],
"*.ts": [
"prettier --write",
"tslint --fix --project tsconfig.json",
"git add"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"pre-push": "yarn test"
"pre-push": "yarn test utils"
}
},
"config": {
......
......@@ -17,11 +17,11 @@
"baseUrl": ".",
"paths": {
"@psu/utils": ["libs/utils/src/index.ts"],
"@psu/utils/security": ["libs/utils/security/src/index.ts"],
"@psu/utils/rx": ["libs/utils/rx/src/index.ts"],
"@psu/utils/browser": ["libs/utils/browser/src/index.ts"],
"@psu/utils/angular": ["libs/utils/angular/src/index.ts"],
"@psu/utils/browser": ["libs/utils/browser/src/index.ts"],
"@psu/utils/responsive": ["libs/utils/responsive/src/index.ts"],
"@psu/utils/rx": ["libs/utils/rx/src/index.ts"],
"@psu/utils/security": ["libs/utils/security/src/index.ts"],
"@psu/utils/theming": ["libs/utils/theming/src/index.ts"]
}
},
......
{
"rulesDirectory": [
"node_modules/@nrwl/workspace/src/tslint",
"node_modules/codelyzer"
],
"rulesDirectory": ["node_modules/@nrwl/workspace/src/tslint", "node_modules/codelyzer"],
"rules": {
"arrow-return-shorthand": true,
"callable-types": true,
......@@ -17,17 +14,12 @@
"member-ordering": [
true,
{
"order": [
"static-field",
"instance-field",
"static-method",
"instance-method"
]
"order": ["static-field", "instance-field", "static-method", "instance-method"]
}
],
"no-arg": true,
"no-bitwise": true,
"no-console": [true, "debug", "info", "time", "timeEnd", "trace"],
"no-console": [true, "debug", "info", "log", "time", "timeEnd", "trace"],
"no-construct": true,
"no-debugger": true,
"no-duplicate-super": true,
......@@ -62,8 +54,8 @@
]
}
],
"directive-selector": [true, "attribute", "app", "camelCase"],
"component-selector": [true, "element", "app", "kebab-case"],
"directive-selector": [true, "attribute", "ut", "camelCase"],
"component-selector": [true, "element", "ut", "kebab-case"],
"no-conflicting-lifecycle": true,
"no-host-metadata-property": true,
"no-input-rename": true,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment