|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
701 bytes
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 |
|
|---|
| 3 | Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|---|
| 4 |
|
|---|
| 5 | const keys = require('./keys.js');
|
|---|
| 6 | const assignValue = require('../_internal/assignValue.js');
|
|---|
| 7 | const isObject = require('../predicate/isObject.js');
|
|---|
| 8 |
|
|---|
| 9 | function create(prototype, properties) {
|
|---|
| 10 | const proto = isObject.isObject(prototype) ? Object.create(prototype) : {};
|
|---|
| 11 | if (properties != null) {
|
|---|
| 12 | const propsKeys = keys.keys(properties);
|
|---|
| 13 | for (let i = 0; i < propsKeys.length; i++) {
|
|---|
| 14 | const key = propsKeys[i];
|
|---|
| 15 | const propsValue = properties[key];
|
|---|
| 16 | assignValue.assignValue(proto, key, propsValue);
|
|---|
| 17 | }
|
|---|
| 18 | }
|
|---|
| 19 | return proto;
|
|---|
| 20 | }
|
|---|
| 21 |
|
|---|
| 22 | exports.create = create;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.