执行过npm install命令的vue-element-admin源码
康凯
2022-05-20 aa4c235a8ca67ea8b731f90c951a465e92c0a865
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import {
  noop,
  resolve as _resolve
} from '../-internal';
 
/**
  `Promise.resolve` returns a promise that will become resolved with the
  passed `value`. It is shorthand for the following:
 
  ```javascript
  import Promise from 'rsvp';
 
  let promise = new Promise(function(resolve, reject){
    resolve(1);
  });
 
  promise.then(function(value){
    // value === 1
  });
  ```
 
  Instead of writing the above, your code now simply becomes the following:
 
  ```javascript
  import Promise from 'rsvp';
 
  let promise = RSVP.Promise.resolve(1);
 
  promise.then(function(value){
    // value === 1
  });
  ```
 
  @method resolve
  @for Promise
  @static
  @param {*} object value that the returned promise will be resolved with
  @param {String} [label] optional string for identifying the returned promise.
  Useful for tooling.
  @return {Promise} a promise that will become fulfilled with the given
  `value`
*/
export default function resolve(object, label) {
  /*jshint validthis:true */
  let Constructor = this;
 
  if (object && typeof object === 'object' && object.constructor === Constructor) {
    return object;
  }
 
  let promise = new Constructor(noop, label);
  _resolve(promise, object);
  return promise;
}