@loaders.gl/draco
Advanced tools
Comparing version 1.0.0-alpha.2 to 1.0.0-alpha.3
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -13,12 +11,4 @@ value: true | ||
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); | ||
var _gltfTypeUtils = require("./gltf-type-utils"); | ||
var POSITION = 'POSITION'; | ||
var TEXCOORD_0 = 'TEXCOORD_0'; | ||
var TEXCOORD_1 = 'TEXCOORD_1'; | ||
var TEXCOORD_2 = 'TEXCOORD_2'; | ||
var ATTRIBUTE_PATTERNS = [[/color/i, 'COLOR_0'], [/pickingColor/i, 'COLOR_1'], [/normal/i, 'NORMAL'], [/tangent/i, 'TANGENT'], [/texCoord1/i, TEXCOORD_0], [/texCoord2/i, TEXCOORD_1], [/texCoord3/i, TEXCOORD_2], [/texCoord/i, TEXCOORD_0], [/uv1/i, TEXCOORD_0], [/uv2/i, TEXCOORD_1], [/uv3/i, TEXCOORD_2], [/uv/i, TEXCOORD_0], [/joints/i, 'JOINTS_0'], [/weights/i, 'WEIGHTS_0'], [/pos/i, POSITION], [/vertex/i, POSITION], [/vertices/i, POSITION]]; | ||
function getGLTFIndices(attributes) { | ||
@@ -79,18 +69,2 @@ for (var name in attributes) { | ||
function getGLTFAttributeName(name) { | ||
name = name.toLowerCase(); | ||
for (var _i = 0; _i < ATTRIBUTE_PATTERNS.length; _i++) { | ||
var _ATTRIBUTE_PATTERNS$_ = (0, _slicedToArray2.default)(ATTRIBUTE_PATTERNS[_i], 2), | ||
regex = _ATTRIBUTE_PATTERNS$_[0], | ||
standardizedName = _ATTRIBUTE_PATTERNS$_[1]; | ||
if (regex.exec(name)) { | ||
return standardizedName; | ||
} | ||
} | ||
return null; | ||
} | ||
function getAccessorData(attribute, attributeName) { | ||
@@ -97,0 +71,0 @@ var buffer = attribute; |
@@ -1,8 +0,2 @@ | ||
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray"; | ||
import { getAccessorTypeFromSize, getComponentTypeFromArray } from './gltf-type-utils'; | ||
const POSITION = 'POSITION'; | ||
const TEXCOORD_0 = 'TEXCOORD_0'; | ||
const TEXCOORD_1 = 'TEXCOORD_1'; | ||
const TEXCOORD_2 = 'TEXCOORD_2'; | ||
const ATTRIBUTE_PATTERNS = [[/color/i, 'COLOR_0'], [/pickingColor/i, 'COLOR_1'], [/normal/i, 'NORMAL'], [/tangent/i, 'TANGENT'], [/texCoord1/i, TEXCOORD_0], [/texCoord2/i, TEXCOORD_1], [/texCoord3/i, TEXCOORD_2], [/texCoord/i, TEXCOORD_0], [/uv1/i, TEXCOORD_0], [/uv2/i, TEXCOORD_1], [/uv3/i, TEXCOORD_2], [/uv/i, TEXCOORD_0], [/joints/i, 'JOINTS_0'], [/weights/i, 'WEIGHTS_0'], [/pos/i, POSITION], [/vertex/i, POSITION], [/vertices/i, POSITION]]; | ||
export function getGLTFIndices(attributes) { | ||
@@ -60,19 +54,2 @@ for (const name in attributes) { | ||
function getGLTFAttributeName(name) { | ||
name = name.toLowerCase(); | ||
for (const _ref of ATTRIBUTE_PATTERNS) { | ||
var _ref2 = _slicedToArray(_ref, 2); | ||
const regex = _ref2[0]; | ||
const standardizedName = _ref2[1]; | ||
if (regex.exec(name)) { | ||
return standardizedName; | ||
} | ||
} | ||
return null; | ||
} | ||
function getAccessorData(attribute, attributeName) { | ||
@@ -79,0 +56,0 @@ let buffer = attribute; |
@@ -1,8 +0,2 @@ | ||
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray"; | ||
import { getAccessorTypeFromSize, getComponentTypeFromArray } from './gltf-type-utils'; | ||
var POSITION = 'POSITION'; | ||
var TEXCOORD_0 = 'TEXCOORD_0'; | ||
var TEXCOORD_1 = 'TEXCOORD_1'; | ||
var TEXCOORD_2 = 'TEXCOORD_2'; | ||
var ATTRIBUTE_PATTERNS = [[/color/i, 'COLOR_0'], [/pickingColor/i, 'COLOR_1'], [/normal/i, 'NORMAL'], [/tangent/i, 'TANGENT'], [/texCoord1/i, TEXCOORD_0], [/texCoord2/i, TEXCOORD_1], [/texCoord3/i, TEXCOORD_2], [/texCoord/i, TEXCOORD_0], [/uv1/i, TEXCOORD_0], [/uv2/i, TEXCOORD_1], [/uv3/i, TEXCOORD_2], [/uv/i, TEXCOORD_0], [/joints/i, 'JOINTS_0'], [/weights/i, 'WEIGHTS_0'], [/pos/i, POSITION], [/vertex/i, POSITION], [/vertices/i, POSITION]]; | ||
export function getGLTFIndices(attributes) { | ||
@@ -60,18 +54,2 @@ for (var name in attributes) { | ||
function getGLTFAttributeName(name) { | ||
name = name.toLowerCase(); | ||
for (var _i = 0; _i < ATTRIBUTE_PATTERNS.length; _i++) { | ||
var _ATTRIBUTE_PATTERNS$_ = _slicedToArray(ATTRIBUTE_PATTERNS[_i], 2), | ||
regex = _ATTRIBUTE_PATTERNS$_[0], | ||
standardizedName = _ATTRIBUTE_PATTERNS$_[1]; | ||
if (regex.exec(name)) { | ||
return standardizedName; | ||
} | ||
} | ||
return null; | ||
} | ||
function getAccessorData(attribute, attributeName) { | ||
@@ -78,0 +56,0 @@ var buffer = attribute; |
{ | ||
"name": "@loaders.gl/draco", | ||
"version": "1.0.0-alpha.2", | ||
"version": "1.0.0-alpha.3", | ||
"description": "Framework-independent loader and writer for Draco compressed meshes and point clouds", | ||
@@ -39,5 +39,5 @@ "license": "MIT", | ||
"@babel/runtime": "^7.3.1", | ||
"@loaders.gl/core": "1.0.0-alpha.2", | ||
"@loaders.gl/core": "1.0.0-alpha.3", | ||
"draco3d": "^1.3.4" | ||
} | ||
} |
// TODO - remove | ||
import {getAccessorTypeFromSize, getComponentTypeFromArray} from './gltf-type-utils'; | ||
// Patters that map known names to GLTF counterparts | ||
const POSITION = 'POSITION'; | ||
const TEXCOORD_0 = 'TEXCOORD_0'; | ||
const TEXCOORD_1 = 'TEXCOORD_1'; | ||
const TEXCOORD_2 = 'TEXCOORD_2'; | ||
const ATTRIBUTE_PATTERNS = [ | ||
[/color/i, 'COLOR_0'], | ||
[/pickingColor/i, 'COLOR_1'], | ||
[/normal/i, 'NORMAL'], | ||
[/tangent/i, 'TANGENT'], | ||
[/texCoord1/i, TEXCOORD_0], | ||
[/texCoord2/i, TEXCOORD_1], | ||
[/texCoord3/i, TEXCOORD_2], | ||
[/texCoord/i, TEXCOORD_0], | ||
[/uv1/i, TEXCOORD_0], | ||
[/uv2/i, TEXCOORD_1], | ||
[/uv3/i, TEXCOORD_2], | ||
[/uv/i, TEXCOORD_0], | ||
[/joints/i, 'JOINTS_0'], | ||
[/weights/i, 'WEIGHTS_0'], | ||
[/pos/i, POSITION], | ||
[/vertex/i, POSITION], | ||
[/vertices/i, POSITION] | ||
]; | ||
// Returns the indices array, if present | ||
@@ -92,14 +66,2 @@ export function getGLTFIndices(attributes) { | ||
// Convert an attribute name string to glTF 2.0 recommended attribute names | ||
// https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#geometry | ||
function getGLTFAttributeName(name) { | ||
name = name.toLowerCase(); | ||
for (const [regex, standardizedName] of ATTRIBUTE_PATTERNS) { | ||
if (regex.exec(name)) { | ||
return standardizedName; | ||
} | ||
} | ||
return null; | ||
} | ||
function getAccessorData(attribute, attributeName) { | ||
@@ -106,0 +68,0 @@ let buffer = attribute; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
62
7042543
22269
2
+ Added@loaders.gl/core@1.0.0-alpha.3(transitive)
- Removed@loaders.gl/core@1.0.0-alpha.2(transitive)