Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

loopback-component-model-extender

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loopback-component-model-extender - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

.eslintignore

29

index.js

@@ -0,8 +1,10 @@

/* eslint global-require: 0 */
'use strict'
const kebabCase = require('lodash.kebabcase')
const fs = require('fs')
const path = require('path')
const debug = require('debug')('loopback:component:model-extender')
const appRoot = require('app-root-path')
const requireAll = require('require-all')

@@ -26,2 +28,3 @@ module.exports = (app, options) => {

let log = options.log || console
if (typeof log === 'string') {

@@ -32,18 +35,14 @@ log = require(log)

// Apply models customisations.
function customizeModel(sourcePath) {
fs.readdirSync(sourcePath).forEach(sourceFile => {
const filePath = path.join(sourcePath, sourceFile)
if (path.extname(sourceFile) === '.js') {
debug('Loading customization script %s', filePath)
const code = require(filePath)
function customizeModel(dirname) {
requireAll({
dirname,
resolve: code => {
debug('Loading customization script %s', code)
if (typeof code === 'function') {
debug('Customizing model %s', Model.modelName)
code(Model)
return code(Model)
}
else {
debug('Skipping model file %s - `module.exports` is not a function', sourceFile)
}
}
debug('Skipping model file %s - `module.exports` is not a function', code)
return code
},
})

@@ -65,3 +64,3 @@ }

log.error(`Failure loading component path: ${requirePath}`, err.stack)
process.exit(1)
throw err
}

@@ -68,0 +67,0 @@ }

{
"name": "loopback-component-model-extender",
"version": "0.1.4",
"version": "0.1.5",
"description": "Loopback Component Model Extender",
"main": "index.js",
"scripts": {
"test": "mocha test/**/*.test.js"
"lint": "eslint .",
"pretest": "npm run lint",
"test": "nyc --reporter=lcov --reporter=text --reporter=text-summary mocha test/*test.js",
"test:watch": "npm run test -- -w",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
},
"repository": {
"type": "git",
"url": "git+https://github.com/fullcube/loopback-component-model.extender.git"
"url": "https://github.com/fullcube/loopback-component-model-extender.git"
},

@@ -19,5 +24,5 @@ "keywords": [

"bugs": {
"url": "https://github.com/fullcube/loopback-component-model.extender/issues"
"url": "https://github.com/fullcube/loopback-component-model-extender/issues"
},
"homepage": "https://github.com/fullcube/loopback-component-model.extender#readme",
"homepage": "https://github.com/fullcube/loopback-component-model-extender#readme",
"dependencies": {

@@ -29,5 +34,36 @@ "app-root-path": "2.0.1",

"devDependencies": {
"@bubltechnology/customizable-commit-analyzer": "1.0.2-0",
"chai": "3.5.0",
"mocha": "3.1.2"
"condition-circle": "1.5.0",
"cors": "2.8.3",
"coveralls": "2.13.1",
"eslint": "3.19.0",
"eslint-config-fullcube": "2.0.35-latest-20170602-0428.0",
"loopback": "3.8.0",
"loopback-boot": "2.24.0",
"mocha": "3.1.2",
"nyc": "11.0.2",
"require-all": "2.2.0",
"semantic-release": "6.3.6",
"strong-error-handler": "2.1.0"
},
"config": {
"commitTypeMap": {
"feat": "minor",
"fix": "patch",
"docs": "patch",
"style": "patch",
"refactor": "patch",
"perf": "patch",
"test": "patch",
"build": "patch",
"ci": "patch",
"chore": "patch",
"revert": "patch"
}
},
"release": {
"verifyConditions": "condition-circle",
"analyzeCommits": "@bubltechnology/customizable-commit-analyzer"
}
}
}
# Loopback Component Model Extender
[![CircleCI](https://circleci.com/gh/fullcube/loopback-component-model-extender.svg?style=svg)](https://circleci.com/gh/fullcube/loopback-component-model-extender) [![Dependencies](http://img.shields.io/david/fullcube/loopback-component-model-extender.svg?style=flat)](https://david-dm.org/fullcube/loopback-component-model-extender) [![Coverage Status](https://coveralls.io/repos/github/fullcube/loopback-component-model-extender/badge.svg?branch=master)](https://coveralls.io/github/fullcube/loopback-component-model-extender?branch=master)
A loopback component that enables componentized model customisation.

@@ -4,0 +6,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc