feat(ui): finalize E-TIB modernization with footer redesign, video optimization, and TS fixes
Former-commit-id: 67ac02c8404cc66893fdf97308574701cca6000c
This commit is contained in:
Generated
Vendored
+41
@@ -0,0 +1,41 @@
|
||||
'use strict'
|
||||
|
||||
var sep = require('path').sep
|
||||
|
||||
module.exports = function (file) {
|
||||
var segments = file.split(sep)
|
||||
var index = segments.lastIndexOf('node_modules')
|
||||
|
||||
if (index === -1) return
|
||||
if (!segments[index + 1]) return
|
||||
|
||||
var scoped = segments[index + 1][0] === '@'
|
||||
var name = scoped ? segments[index + 1] + '/' + segments[index + 2] : segments[index + 1]
|
||||
var offset = scoped ? 3 : 2
|
||||
|
||||
var basedir = ''
|
||||
var lastBaseDirSegmentIndex = index + offset - 1
|
||||
for (var i = 0; i <= lastBaseDirSegmentIndex; i++) {
|
||||
if (i === lastBaseDirSegmentIndex) {
|
||||
basedir += segments[i]
|
||||
} else {
|
||||
basedir += segments[i] + sep
|
||||
}
|
||||
}
|
||||
|
||||
var path = ''
|
||||
var lastSegmentIndex = segments.length - 1
|
||||
for (var i2 = index + offset; i2 <= lastSegmentIndex; i2++) {
|
||||
if (i2 === lastSegmentIndex) {
|
||||
path += segments[i2]
|
||||
} else {
|
||||
path += segments[i2] + sep
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
name: name,
|
||||
basedir: basedir,
|
||||
path: path
|
||||
}
|
||||
}
|
||||
Generated
Vendored
+47
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"name": "module-details-from-path",
|
||||
"version": "1.0.4",
|
||||
"description": "Resolve npm package details, like name and base path, given an absolute path to a file inside a package",
|
||||
"main": "index.js",
|
||||
"files": [],
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"bench-node": "^0.5.4",
|
||||
"standard": "^15.0.1",
|
||||
"tape": "^4.6.0"
|
||||
},
|
||||
"scripts": {
|
||||
"bench": "node --allow-natives-syntax bench.js",
|
||||
"lint": "standard",
|
||||
"test": "standard && node test.js",
|
||||
"test:ci": "node test.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/watson/module-details-from-path.git"
|
||||
},
|
||||
"keywords": [
|
||||
"node",
|
||||
"nodejs",
|
||||
"npm",
|
||||
"module",
|
||||
"package",
|
||||
"extract",
|
||||
"parse",
|
||||
"name",
|
||||
"basedir",
|
||||
"directory",
|
||||
"path",
|
||||
"relative"
|
||||
],
|
||||
"author": "Thomas Watson <w@tson.dk> (https://wa.tson.dk/)",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/watson/module-details-from-path/issues"
|
||||
},
|
||||
"homepage": "https://github.com/watson/module-details-from-path#readme",
|
||||
"coordinates": [
|
||||
55.666507,
|
||||
12.5798711
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user